Advertisement
aloenk

fr 0.1

Nov 6th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.48 KB | None | 0 0
  1. console.clear();
  2. var startbalance = 0;
  3. var stopAt= '?';
  4. var round = 0;
  5. var gameLost=0;
  6. var gameWin=0;
  7. var higherbet=0;
  8. startbalance = $('#balance').text();
  9.  
  10. var startValue = '0.00000001', // Don't lower the decimal point more than 4x of current balance
  11.     stopPercentage = 0.001,
  12.     maxWait = 1000,
  13.     stopped = false, // debugging
  14.     stopBefore = 3, // In minutes for timer before stopping redirect on webpage
  15.     LSC= 0,
  16.     max_loss= 9,
  17.     bet_L = 1,
  18.     bet_count = 1,
  19.     max_bet= 400,
  20.     won = 0;
  21. var oldbet= 0.00000001;
  22.  
  23. var betlabel = ["Lo", "Hi"];
  24. document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="startGame()" class="free_play_link">START BOT</a>';
  25. var $loButton = $('#double_your_btc_bet_lo_button'),
  26.     $hiButton = $('#double_your_btc_bet_hi_button');
  27.  
  28. function higherBet(){
  29.     console.log('Highest bet: '+higherbet);
  30. }
  31.  
  32. function realtime(time) {
  33.     var sec_num =parseInt(time, 10) ; // don't forget the second param
  34.     var hours   = Math.floor(sec_num / 3600);
  35.     var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
  36.     var seconds = sec_num - (hours * 3600) - (minutes * 60);
  37.  
  38.     if (hours!=0) {hours   = hours+' Hours ';}      else{hours   = '';}
  39.  
  40.     if (minutes!=0) {minutes = minutes+' Minutes ';}
  41.     else{minutes   = '';}
  42.  
  43.  
  44.     if (seconds < 10) {seconds = seconds;}
  45.     var time    = 'Playing time = '+hours+minutes+seconds+' Secondes';
  46.     return time;
  47. }
  48.  
  49. function roundnumb(){
  50.     console.clear();
  51.     if( round == stopAt) {
  52.         stopGame()
  53.     } else {
  54.         round = round + 1;
  55.         console.log('Round #' + round + ' / ' + stopAt);
  56.     }
  57.  
  58.     var newbalance= $('#balance').text()
  59.     var profit = (Number(newbalance) - Number(startbalance)).toFixed(8) ;
  60.     console.log('Profit:' + profit + ' Bitcoin')
  61. }
  62.  
  63. function multiply(){
  64.     var current = $('#double_your_btc_stake').val();
  65.     var multiply = ((current * 2)+ 0.00000001).toFixed(8);
  66.     //var multiply = (current * 2).toFixed(8);
  67.     $('#double_your_btc_stake').val(multiply);
  68.     //$('#double_your_btc_stake').val(startValue);
  69.     console.log('Bet = ' + multiply);
  70.     if( higherbet < multiply ){ higherbet=multiply; }
  71. }
  72.  
  73. function getRandomWait(){
  74.     var wait = Math.floor(Math.random() * maxWait ) + 100;
  75.     console.log('Waiting for ' + wait + 'ms before next bet.');
  76.     return wait ;
  77. }
  78.  
  79. function startGame(){
  80.     document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="stopGame()" class="free_play_link">STOP BOT</a>';
  81.     startTime = (new Date()).getTime();
  82.     startValue = prompt("Number of satoshi you want to bet?", '0.00000001');
  83.     oldbet=startValue;
  84.  
  85.     round = 0;
  86.     gameLost=0;
  87.     gameWin=0;
  88.     console.log('Game started!');
  89.     reset();
  90.    
  91.     click_hilo(bet_L);
  92. }
  93.  
  94. function reset(){
  95.     if( round % 100 === 0 && round !=0) {
  96.         startValue=(startValue * 1.000).toFixed(8); //New bet after 100 round
  97.         console.log('Round ' + round + ': bet change for ' + startValue);
  98.     }  
  99.     LSC= 0;
  100.     $('#double_your_btc_stake').val(startValue);
  101. }
  102.  
  103. function stopGame(){
  104.     document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="startGame()" class="free_play_link">START BOT</a>';
  105.     console.log('Game will stop soon! Let me finish.');
  106.     stopped = true;
  107. }
  108.  
  109. // quick and dirty hack if you have very little bitcoins like 0.00000001
  110. function deexponentize(number){
  111.     return number * 10000000;
  112. }
  113.  
  114. function iHaveEnoughMoni(){
  115.     var balance = deexponentize(parseFloat($('#balance').text()));
  116.     var current = deexponentize($('#double_your_btc_stake').val());
  117.  
  118.     return ((balance)*2/100) * (current*2) > stopPercentage/100;
  119. }
  120.  
  121. function stopBeforeRedirect(){
  122.     var minutes = parseInt($('title').text());
  123.  
  124.     if( minutes < stopBefore )
  125.     {
  126.         console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing. Won: ' + won);
  127.         stopGame();
  128.  
  129.         return true;
  130.     }
  131.  
  132.     return false;
  133. }
  134.  
  135. function switch_hilo(){
  136.    
  137.     if(bet_L)
  138.     {
  139.         bet_L = 0;
  140.     }else{
  141.         bet_L = 1;
  142.     }
  143.    
  144. }
  145.  
  146. function click_hilo() {
  147.     if(bet_L){
  148.  
  149.         $hiButton.trigger('click');
  150.     }else{
  151.  
  152.         $loButton.trigger('click');
  153.     }
  154. }
  155.  
  156. // Unbind old shit
  157. $('#double_your_btc_bet_lose').unbind();
  158. $('#double_your_btc_bet_win').unbind();
  159.  
  160. // Loser
  161. $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
  162.     if( $(event.currentTarget).is(':contains("lose")') ) {
  163.         gameLost = gameLost + 1;
  164.         roundnumb();
  165.         console.log('%cWin: ' + gameWin + ' Lost: ' + gameLost, 'color: #00CC00');
  166.         endtime=(new Date()).getTime();
  167.         var time=Math.floor((endtime-startTime )/1000);
  168.         higherBet();
  169.         console.log(realtime(time));
  170.         console.log('You LOST!');
  171.         //console.log('You LOST! Multiplying your bet and betting again.');
  172.         LSC++;
  173.         console.log(bet_count + '. Clicked '+ betlabel[bet_L] +', LOST! - ' + LSC);
  174.         bet_L = 1; // get again HI
  175.        
  176.         if(LSC== 3 || LSC== 6 || LSC==8 || LSC==11 || LSC==12 || LSC==14 || LSC==16 || LSC==18 || LSC==20 || LSC==22 ) {
  177.  
  178.             switch_hilo();
  179.  
  180.         } else {
  181.  
  182.             bet_L = 1;
  183.         }
  184.        
  185.        
  186.            
  187.         if(LSC >= max_loss) {
  188.             console.log('Forced Stop! Restarting!');
  189.  
  190.             reset();
  191.  
  192.             if( stopped ) {
  193.                 stopped = false;
  194.                 return false;
  195.             }
  196.            
  197.         }else{
  198.             multiply();
  199.        
  200.             setTimeout(function() {
  201.  
  202.                 click_hilo(bet_L);
  203.  
  204.             },
  205.             getRandomWait());
  206.         }
  207.        
  208.         bet_count++;
  209.     }
  210. });
  211.  
  212. // Winner
  213. $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
  214.     if( $(event.currentTarget).is(':contains("win")') ) {
  215.         gameWin = gameWin + 1;
  216.         roundnumb();
  217.         console.log('%cWin: ' + gameWin + ' Lost: ' + gameLost, 'color: #FF0000');
  218.         endtime=(new Date()).getTime();
  219.         var time=Math.floor((endtime-startTime )/1000);
  220.         console.log(realtime(time));
  221.         higherBet();
  222.         console.log('You WON!');
  223.         won++;
  224.        
  225.         if( stopBeforeRedirect() )
  226.                 {
  227.                         return;
  228.                 }
  229.  
  230.         if(bet_count > max_bet) {
  231.             console.log('Won: '+ won +', Stop now or risk losing Everything!');
  232.  
  233.             reset();
  234.  
  235.             if( stopped )
  236.             {
  237.                 stopped = false;
  238.                 return false;
  239.             }
  240.            
  241.         } else {
  242.        
  243.             if( iHaveEnoughMoni() ) {
  244.                 console.log(bet_count + '. Clicked '+ betlabel[bet_L] +','+ won +' WON!');
  245.                 //console.log('You WON! But don\'t be greedy. Restarting!');
  246.  
  247.                 reset();
  248.  
  249.                 if( stopped )
  250.                 {
  251.                     stopped = false;
  252.                     return false;
  253.                 }
  254.             }
  255.             else
  256.             {
  257.                 //console.log('You WON! Betting again');
  258.                 console.log(bet_count + '. '+ won +' WON!');
  259.             }
  260.  
  261.             setTimeout(function(){
  262.                
  263.                 //bet_L = 1;
  264.                 //if(bet_L == 0){
  265.                 bet_L = 1;
  266.                 //}
  267.                                
  268.                 click_hilo();
  269.                
  270.             }, getRandomWait());
  271.         }
  272.         bet_count++;
  273.     }
  274. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement