Get SLurl

Date 2009/5/28 4:33:44 | Topic: Primitive/Object

Returns exact SLurl link for object.

Can be very useful for an object to tell owner where it is by IM. Then you could click the SLurl link from local chat history to go to object.

string escape(string msg)
{
    return 
llDumpList2String(llParseString2List(msg, [" "], []), "%20");
}

default
{
    
state_entry()
    {
        
llSetText("Touch for a SLurl", <1.000.250.74>, 1);
        
vector pos llGetPos();
        
llWhisper(0"http://slurl.com/secondlife/" escape(llGetRegionName()) + "/" + (string)llRound(pos.x) + "/" + (string)llRound(pos.y) + "/" + (string)llRound(pos.z) + "/");
    }

    
touch_start(integer total_number)
    {
        
vector pos llGetPos();
        
llWhisper(0"http://slurl.com/secondlife/" escape(llGetRegionName()) + "/" + (string)llRound(pos.x) + "/" + (string)llRound(pos.y) + "/" + (string)llRound(pos.z) + "/");
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=29