YoHoJo Posted March 2, 2018 Share Posted March 2, 2018 (edited) Runescape Bot Stats RSBotStats is an API that allows scripters to easily track tasks their scripts have accomplished. Add to your script with a simple JSON POST request. Use to showoff and market your script! Real stats from a cooking script! Getting Started with the API Sign up and add your script here Find your API Key and Script ID here Send a POST request to upload your stats. We recommending sending 1 request on script end. Example Request URL: http://pure-woodland-47666.herokuapp.com/api/v1/commits?user_email=YOUR_EMAIL&user_token=YOUR_API_KEY Body: {"commit":{ "script_id": "X5VTnp", "user_id": "qN4tOb", "runtime": 75.666, "stats_attributes": [ { "task": "Trout Caught", "amount": 28 }, { "task": "Lobster Caught", "amount": 70 }] }} Parameter Notes At the very least, a commit requires `script_id`, `user_id`, and `runtime` `runtime` is in minutes `stats_attributes` are for tracking any sorts of tasks your script does. ex: Fish Caught, Yews Chopped, XP Gained, GP gained, etc. `user_id: qN4tOb` is the catch-all user. Use this as default. Example Java JSON POST method I'm not too familiar with Java. If someone could share a method to create a JSON post request, "that would be great". Here's an example from a scripter named Encoded which you can use with some minor tweaks: public static void commit(long runtime, int experience) { try { runtime = (int) (runtime / 1000 / 60000); String payload = "{\"commit\":{\"script_id\": \"" + SCRIPT_ID + "\",\"user_id\": \"qN4tOb\",\"runtime\": " + runtime + ",\"stats_attributes\": [{\"task\": \"XP Gained\", \"amount\": " + experience + "}]}}"; URL url = new URL(URL + "?user_email=" + EMAIL + "&user_token=" + API_KEY); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.connect(); byte[] data = payload.getBytes(StandardCharsets.UTF_8); DataOutputStream wr = new DataOutputStream(conn.getOutputStream()); wr.write(data); wr.flush(); BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); StringBuilder stb = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { stb.append(line).append("\n"); } wr.close(); rd.close(); if (conn.getResponseCode() == 201) { Logging.debug("Successfully sent script statistics to RS Script Stats."); } else { Logging.debug(stb.toString()); } conn.disconnect(); } catch (IOException ignored) { } } More To Come! Eager to continue development of this, open to all suggestions and constructive criticism! Scripters, please use this, thank you Are you a script user who wants to showoff their stats for a script? Bug the script author to implement this API, it's easy! Edited March 13, 2018 by YoHoJo 4 Quote Link to comment Share on other sites More sharing options...
Sky Posted March 2, 2018 Share Posted March 2, 2018 1 Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted March 2, 2018 Share Posted March 2, 2018 Looks like a nice project. I'll keep an eye out for this. 1 Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 2, 2018 Author Share Posted March 2, 2018 @Eagle Scripts thanks! Don't just watch, be a part of the future :p! Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 4, 2018 Author Share Posted March 4, 2018 Bunp Add to your script with a simple JSON POST request! Use to showoff and market your script! Quote Link to comment Share on other sites More sharing options...
dreameo Posted March 4, 2018 Share Posted March 4, 2018 You could probably modify the example to accept a map (exp:task, quantity:task...). Instead of having to modify the function each time. Including max, min, avg, and total would probably be good (on the properties) for your site. I might add this. 1 Quote Link to comment Share on other sites More sharing options...
Blurper Posted March 4, 2018 Share Posted March 4, 2018 Nice release bro, might implement it to some script I'll write here 1 Quote Link to comment Share on other sites More sharing options...
inababila Posted March 4, 2018 Share Posted March 4, 2018 That's cool bro 1 Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 5, 2018 Author Share Posted March 5, 2018 Bunp Add to your script with a simple JSON POST request! Use to showoff and market your script! Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 5, 2018 Author Share Posted March 5, 2018 18 hours ago, dreameo said: You could probably modify the example to accept a map (exp:task, quantity:task...). Instead of having to modify the function each time. Including max, min, avg, and total would probably be good (on the properties) for your site. I might add this. I agree! Ideally it'd accept 0 or as many parameters as needed for different task/amounts. Please do ?! Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 5, 2018 Author Share Posted March 5, 2018 (edited) Get detailed, custom script stats for your scripts with a simple JSON POST request! Use to showoff and market your script. Edited March 6, 2018 by YoHoJo Quote Link to comment Share on other sites More sharing options...
noobacc23 Posted March 5, 2018 Share Posted March 5, 2018 interesting 1 Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 6, 2018 Author Share Posted March 6, 2018 (edited) Get detailed, custom script stats for your scripts with a simple JSON POST request! Use to showoff and market your script. Edited March 6, 2018 by YoHoJo Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 6, 2018 Author Share Posted March 6, 2018 Get detailed, custom script stats for your scripts with a simple JSON POST request! Use to showoff and market your script. Quote Link to comment Share on other sites More sharing options...
YoHoJo Posted March 6, 2018 Author Share Posted March 6, 2018 Get detailed, custom script stats for your scripts with a simple JSON POST request! Use to showoff and market your script. Quote Link to comment Share on other sites More sharing options...