Advertisement
kopilo

LuL - Transaction

Jan 15th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string url;
  2. key av;
  3. key obj;
  4. string http_request_id ;
  5.  
  6. getURL() {
  7.     url = osGetGridLoginURI();
  8.     list tmp = llParseString2List(url, ":", "");
  9.     url = llList2String(tmp,0) + llList2String(tmp, 1);
  10. }
  11.  
  12. adjust(string data) {
  13.     http_request_id = llHTTPRequest(url + data, [HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/plain;charset=utf-8"], "");
  14. }
  15.  
  16. default
  17. {
  18.     on_rez(integer p) { llResetScript(); }
  19.    
  20.     state_entry() {
  21.         obj = llGetKey();
  22.     }
  23.    
  24.     touch_start(integer p) {
  25.         av = llDetectedKey(0);
  26.         //exercise,health,hunger,hydration,hygene,NAME or ITEM ID
  27.         adjust(llList2String(llGetObjectDetails(obj,[OBJECT_DESC]),0));
  28.     }
  29.    
  30.     http_response(key request_id, integer status, list metadata, string body)
  31.     {
  32.         if (request_id == http_request_id && status == 200)
  33.         {
  34.             llInstantMessage(av, body);
  35.         }
  36.     }
  37.     changed(integer p) { if (p & CHANGED_OWNER) llResetScript(); }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement