key http_request_id;
string URL = "http://www.subnova.com/secondlife/api/map.php";
string SIM_NAME;
integer iLine = 0;
string name;
default
{
on_rez(integer n){
llResetScript();
}
state_entry(){
vector temp;
list temp_name;
integer i=0;
temp = llGetScale();
name = llGetRegionName();
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=", [], "");
iLine = 0;
temp_name = llParseString2List(name,[],[" "]);
for(i=0;i<llGetListLength(temp_name);i++){
if(llList2String(temp_name,i) == " "){
temp_name = llListReplaceList(temp_name,["_"],i,i);
}
}
SIM_NAME = llDumpList2String(temp_name,"");
http_request_id = llHTTPRequest(URL + "?" + "sim" + "=" + SIM_NAME, [], "");
llSetTimerEvent(5);
}
http_response(key request_id, integer status, list metadata, string body)
{
if (request_id == http_request_id)
{
llSetTexture(body, 0);
}
}
}