sonson2010

error javascriopt

Jun 18th, 2021
866
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var startValue = '0.00000001',
  2. // Don't lower the decimal point more than 4x of current balance stopPercentage = 0.001, // In %. I wouldn't recommend going past 0.08 maxWait = 500,
  3. // In milliseconds stopped = false, stopBefore = 3;
  4. // In minutes
  5.  
  6. var $hiButton = $('#double_your_btc_bet_lo_button'),$hiButton = $('#double_your_btc_bet_hi_button');
  7.  
  8. function multiply() {
  9.  var current = $('#double_your_btc_stake').val();
  10.  var multiply = (current * 2).toFixed(8); $('#double_your_btc_stake').val(multiply);
  11. }
  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.  
  19. function startGame(){
  20.   console.log('Game started!');
  21.   reset();
  22.  $hiButton.trigger('click');
  23. }
  24.  
  25. function stopGame(){
  26.   console.log('Game will stop soon! Let me finish.');
  27.    stopped = true;
  28. }
  29.  
  30. function reset(){
  31.   $('#double_your_btc_stake').val(startValue);
  32. }
  33. // quick and dirty hack if you have very little bitcoins like 0.0000001
  34.  
  35. function deexponentize(number){
  36.   return number * 1000000;
  37. }
  38.  
  39. function iHaveEnoughMoni(){
  40.  var balance = deexponentize(parseFloat($('#balance').text()));
  41.  var current = deexponentize($('#double_your_btc_stake').val());
  42. }
  43.  
  44. return ((balance*2)/100) * (current*2) > stopPercentage/100;
  45.  
  46. function stopBeforeRedirect(){
  47.  var minutes = parseInt($('title').text());
  48.  if( minutes < stopBefore ) {
  49.     console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing.');
  50.     stopGame();
  51.  return true;
  52.  }
  53. }
  54.  
  55.  
  56. // Unbind old shit
  57. $('#double_your_btc_bet_lose').unbind();
  58. $('#double_your_btc_bet_win').unbind();
  59. // Loser
  60. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",
  61.  function(event){
  62.    if( $(event.currentTarget).is(':contains("lose")') ) {
  63.     console.log('You LOST! Multiplying your bet and betting again.');
  64.     multiply();
  65.     setTimeout(function(){
  66.     $hiButton.trigger('click');
  67.   }, getRandomWait());
  68. //$hiButton.trigger('click'); });
  69. }
  70.  
  71. // Winner
  72. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",
  73. function(event){
  74. if( $(event.currentTarget).is(':contains("win")') ) { if( stopBeforeRedirect() ) { return; } if( iHaveEnoughMoni() ) { console.log('You WON! But don\'t be greedy. Restarting!'); reset();
  75.  
  76. } else { }
  77.  
  78. if( stopped ) { stopped = false; return false; }
  79.  
  80. console.log('You WON! Betting again');
  81.  
  82. setTimeout(function(){ $hiButton.trigger('click'); }, getRandomWait()); });
  83.  
  84. }
RAW Paste Data