anoxpanda

SatoshiMines

May 2nd, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. var bet = 175;
  2.  
  3. /* in case the bot will click a bomb, bet will be adjusted on the next round to compensate the loss.
  4. the bot will set the bet again to the original value on the next next round.*/
  5. var bigBet = bet/.039;
  6. bigBet = Math.ceil(bigBet);
  7.  
  8. var risky_bet_chance = 0;
  9.  
  10. /* click sequence interval in milliseconds. equivalent to 2 seconds.
  11. You can change it to longer than 2 seconds but please don't change it to a lower value because it can messed up the timings if you have a slow internet. If you have a very slow internet connection, I recommend setting it up to 3 seconds or higher. */
  12. var interval = 1500;
  13.  
  14. var restart, tile1, timeout1, timeout2, timeout3;
  15.  
  16. // force the difficulty to 1 mine at the start of the game.
  17. $('.quarter').first().find('button').click();
  18.  
  19. start_game();
  20. function start_game() {
  21.  
  22. var risky_bet = Math.floor((Math.random() * 100) + 1);
  23.  
  24. if(restart == 1){
  25. if (risky_bet < risky_bet_chance) {
  26. $('#bet').val(1.5*bigBet);
  27. } else {
  28. $('#bet').val(bigBet);
  29. }
  30. restart = 0;
  31. } else {
  32. if (risky_bet < risky_bet_chance) {
  33. $('#bet').val(1.5*bigBet);
  34. } else {
  35. $('#bet').val(bet);
  36. }
  37. }
  38. $('#start_game').click();
  39. timeout1 = setTimeout(click_tile1, interval)
  40.  
  41. } // end of function start_game()
  42.  
  43. function click_tile1() {
  44.  
  45. var tile1 = Math.floor((Math.random() * 25) + 1);
  46. //search_last_bomb();
  47. $('.game_left').first().find('li[data-tile='+tile1+']').click();
  48. $('.game_left [data-tile="'+tile1+'"]').click();
  49. setTimeout(function(){
  50. if($('.game_left').first().find('li[data-tile='+tile1+']').hasClass('bomb')){
  51. var bal = $('.balance .num').html();
  52. bal = $.trim(bal);
  53. bal = bal.replace(',','');
  54. bal = parseInt(bal);
  55. //bal = bigBet // practice mode
  56.  
  57. if(bal < bigBet){
  58. stopgame();
  59. } else {
  60. restart = 1;
  61. start_game();
  62. }
  63.  
  64. }else{
  65. timeout2 = setTimeout(cashout, interval);
  66. }
  67. }, interval);
  68.  
  69. } // end of function click_tile()
  70.  
  71. function cashout() {
  72. $('.game_right').first().find('.cashout').click();
  73. timeout3 = setTimeout(start_game, interval);
  74. } // end of cashout
  75.  
  76. function stopgame(){
  77. clearTimeout(timeout1);
  78. clearTimeout(timeout2);
  79. clearTimeout(timeout3);
  80. } // end of stopgame()
  81.  
  82. function search_last_bomb(){
  83. var has_chosen = 0;
  84. if($('.game_left').eq(1) != null && $('.game_left').eq(1).length > 0){
  85. $('.game_left').eq(1).find('.board').find('li').each(function(i,elem){
  86. if($(elem).hasClass('reveal')){
  87. has_chosen = 1;
  88. tile1 = $(elem).data('tile');
  89. return false;
  90. }
  91. });
  92. }
  93. if(has_chosen == 0){
  94. tile1 = Math.floor((Math.random() * 25) + 1);
  95. }
  96. } // end of searchLastBombTile()
Add Comment
Please, Sign In to add comment