Friday, March 7, 2008

HTML on a Prim cycling web pages - perfect for blogs.

Linden Labs did a small first step towards making shared browsing in our 3d world yesterday. To do it you'll need to download the new release client, which is running pretty well on my machine. Afterwards you can do some neat stuff as a landowner that wasn't possible before, such as putting a webpage on a prim!

Here I have created a script which allows you to set up three sites, when you touch the prim it cycles to the next site. Perfect for your blogs or other things. Remember to replace the http addresses at the top of the script with your own. Happy browsing.


integer site = 1;
string site1 = “http://ingmanndesign.com”; //replace with your site
string site2 = “http://site2.com”; //replace with your second site
string site3= “http://site3.com”; //replace with your third site
default{ // beginning of state
state_entry()
{ // stuff between this set of brackets happens when script first loads.
// or the script gets reset.
//Currently set to display the 'main' site.
llParcelMediaCommandList
([
PARCEL_MEDIA_COMMAND_URL, site1,
PARCEL_MEDIA_COMMAND_TYPE, “text/html”
]);
}

touch_start(integer total_number)
{ //start of touch stuff
if ( site == 1.0 )
{ // bracket to start doing stuff if the site is 1.0
llParcelMediaCommandList
([
PARCEL_MEDIA_COMMAND_URL, site1,
PARCEL_MEDIA_COMMAND_TYPE, “text/html”
]);
site = 2;
} // bracket to end the first if statement

else if ( site == 2 ) // “else if” is what you use for the script to keep
// checking stuff in case that first if statement
// isn’t valid
{ // bracket starts the else if stuff
llParcelMediaCommandList
([
PARCEL_MEDIA_COMMAND_URL, site2,
PARCEL_MEDIA_COMMAND_TYPE, “text/html”
]);
site = 3;
} // end this else if stuff

else if ( site == 3)
{
llParcelMediaCommandList
([
PARCEL_MEDIA_COMMAND_URL, site3,
PARCEL_MEDIA_COMMAND_TYPE, “text/html”
]);
site = 1;
}
} // end of touch stuff
} // end of state



// Please note I am not responsible for anything you choose to display using this script, it is entirely possible to display items offensive or against the TOS, if you modify this script to do so know that I did not design it as such.

0 comments:

Post a Comment

Subscribe | Contact Us | © 2007 Ingmann Design Group (IDG)