Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string sUrl = "http://anonymouse.org/cgi-bin/anon-www.cgi/http://search.secondlife.com/client_search.php?s=people&session=00000000-0000-0000-0000-000000000000&mat=7&q=";
- string sSearchString = "http://world.secondlife.com/resident/";
- integer iKeyLength = 36;
- string sMessage = "Please say the name in chat!";
- string sMessageSearching = "Searching for: ";
- string sMessageResult = "Result: ";
- float fTime = 20;
- integer iListen;
- default
- {
- touch_start(integer total_number)
- {
- llSetTimerEvent(fTime);
- iListen = llListen(PUBLIC_CHANNEL, "", llDetectedKey(0), "");
- llSay(PUBLIC_CHANNEL, sMessage);
- }
- timer()
- {
- llListenRemove(iListen);
- llSetTimerEvent(0);
- }
- listen(integer channel, string name, key id, string message)
- {
- if(llToLower(llGetSubString(message,-8,-1)) == "resident")
- {
- message = llGetSubString(message,0,-9);
- }
- llListenRemove(iListen);
- llSay(PUBLIC_CHANNEL, sMessageSearching + message);
- llSetTimerEvent(0);
- llHTTPRequest(sUrl + llEscapeURL(message), [HTTP_BODY_MAXLENGTH,16384], "");
- }
- http_response(key request_id, integer status, list metadata, string body)
- {
- string sResultKey = "";
- integer iResultPos = llSubStringIndex(body, sSearchString);
- if (iResultPos != -1)
- {
- iResultPos = iResultPos + llStringLength(sSearchString);
- sResultKey = llGetSubString(body, iResultPos, iResultPos + iKeyLength-1);
- }
- llSay(PUBLIC_CHANNEL, sMessageResult + sResultKey);
- }
- }
Add Comment
Please, Sign In to add comment