Advertisement
mariodian

Dogecoin auto bet

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