Hello! there is a script showing a map of the region. how to make it to run only when the engine is started? and when it is turned off then a different texture of the off screen was shown?
Basically it had some unused features I removed and added map refresh on changed region. Also I have such a link_message portion, I guess its out there?
link_message(integer link, integer num, string msg, key id)
{
if(num == -707071 && id == "engine")
{
if( msg == "STOP ENGINE") llSetTimerEvent(timerFreq);
else if( msg == "START ENGINE") llResetScript();
RefreshMap();
}
}
// Simple Second Life region map grab/update script. Uses the gridsurvey.com API
//////////////////////////////////////////////////////////////////////
// Holds the key of the last request.
key g_keyRequest;
//////////////////////////////////////////////////////////////////////
// Force a refresh of the region map.
RefreshMap()
{
g_keyRequest = llHTTPRequest( "http://api.gridsurvey.com/simquery.php?" +
"region=" + llEscapeURL( llGetRegionName() ) + "&item=objects_uuid",
[ HTTP_METHOD, "GET" ], "" );
}
//////////////////////////////////////////////////////////////////////
// Default state.
default
{
//////////////////////////////////////////////////////////////////
// Start entry.
state_entry()
{
// Do an initial refresh.
RefreshMap();
}
changed(integer change)
{
if(change & CHANGED_LINK & CHANGED_REGION || change & CHANGED_INVENTORY)
{
llResetScript();
RefreshMap();
}
}
//////////////////////////////////////////////////////////////////
// Handle the HTTP response from the request for the map UUID.
http_response( key request_id, integer status, list metadata, string body )
{
// If the response is in response to our request...
if ( request_id = g_keyRequest )
{
// ...if it's not an error...
if ( llGetSubString( body, 0, 4 ) != "Error" )
{
// Set the texture of the first face to the map.
llSetLinkPrimitiveParamsFast( 42, [PRIM_TEXTURE, 2, body, <1.0, 1.0, 0.0>, ZERO_VECTOR, 0.0 ]);
}
}
}
}