Difference between revisions of "LlGetRegionName"

From Second Life Wiki
Jump to navigation Jump to search
m (formatted example)
(Grow the example to show llGetRegionName in combination with [llGetPos])
Line 10: Line 10:
|constants
|constants
|examples=<lsl>
|examples=<lsl>
// The beginnings of a region-info script.
// Say what would be said by "Copy SLURL to clipboard" in the Map of the standard client
 
string wwGetSLUrl()
{
    string globe = "http://slurl.com/secondlife";
    string region = llGetRegionName();
    vector pos = llGetPos();
    string posx = (string)llRound(pos.x);
    string posy = (string)llRound(pos.y);
    string posz = (string)llRound(pos.z);
    return (globe + "/" + region +"/" + posx + "/" + posy + "/" + posz);
}
 
default
default
{
{
     state_entry()
     state_entry()
     {
     {
         llSetTimerEvent(3.0);
         llOwnerSay( wwGetSLUrl() );
    }
   
    timer()
    {
        string msg;
       
        msg = "REGION NAME : " + llGetRegionName();
       
        llSetText(msg, <0,1,0>, 1.0);
     }
     }
}
}
</lsl>
</lsl>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llGetSimulatorHostname]]|}}
|also_functions={{LSL DefineRow||[[llGetPos]]|}}
{{LSL DefineRow||[[llGetSimulatorHostname]]|}}
|also_tests
|also_tests
|also_events
|also_events

Revision as of 22:04, 15 April 2009

Summary

Function: string llGetRegionName( );

Returns a string that is the current region name

Examples

<lsl> // Say what would be said by "Copy SLURL to clipboard" in the Map of the standard client

string wwGetSLUrl() {

   string globe = "http://slurl.com/secondlife";
   string region = llGetRegionName();
   vector pos = llGetPos();
   string posx = (string)llRound(pos.x);
   string posy = (string)llRound(pos.y);
   string posz = (string)llRound(pos.z);
   return (globe + "/" + region +"/" + posx + "/" + posy + "/" + posz);

}

default {

   state_entry()
   {
       llOwnerSay( wwGetSLUrl() );
   }

}

</lsl>

See Also

Functions

•  llGetPos
•  llGetSimulatorHostname

Deep Notes

Search JIRA for related Issues

Signature

function string llGetRegionName();