Difference between revisions of "SLURL HUD"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
m (Replaced <source> with <syntaxhighlight>)
 
Line 3: Line 3:
Touch to get the SLURL.
Touch to get the SLURL.


<source lang="lsl2">
<syntaxhighlight lang="lsl2">
string slurl()
string slurl()
{
{
Line 24: Line 24:
     }
     }
}
}
</source>
</syntaxhighlight>


{{LSLC|Examples}}
{{LSLC|Examples}}
{{LSLC|Library}}
{{LSLC|Library}}

Latest revision as of 03:22, 23 November 2023

Touch to get the SLURL.

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