Difference between revisions of "Group key finder"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) m (merged example scripts cause of redundancy and added constants to llWhisper call) |
m (<lsl> tag to <source>) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
Place this script in a prim and touch it to find out the set group's key. | Place this script in a prim and touch it to find out the set group's key. | ||
< | <source lang="lsl2"> | ||
default | default | ||
{ | { | ||
Line 11: | Line 11: | ||
llSetText("Touch to learn\nGroup Key", <1.0, 1.0, 1.0>, (float)TRUE); | llSetText("Touch to learn\nGroup Key", <1.0, 1.0, 1.0>, (float)TRUE); | ||
} | } | ||
touch_start(integer num_detected) | touch_start(integer num_detected) | ||
{ | { | ||
key thisPrim = llGetKey(); | key thisPrim = llGetKey(); | ||
list objectDetails = llGetObjectDetails(thisPrim, [OBJECT_GROUP]); | list objectDetails = llGetObjectDetails(thisPrim, [OBJECT_GROUP]); | ||
key objectGroup = llList2Key(objectDetails, 0); | |||
string output = "Please set the group for this object in EDIT under the GENERAL tab first."; | string output = "Please set the group for this object in EDIT under the GENERAL tab first."; | ||
if (objectGroup != NULL_KEY) | if (objectGroup != NULL_KEY) | ||
output = "This object's group key is: '" + (string)objectGroup + "'."; | output = "This object's group key is: '" + (string)objectGroup + "'."; | ||
// PUBLIC_CHANNEL has the integer value 0 | // PUBLIC_CHANNEL has the integer value 0 | ||
llWhisper(PUBLIC_CHANNEL, output); | llWhisper(PUBLIC_CHANNEL, output); | ||
} | } | ||
} | } | ||
</ | </source> |
Latest revision as of 21:30, 24 January 2015
The Group Key Finder
Place this script in a prim and touch it to find out the set group's key.
default
{
state_entry()
{
// white and opaque text
llSetText("Touch to learn\nGroup Key", <1.0, 1.0, 1.0>, (float)TRUE);
}
touch_start(integer num_detected)
{
key thisPrim = llGetKey();
list objectDetails = llGetObjectDetails(thisPrim, [OBJECT_GROUP]);
key objectGroup = llList2Key(objectDetails, 0);
string output = "Please set the group for this object in EDIT under the GENERAL tab first.";
if (objectGroup != NULL_KEY)
output = "This object's group key is: '" + (string)objectGroup + "'.";
// PUBLIC_CHANNEL has the integer value 0
llWhisper(PUBLIC_CHANNEL, output);
}
}