llGetRegionName
string llGetRegionName()Returns the current region name.
This example demonstrates how to construct an SLURL (Second Life URL) using the region name, similar to the “Copy SLURL to clipboard” feature in the standard client’s Map:
// Say what would be said by "Copy SLURL to clipboard" in the Map of the standard client
string wwGetSLUrl(){ string globe = "http://maps.secondlife.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 + "/" + llEscapeURL(region) +"/" + posx + "/" + posy + "/" + posz);}
default{ state_entry() { llOwnerSay( wwGetSLUrl() ); }}