Advertisement
salahzar

adding 1 point

Mar 18th, 2016
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string SESSION;
  2. key handle;
  3. string URL = "http://edmondo-1252.appspot.com/?";
  4.  
  5. debug(string s) {
  6.     llOwnerSay("DEBUG:"+s);
  7. }
  8.  
  9.  
  10. httprequest(string avatar, string score) {
  11.    
  12.     debug("httprequest");
  13.     avatar = llEscapeURL(avatar);
  14.     score = llEscapeURL(score);
  15.     string url = URL + "type=add&session="+SESSION+"&name="+avatar+"&score="+score;
  16.     list parm = [ HTTP_MIMETYPE, "text/plain; charset=UTF-8",
  17.             HTTP_BODY_MAXLENGTH, 32000 ];
  18.     string body = "";
  19.     handle = llHTTPRequest(url, parm, body);
  20. }
  21.  
  22. default
  23. {
  24.     state_entry()
  25.     {
  26.         llSetText("Adding 1 point\ntouch",<1,1,1>,1);
  27.         SESSION = llGetObjectDesc();
  28.         list parsing = llParseStringKeepNulls(SESSION,[":"],[]);
  29.         SESSION = llStringTrim(llList2String(parsing,1),STRING_TRIM);
  30.         llSay(0,"Setting SESSION: "+SESSION);
  31.     }
  32.     touch_start(integer count) {
  33.         key k = llDetectedKey(0);
  34.         string name = llKey2Name(k);
  35.         httprequest(name,"1");
  36.     }
  37.      http_response(key k, integer status, list meta, string body) {
  38.         debug("status: "+(string)status);
  39.         debug("body: "+body);
  40.        
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement