Advertisement
XeroXipher2022

HTTP Request with HUD

Jul 4th, 2023
1,895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LScript 1.35 KB | Gaming | 0 0
  1. /* As of now I have made a Google Sheets with all of the Data I want to incorporate into my game... It is far from ready but I wanted to test out Google Sheets by giving myself a Beginner Starting Pack / HUD... Unfortunately I don't know where to HTTP_METHOD "GET" and "RESPONSE, the following code, aside from my Sheet URL is from what I researched in the Forums.*/
  2.  
  3. string sheetID = "18HslQMEJ76qjuPmXg9mjKpL3780_lbjhe3pfk1eeWsIE";
  4. string sheetURL = "https://docs.google.com/spreadsheets/d/1dTWPi4uHodkcwX1qjdT1ib8M-QJbYjrPOuPaGqfpPkU/edit#gid=0";
  5. key selfCheckRequestId;
  6.  
  7. default
  8. {
  9.     state_entry()
  10.     {      
  11.     }
  12.     touch_start(integer total_number)
  13.     {  selfCheckRequestId =
  14.         llHTTPRequest( sheetURL,
  15.         [HTTP_METHOD, "GET",
  16.         HTTP_VERBOSE_THROTTLE, FALSE,
  17.         HTTP_BODY_MAXLENGTH, 16384],
  18.         "");      
  19.     }  
  20.     http_response(key id, integer status, list metaData, string body)
  21.     {    
  22.         if (id == selfCheckRequestId)
  23.         {       string marker =  "@!@";
  24.                 integer start = llSubStringIndex(body,marker);        
  25.                 integer end = llSubStringIndex(body, "</td>");    
  26.                 string fetch =   llGetSubString(body,start + llStringLength(marker), end-1);            
  27.                 llOwnerSay("\n response: \n" + fetch);\
  28.                
  29.         }      
  30.     }
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement