|
@@ -6,50 +6,49 @@ key avatar;
|
|
|
|
|
|
default
|
|
|
{
|
|
|
- state_entry()
|
|
|
- {
|
|
|
- llSetText("Touch to get an avatar UUID from Second Life®", <1,1,1>, 1);
|
|
|
- }
|
|
|
-
|
|
|
- touch_start(integer howmany)
|
|
|
- {
|
|
|
- if (listener == 0)
|
|
|
- {
|
|
|
- avatar = llDetectedKey(0);
|
|
|
- listener = llListen(CHAT_CHANNEL, "", avatar, "");
|
|
|
- llSetText("In use by " + llDetectedName(0), <1,1,1>,1);
|
|
|
- llWhisper(0, "Say an avatar name in chat prefixing it with /" + (string)CHAT_CHANNEL + "; touch to reset");
|
|
|
- llSetTimerEvent(360.0);
|
|
|
- }
|
|
|
- else if (avatar == llDetectedKey(0))
|
|
|
- {
|
|
|
- llResetScript();
|
|
|
- }
|
|
|
- else
|
|
|
- llWhisper(0, "In use");
|
|
|
- }
|
|
|
-
|
|
|
- timer()
|
|
|
- {
|
|
|
- llWhisper(0, "No response from web services...");
|
|
|
- llResetScript();
|
|
|
- }
|
|
|
+ state_entry()
|
|
|
+ {
|
|
|
+ llSetText("Touch to get an avatar UUID from Second Life®", <1,1,1>, 1);
|
|
|
+ }
|
|
|
|
|
|
- listen(integer channel, string name, key id, string message)
|
|
|
- {
|
|
|
- http_request_id = llHTTPRequest(queryRequestURL + "?name=" + llEscapeURL(message), [], "");
|
|
|
- llSetTimerEvent(60.0);
|
|
|
- }
|
|
|
+ touch_start(integer howmany)
|
|
|
+ {
|
|
|
+ if (listener == 0)
|
|
|
+ {
|
|
|
+ avatar = llDetectedKey(0);
|
|
|
+ listener = llListen(CHAT_CHANNEL, "", avatar, "");
|
|
|
+ llSetText("In use by " + llDetectedName(0), <1,1,1>,1);
|
|
|
+ llWhisper(0, "Say an avatar name in chat prefixing it with /" + (string)CHAT_CHANNEL + "; touch to reset");
|
|
|
+ llSetTimerEvent(60.0);
|
|
|
+ }
|
|
|
+ else if (avatar == llDetectedKey(0))
|
|
|
+ {
|
|
|
+ llResetScript();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ llWhisper(0, "In use");
|
|
|
+ }
|
|
|
|
|
|
- http_response(key request_id, integer status, list metadata, string body)
|
|
|
- {
|
|
|
- if (request_id == http_request_id)
|
|
|
- {
|
|
|
- if (status == 200)
|
|
|
- llInstantMessage(avatar, body);
|
|
|
- else
|
|
|
- llInstantMessage(avatar, "Error " + (string)status + ": " + body);
|
|
|
- }
|
|
|
- llSetTimerEvent(0.0);
|
|
|
- }
|
|
|
+ timer()
|
|
|
+ {
|
|
|
+ llResetScript();
|
|
|
+ }
|
|
|
+
|
|
|
+ listen(integer channel, string name, key id, string message)
|
|
|
+ {
|
|
|
+ http_request_id = llHTTPRequest(queryRequestURL + "?name=" + llEscapeURL(message) + "&compat=false", [], "");
|
|
|
+ llSetTimerEvent(60.0);
|
|
|
+ }
|
|
|
+
|
|
|
+ http_response(key request_id, integer status, list metadata, string body)
|
|
|
+ {
|
|
|
+ if (request_id == http_request_id)
|
|
|
+ {
|
|
|
+ if (status == 200)
|
|
|
+ llInstantMessage(avatar, body);
|
|
|
+ else
|
|
|
+ llInstantMessage(avatar, "Error " + (string)status + ": " + body);
|
|
|
+ }
|
|
|
+ llSetTimerEvent(0.0);
|
|
|
+ }
|
|
|
}
|