// Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
/*
LICENCE:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
or you may visit - http://license.idjhost.com/
*/
// DESCRIPTION
// Sim flat map image on a prim
key requestID;
integer handle;
integer channel;
string currentsim;
string query_string;
default
{
state_entry()
{
handle=0;
channel=87;
}
touch_start(integer total_number)
{
if(handle!=0)
{
llListenRemove(handle);
handle=0;
}
llSay(0,"Say name of Region you want on channel " + (string)channel);
handle=llListen(channel,"","","");
llSetTimerEvent(10.0);
}
listen(integer channel, string name, key id, string message)
{
currentsim=message;
query_string="region=" + llEscapeURL(message) + "&item=objects_uuid";
requestID = llHTTPRequest("http://api.gridsurvey.com/simquery.php",[HTTP_METHOD, "POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], query_string);
llSetTimerEvent(0.0);
if(handle!=0)llListenRemove(handle);
handle=0;
}
http_response(key req_id, integer status, list meta, string body)
{
if (req_id == requestID)
{
if(llGetSubString(body, 0, 4)=="Error")
{
llSay(0,body);
}
else
{
llSetTexture(body, ALL_SIDES);
llSay(0,"Current Region Map UUID for "+ currentsim + " is "+ body);
}
}
else
{
llSay(0,"Error: " + (string)status);
}
}
timer()
{
if(handle!=0){
llSay(0,"Region Map change timed out after 10 seconds. Please touch again to change the Region Map");
llListenRemove(handle);
handle=0;
}
llSetTimerEvent(0.0);
}
}
Comments
0 B
|👍
/👎