eazy earn bitcoin


SUBMITTED BY: juntea

DATE: April 18, 2017, 11:49 a.m.

FORMAT: Text only

SIZE: 3.8 kB

HITS: 510

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

comments powered by Disqus