User:Opensource Obscure/ShowMap

From Second Life Wiki
< User:Opensource Obscure
Revision as of 07:58, 15 May 2011 by Opensource Obscure (talk | contribs) (script to load the map of current region as a web texture)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl>

ShowMap(key avatar) {

   string url = "http://map.secondlife.com/";
   vector sim_coord = llGetRegionCorner();
   string x = (string)((integer)(sim_coord.x / 256.0));
   string y = (string)((integer)(sim_coord.y / 256.0));
   url += "map-1-" + x + "-" + y + "-objects.jpg";
   llLoadURL(avatar, "View the sim map", url);

}

default {

   state_entry()
   {
       llSay(0, "Click to open the map of this region as a web texture.");
   }
   touch_start(integer total_number)
   {
       ShowMap(llDetectedKey(0));
   }

} </lsl>