Advertisement
leathan

Bustabit script for hubot

Jun 25th, 2017
379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. // When you log in to bustabit.com select the "AUTO" tab, then at the
  2. // bottom right click the "autobet" button and select "custom"
  3. // select everything inside the text area and delete it
  4. // copy paste the entire contents of this text into that text field and click run
  5. // If your hubot is running on your local machine all should be working
  6. // YOU MUST CHANGE THE LINE BELLOW IF YOU RUN THE HUBOT ON A SERVER
  7. var SERVER = 'http://localhost:8080/'
  8.  
  9. // INIT
  10. var bet = {};
  11.  
  12. // CHECK HUBOT SERVER FOR BET
  13. function CheckBet () {
  14. xmlhttp = new XMLHttpRequest();
  15. xmlhttp.open("GET", SERVER+'bet', false);
  16. xmlhttp.onreadystatechange = function() {
  17. if (this.readyState == 4 && this.status == 200) {
  18. bet = JSON.parse(this.responseText);
  19. if (bet[0] && bet[0].size) {
  20. engine.placeBet(bet[0].size*100, parseInt(bet[0].ratio*100), false);
  21. }
  22. }
  23. };
  24. xmlhttp.send();
  25. }
  26.  
  27. // UPDATE THE HUBOT SERVER WITH INFORMATION
  28. function Info(params) {
  29. var http = new XMLHttpRequest();
  30. http.open("POST", SERVER+'info', true);
  31. http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  32. http.send(params);
  33. }
  34.  
  35. engine.on('game_crash', function(data) {
  36. if (engine.getEngine().playerInfo.leathan) {
  37. var win = false;
  38. if (engine.getEngine().playerInfo.leathan.stopped_at) { win = true } Info('game_crash='+data.game_crash+'&balance='+engine.getBalance()+'&win='+win)
  39. }
  40. CheckBet();
  41. });
  42.  
  43. engine.on('cashed_out', function(resp) {
  44. if (resp.username == engine.getUsername()) {
  45. Info('win=true&balance='+engine.getBalance())
  46. }
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement