Advertisement
Gayngel

Validating a group key with the World API

Mar 1st, 2020
1,595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. key http_request_id;
  2. key group = "d1228743-d417-938b-db90-52081ed656ba"; //Type in a group key or any other key to test.
  3. default
  4. {
  5.     state_entry()
  6.     {
  7.        http_request_id = llHTTPRequest("http://world.secondlife.com/group/"+(string)group,[],""); // Usesthe world API to request information of a group.
  8.     }
  9.  
  10.    http_response(key request_id, integer status, list metadata, string body)
  11.     {
  12.         if (request_id == http_request_id)
  13.         {
  14.            
  15.             if(llSubStringIndex(body,"Page Not Found") == -1)  // Valid group keys return the group information.
  16.             {
  17.                 llOwnerSay("That's a valid group key!");
  18.             }
  19.            
  20.             else  // Invalid group keys return "Page Not Found"
  21.             llOwnerSay("That's not a valid group key!");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement