Difference between revisions of "SLURL HUD"
Jump to navigation
Jump to search
m |
Kireji Haiku (talk | contribs) m (simplified example script) |
||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
Touch to get the SLURL. | |||
<lsl> | <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 | default | ||
{ | { | ||
touch_start(integer num_detected) | |||
{ | |||
// PUBLIC_CHANNEL has the integer value 0 | |||
llSay(PUBLIC_CHANNEL, slurl() ); | |||
llSay( | |||
} | } | ||
} | } | ||
</lsl> | </lsl> | ||
{{LSLC|Examples}} | {{LSLC|Examples}} | ||
{{LSLC|Library}} | {{LSLC|Library}} |
Revision as of 13:58, 7 October 2012
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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>