Untitled


SUBMITTED BY: Guest

DATE: May 6, 2015, 4:31 a.m.

FORMAT: Text only

SIZE: 8.1 kB

HITS: 1373

  1. var startValue = '0.00000001', // 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 = 500, // In milliseconds
  4. stopped = false,
  5. stopBefore = 3; // In minutes
  6. var $loButton = $('#double_your_btc_bet_lo_button'),
  7. $hiButton = $('#double_your_btc_bet_hi_button');
  8. function multiply(){
  9. var current = $('#double_your_btc_stake').val();
  10. var multiply = (current * 2).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. $loButton.trigger('click');
  22. }
  23. function stopGame(){
  24. console.log('Game will stop soon! Let me finish.');
  25. stopped = true;
  26. }
  27. function reset(){
  28. --------------------------------------------------------------------------------------------------------------------------
  29. var startValue = '0.00000002', // Don't lower the decimal point more than 4x of current balance
  30. stopPercentage = 0.0000001, // In %. I wouldn't recommend going past 0.08
  31. maxWait = 1500, // In milliseconds
  32. stopped = false,
  33. stopBefore = 3; // In minutes
  34. var $loButton = $('#double_your_btc_bet_lo_button'),
  35. $hiButton = $('#double_your_btc_bet_hi_button');
  36. function multiply(){
  37. var current = $('#double_your_btc_stake').val();
  38. var multiply = (current * 2).toFixed(8);
  39. $('#double_your_btc_stake').val(multiply);
  40. }
  41. function getRandomWait(){
  42. var wait = Math.floor(Math.random() * maxWait ) + 100;
  43. console.log('Aguardando ' + wait + 'ms antes da próxima aposta.');
  44. return wait ;
  45. }
  46. function startGame(){
  47. console.log('O jogo começou!');
  48. reset();
  49. $loButton.trigger('click');
  50. }
  51. function stopGame(){
  52. console.log('O Jogo vai parar em breve! Deixe-me terminar.');
  53. stopped = true;
  54. }
  55. function reset(){
  56. $('#double_your_btc_stake').val(startValue);
  57. }
  58. // quick and dirty hack if you have very little bitcoins like 0.0000001
  59. function deexponentize(number){
  60. return number * 1000000;
  61. }
  62. function iHaveEnoughMoni(){
  63. var balance = deexponentize(parseFloat($('#balance').text()));
  64. var current = deexponentize($('#double_your_btc_stake').val());
  65. return ((balance*2)/100) * (current*2) > stopPercentage/1000;
  66. }
  67. function stopBeforeRedirect(){
  68. var minutes = parseInt($('title').text());
  69. if( minutes < stopBefore )
  70. {
  71. console.log('Aproximando-se do redirecionamento! Pare o jogo, para que não seja redirecionado enquanto você está perdendo.');
  72. stopGame();
  73. return true;
  74. }
  75. return false;
  76. }
  77. // Unbind old shit
  78. $('#double_your_btc_bet_lose').unbind();
  79. $('#double_your_btc_bet_win').unbind();
  80. // Loser
  81. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
  82. if( $(event.currentTarget).is(':contains("lose")') )
  83. {
  84. console.log('Você perdeu! Multiplicando a sua aposta e apostando novamente.');
  85. multiply();
  86. setTimeout(function(){
  87. $loButton.trigger('click');
  88. }, getRandomWait());
  89. //$loButton.trigger('click');
  90. }
  91. });
  92. // Winner
  93. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
  94. if( $(event.currentTarget).is(':contains("win")') )
  95. {
  96. if( stopBeforeRedirect() )
  97. {
  98. return;
  99. }
  100. if( iHaveEnoughMoni() )
  101. {
  102. console.log('Você ganhou! Mas não seja ganancioso. Reiniciando!');
  103. reset();
  104. if( stopped )
  105. {
  106. stopped = false;
  107. return false;
  108. }
  109. }
  110. else
  111. {
  112. console.log('Você ganhou! apostando novamente');
  113. }
  114. setTimeout(function(){
  115. $loButton.trigger('click');
  116. }, getRandomWait());
  117. }
  118. });startGame()
  119. $('#double_your_btc_stake').val(startValue);
  120. }
  121. // quick and dirty hack if you have very little bitcoins like 0.0000001
  122. function deexponentize(number){
  123. return number * 0100000;
  124. }
  125. function iHaveEnoughMoni(){
  126. var balance = deexponentize(parseFloat($('#balance').text()));
  127. var current = deexponentize($('#double_your_btc_stake').val());
  128. return ((balance*2)/100) * (current*2) > stopPercentage/100;
  129. }
  130. function stopBeforeRedirect(){
  131. var minutes = parseInt($('title').text());
  132. if( minutes < stopBefore )
  133. {
  134. console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing.');
  135. stopGame();
  136. return true;
  137. }
  138. return false;
  139. }
  140. // Unbind old shit
  141. $('#double_your_btc_bet_lose').unbind();
  142. $('#double_your_btc_bet_win').unbind();
  143. // Loser
  144. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
  145. if( $(event.currentTarget).is(':contains("lose")') )
  146. {
  147. console.log('You LOST! Multiplying your bet and betting again.');
  148. multiply();
  149. setTimeout(function(){
  150. $loButton.trigger('click');
  151. }, getRandomWait());
  152. //$loButton.trigger('click');
  153. }
  154. });
  155. // Winner
  156. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
  157. if( $(event.currentTarget).is(':contains("win")') )
  158. {
  159. if( stopBeforeRedirect() )
  160. {
  161. return;
  162. }
  163. if( iHaveEnoughMoni() )
  164. {
  165. console.log('You WON! But don\'t be greedy. Restarting!');
  166. reset();
  167. if( stopped )
  168. {
  169. stopped = false;
  170. return false;
  171. }
  172. }
  173. else
  174. {
  175. console.log('You WON! Betting again');
  176. }
  177. setTimeout(function(){
  178. $loButton.trigger('click');
  179. }, getRandomWait());
  180. }
  181. });StartGame()

comments powered by Disqus