Difference between revisions of "BuildSlurl (NewAge)"

From Second Life Wiki
Jump to navigation Jump to search
(code cleanup)
m (Replaced old <LSL> block with <source lang="lsl2">)
 
Line 5: Line 5:
''Pre-made Function''
''Pre-made Function''


<lsl>
<source lang="lsl2">
string BuildSlurl(string region_name, vector pos){
string BuildSlurl(string region_name, vector pos){
     return "secondlife://" + llEscapeURL(region_name)  
     return "secondlife://" + llEscapeURL(region_name)  
Line 11: Line 11:
             + "/"+ (string)((integer)pos.y)  
             + "/"+ (string)((integer)pos.y)  
             + "/"+ (string)(llCeil(pos.z));
             + "/"+ (string)(llCeil(pos.z));
}</lsl>
}</source>


----
----
Line 17: Line 17:
''Example Script''
''Example Script''


<lsl>
<source lang="lsl2">
string BuildSlurl(string region_name, vector pos){
string BuildSlurl(string region_name, vector pos){
     return "secondlife://" + llEscapeURL(region_name)  
     return "secondlife://" + llEscapeURL(region_name)  
Line 34: Line 34:
     }
     }
}
}
</lsl>
</source>

Latest revision as of 18:44, 24 January 2015

A way of creating SLURL's by using a pre-made function;

BuildSlurl(string region_name, vector pos);

Pre-made Function

string BuildSlurl(string region_name, vector pos){
    return "secondlife://" + llEscapeURL(region_name) 
            + "/"+ (string)((integer)pos.x) 
            + "/"+ (string)((integer)pos.y) 
            + "/"+ (string)(llCeil(pos.z));
}

Example Script

string BuildSlurl(string region_name, vector pos){
    return "secondlife://" + llEscapeURL(region_name) 
            + "/"+ (string)((integer)pos.x) 
            + "/"+ (string)((integer)pos.y) 
            + "/"+ (string)(llCeil(pos.z));
}

default
{
    touch_start(integer x)
    {
        llWhisper(0, BuildSlurl(llGetRegionName(), llGetPos()));
        //Returns slurl like this;
        //       secondlife://Phoenix%20Rising/214/160/24
    }
}