Advertisement
salahzar

Leaderboard v1.0 Adder

May 15th, 2016
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. string URL = "http://edmondo-1252.appspot.com/?";
  3. string SESSION =  "42061b74-9603-4e7a-af22-c4a868410dc0";
  4.  
  5. key handle;
  6. debug(string s) {
  7.    // llOwnerSay("DEBUG:"+s);
  8. }
  9.  
  10.  
  11. httprequest(string avatar, string score) {
  12.    
  13.     debug("httprequest");
  14.     avatar = llEscapeURL(avatar);
  15.     score = llEscapeURL(score);
  16.     string url = URL + "type=add&session="+SESSION+"&name="+avatar+"&score="+score;
  17.     debug("url: "+url);
  18.     list parm = [ HTTP_MIMETYPE, "text/plain; charset=UTF-8",
  19.             HTTP_BODY_MAXLENGTH, 32000 ];
  20.            
  21.     string body = "";
  22.     handle = llHTTPRequest(url, parm, body);
  23. }
  24.  
  25. default
  26. {
  27.     state_entry()
  28.     {
  29.         llSetText("Adding 1 point\ntouch",<1,1,1>,1);
  30.        
  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