SLURL HUD

From Second Life Wiki
Revision as of 14:58, 7 October 2012 by Kireji Haiku (talk | contribs) (simplified example script)
Jump to navigation Jump to search

Touch to get the SLURL.

<lsl> string slurl() {

   string regionname = llGetRegionName();
   vector pos = llGetPos();
   return "http://maps.secondlife.com/secondlife/"
       + llEscapeURL(regionname) + "/"
       + (string)llRound(pos.x) + "/"
       + (string)llRound(pos.y) + "/"
       + (string)llRound(pos.z) + "/";

}

default {

   touch_start(integer num_detected)
   {
       // PUBLIC_CHANNEL has the integer value 0
       llSay(PUBLIC_CHANNEL, slurl() );
   }

} </lsl>