blddk

Untitled

May 13th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Go to http://www.pushingbox.com/scenarios.php and find the DeviceID you want to trigger, then insert it here
  2. string devID = "xxxxxxxxxxxxxxxx";
  3.  
  4. //Key used to identify HTTP request
  5. key requestID;
  6.  
  7. default
  8. {
  9.     state_entry()
  10.     {
  11.         //Call the url and store the HTTP request id
  12.         requestID = llHTTPRequest("http://api.pushingbox.com/pushingbox?devid=" + devID, [], "");
  13.     }
  14.  
  15.     http_response(key id, integer status, list metadata, string body)
  16.     {
  17.         //Check if it is the ID we are expecting
  18.         if (id == requestID)
  19.         {
  20.             //If returned status is 200, the script successfully contacted the server
  21.             if (status == 200)
  22.             {
  23.                 llOwnerSay("Success!");
  24.             }
  25.             else
  26.             {
  27.                 llOwnerSay("An error occured: " + body);
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment