Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

-Simple Sim Diagnostic Tool-

Shippou Oud
The Fox Within
Join date: 11 Jul 2005
Posts: 141
12-29-2006 16:51
I created this little tool, to tell observers some basic informatio about the area they are in, here is the script, and explanation after words.
CODE

default
{
on_rez(integer x)
{
llResetScript();
}
state_entry()
{
llSetTimerEvent(1);
}

timer()
{
string rn = llGetRegionName();
string lo = llKey2Name(llGetLandOwnerAt(llGetPos()));

if (lo == "")
{
lo = "Group Owned";
}
float di = llGetRegionTimeDilation();
integer fs = (integer) llGetRegionFPS();
vector la = llGetPos();

llSetText("Region: " + rn + " \n Land Owner: " + lo + "\n Dilation: " + (string) di + " \n FPS: " + (string) fs + "\n Position: " + (string) la,<1,0,.5>,1);
}
}


You'll notice I used a timer to refresh the data being collected, I find this the easiest way to do this. Under the timer event, I have all the floats, integers, strings, and varables declared. If I put these as global (befor default) they would NOT refresh, and be static.
Down to
From: someone

string lo = llKey2Name(llGetLandOwnerAt(llGetPos()));

This took me a while to figure out on my own (call me a newby, go ahead), but that configuration returns the name of the property owner, at the position the object is at.
Right under it I stuck an If statment. I noticed if the land is group owned, the Key2Name will return a blank. So I desided to put something in there instead of leaving it blank.

The rest of the script is pretty self explanitory, once ya get to llSetText it may get a little confusing, but all I did was arange how I wanted the data to be displayed above the object.
After all's sayed and done, it should look like this when compiled, and ran.
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
01-06-2007 09:25
/54/5f/158921/1.html
_____________________
i've got nothing. ;)