Group key finder

From Second Life Wiki
Revision as of 13:53, 7 October 2012 by Kireji Haiku (talk | contribs) (merged example scripts cause of redundancy and added constants to llWhisper call)
Jump to navigation Jump to search

The Group Key Finder

Place this script in a prim and touch it to find out the set group's key.

<lsl> 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(objectGroup, 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);
   }

} </lsl>