script


SUBMITTED BY: pitbord23

DATE: Oct. 2, 2017, 3:58 p.m.

FORMAT: Text only

SIZE: 2.6 kB

HITS: 287

  1. var startValue = '0.00000001', // Don't lower the decimal point more than 4x of current balance
  2. stopPercentage = 0.01, // In %. I wouldn't recommend going past 0.08
  3. maxWait = 100, // In milliseconds
  4. stopped = false,
  5. stopBefore = 3; // In minutes
  6. var $hiButton = $('#double_your_btc_bet_hi_button'),
  7. $loButton = $('#double_your_btc_bet_lo_button');
  8. function multiply(){
  9. var current = $('#double_your_btc_stake').val();
  10. var multiply = (current * 2.5).toFixed(8);
  11. $('#double_your_btc_stake').val(multiply);
  12. }
  13. function getRandomWait(){
  14. var wait = Math.floor(Math.random() * maxWait ) + 100;
  15. console.log('Waiting for ' + wait + 'ms before next bet.');
  16. return wait ;
  17. }
  18. function startGame(){
  19. console.log('Game started!');
  20. reset();
  21. $hiButton.trigger('click');
  22. }
  23. function stopGame(){
  24. console.log('Game will stop soon! Let me finish.');
  25. stopped = true;
  26. }
  27. function reset(){
  28. $('#double_your_btc_stake').val(startValue);
  29. }
  30. function deexponentize(number){
  31. return number * 0.00000002;
  32. }
  33. function iHaveEnoughMoni(){
  34. var balance = deexponentize(parseFloat($('#balance').text()));
  35. var current = deexponentize($('#double_your_btc_stake').val());
  36. return ((balance*2)/100) * (current*2) > stopPercentage/100;
  37. }
  38. function stopBeforeRedirect(){
  39. var minutes = parseInt($('title').text());
  40. if( minutes < stopBefore )
  41. {
  42. console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing.');
  43. stopGame();
  44. return true;
  45. }
  46. return false;
  47. }
  48. // Unbind old shit
  49. $('#double_your_btc_bet_lose').unbind();
  50. $('#double_your_btc_bet_win').unbind();
  51. // Loser
  52. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
  53. if( $(event.currentTarget).is(':contains("lose")') )
  54. {
  55. console.log('You LOST! Multiplying your bet and betting again.');
  56. multiply();
  57. setTimeout(function(){
  58. $hiButton.trigger('click');
  59. }, getRandomWait());
  60. //$hiButton.trigger('click');
  61. }
  62. });
  63. // Winner
  64. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
  65. if( $(event.currentTarget).is(':contains("win")') )
  66. {
  67. if( stopBeforeRedirect() )
  68. {
  69. return;
  70. }
  71. if( iHaveEnoughMoni() )
  72. {
  73. console.log('You WON! But don\'t be greedy. Restarting!');
  74. reset();
  75. if( stopped )
  76. {
  77. stopped = false;
  78. return false;
  79. }
  80. }
  81. else
  82. {
  83. console.log('You WON! Betting again');
  84. }
  85. setTimeout(function(){
  86. $hiButton.trigger('click');
  87. }, getRandomWait());
  88. }
  89. });startGame()

comments powered by Disqus