Difference between revisions of "SLURL HUD"
Jump to navigation
Jump to search
m |
m (Replaced <source> with <syntaxhighlight>) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
Touch to get the SLURL. | |||
<syntaxhighlight lang="lsl2"> | |||
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 | default | ||
{ | { | ||
touch_start(integer num_detected) | |||
{ | |||
// PUBLIC_CHANNEL has the integer value 0 | |||
llSay(PUBLIC_CHANNEL, slurl() ); | |||
llSay( | |||
} | } | ||
} | } | ||
</syntaxhighlight> | |||
</ | |||
{{LSLC|Examples}} | {{LSLC|Examples}} | ||
{{LSLC|Library}} | {{LSLC|Library}} |
Latest revision as of 03:22, 23 November 2023
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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() );
}
}