Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. var startValue = '0.00000010', // Don't lower the decimal point more than 4x of current balance
  2. stopPercentage = 0.001, // In %. I wouldn't recommend going past 0.08
  3. maxWait = 600, // In milliseconds
  4. stopped = false,
  5. stopBefore = 3; // In minutes
  6.  
  7.  
  8. var $loButton = $('#double_your_btc_bet_lo_button'),
  9. $hiButton = $('#double_your_btc_bet_hi_button');
  10.  
  11.  
  12. function multiply(){
  13. var current = $('#double_your_btc_stake').val();
  14. var multiply = (current * 2).toFixed(8);
  15. $('#double_your_btc_stake').val(multiply);
  16. }
  17.  
  18.  
  19. function getRandomWait(){
  20. var wait = Math.floor(Math.random() * maxWait ) + 100;
  21.  
  22.  
  23. console.log('Waiting for ' + wait + 'ms before next bet.');
  24.  
  25.  
  26. return wait ;
  27. }
  28.  
  29.  
  30. function startGame(){
  31. console.log('Game started!');
  32. reset();
  33. $loButton.trigger('click');
  34. }
  35.  
  36.  
  37. function stopGame(){
  38. console.log('Game will stop soon! Let me finish.');
  39. stopped = true;
  40. }
  41.  
  42.  
  43. function reset(){
  44. $('#double_your_btc_stake').val(startValue);
  45. }
  46.  
  47.  
  48. // quick and dirty hack if you have very little bitcoins like 0.0000001
  49. function deexponentize(number){
  50. return number * 1000000;
  51. }
  52.  
  53.  
  54. function iHaveEnoughMoni(){
  55. var balance = deexponentize(parseFloat($('#balance').text()));
  56. var current = deexponentize($('#double_your_btc_stake').val());
  57.  
  58.  
  59. return ((balance*2)/100) * (current*2) > stopPercentage/100;
  60. }
  61.  
  62.  
  63. function stopBeforeRedirect(){
  64. var minutes = parseInt($('title').text());
  65.  
  66.  
  67. if( minutes < stopBefore )
  68. {
  69. console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing.');
  70. stopGame();
  71.  
  72.  
  73. return true;
  74. }
  75.  
  76.  
  77. return false;
  78. }
  79.  
  80.  
  81. // Unbind old shit
  82. $('#double_your_btc_bet_lose').unbind();
  83. $('#double_your_btc_bet_win').unbind();
  84.  
  85.  
  86. // Loser
  87. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
  88. if( $(event.currentTarget).is(':contains("lose")') )
  89. {
  90. console.log('You LOST! Multiplying your bet and betting again.');
  91.  
  92. multiply();
  93.  
  94.  
  95. setTimeout(function(){
  96. $loButton.trigger('click');
  97. }, getRandomWait());
  98.  
  99.  
  100. //$loButton.trigger('click');
  101. }
  102. });
  103.  
  104.  
  105. // Winner
  106. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
  107. if( $(event.currentTarget).is(':contains("win")') )
  108. {
  109. if( stopBeforeRedirect() )
  110. {
  111. return;
  112. }
  113.  
  114.  
  115. if( iHaveEnoughMoni() )
  116. {
  117. console.log('You WON! But don\'t be greedy. Restarting!');
  118.  
  119.  
  120. reset();
  121.  
  122.  
  123. if( stopped )
  124. {
  125. stopped = false;
  126. return false;
  127. }
  128. }
  129. else
  130. {
  131. console.log('You WON! Betting again');
  132. }
  133.  
  134.  
  135. setTimeout(function(){
  136. $loButton.trigger('click');
  137. }, getRandomWait());
  138. }
  139. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement