Get Region Map

Date 2010/5/12 5:25:16 | Topic: Texture

Displays map image of current sim on prim & updates every 24 hours.


integer time 86400//update every 24 hours

key httpRequestId;
string mapTexture;
string URL "http://www.subnova.com/secondlife/api/map.php";
 
default 
{
    
on_rezinteger sparam )
    {
        
llResetScript();
    }
    
    
state_entry() 
    {
        
llSetTimerEvent(time);
        
httpRequestId llHTTPRequest(URL "?" "sim" "=" llEscapeURL(llGetRegionName()),[], "");
    }
    
    
http_response(key request_idinteger status, list metadatastring body)
    {
        if (
request_id == httpRequestId
        {
            
mapTexture body;
            
llSetTexture(mapTextureALL_SIDES); //you can replace ALL_SIDES with a side number instead
        
}
    }
    
    
timer() 
    {
        
httpRequestId llHTTPRequest(URL "?" "sim" "=" llEscapeURL(llGetRegionName()),[], "");
    }
}




This script comes from Alicia Stella Design - Best Tip Jars in Second Life
http://www.aliciastella.com

The URL for this script is:
http://www.aliciastella.com/modules/AMS/article.php?storyid=43