Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.clear();
- var startbalance = 0;
- var stopAt= '?';
- var round = 0;
- var gameLost=0;
- var gameWin=0;
- var higherbet=0;
- startbalance = $('#balance').text();
- var startValue = '0.00000001', // Don't lower the decimal point more than 4x of current balance
- stopPercentage = 0.001,
- maxWait = 1000,
- stopped = false, // debugging
- stopBefore = 3, // In minutes for timer before stopping redirect on webpage
- LSC= 0,
- max_loss= 9,
- bet_L = 1,
- bet_count = 1,
- max_bet= 400,
- won = 0;
- var oldbet= 0.00000001;
- var betlabel = ["Lo", "Hi"];
- document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="startGame()" class="free_play_link">START BOT</a>';
- var $loButton = $('#double_your_btc_bet_lo_button'),
- $hiButton = $('#double_your_btc_bet_hi_button');
- function higherBet(){
- console.log('Highest bet: '+higherbet);
- }
- function realtime(time) {
- var sec_num =parseInt(time, 10) ; // don't forget the second param
- var hours = Math.floor(sec_num / 3600);
- var minutes = Math.floor((sec_num - (hours * 3600)) / 60);
- var seconds = sec_num - (hours * 3600) - (minutes * 60);
- if (hours!=0) {hours = hours+' Hours ';} else{hours = '';}
- if (minutes!=0) {minutes = minutes+' Minutes ';}
- else{minutes = '';}
- if (seconds < 10) {seconds = seconds;}
- var time = 'Playing time = '+hours+minutes+seconds+' Secondes';
- return time;
- }
- function roundnumb(){
- console.clear();
- if( round == stopAt) {
- stopGame()
- } else {
- round = round + 1;
- console.log('Round #' + round + ' / ' + stopAt);
- }
- var newbalance= $('#balance').text()
- var profit = (Number(newbalance) - Number(startbalance)).toFixed(8) ;
- console.log('Profit:' + profit + ' Bitcoin')
- }
- function multiply(){
- var current = $('#double_your_btc_stake').val();
- var multiply = ((current * 2)+ 0.00000001).toFixed(8);
- //var multiply = (current * 2).toFixed(8);
- $('#double_your_btc_stake').val(multiply);
- //$('#double_your_btc_stake').val(startValue);
- console.log('Bet = ' + multiply);
- if( higherbet < multiply ){ higherbet=multiply; }
- }
- function getRandomWait(){
- var wait = Math.floor(Math.random() * maxWait ) + 100;
- console.log('Waiting for ' + wait + 'ms before next bet.');
- return wait ;
- }
- function startGame(){
- document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="stopGame()" class="free_play_link">STOP BOT</a>';
- startTime = (new Date()).getTime();
- startValue = prompt("Number of satoshi you want to bet?", '0.00000001');
- oldbet=startValue;
- round = 0;
- gameLost=0;
- gameWin=0;
- console.log('Game started!');
- reset();
- click_hilo(bet_L);
- }
- function reset(){
- if( round % 100 === 0 && round !=0) {
- startValue=(startValue * 1.000).toFixed(8); //New bet after 100 round
- console.log('Round ' + round + ': bet change for ' + startValue);
- }
- LSC= 0;
- $('#double_your_btc_stake').val(startValue);
- }
- function stopGame(){
- document.getElementById("free_play_link_li").innerHTML = '<a href="#" onclick="startGame()" class="free_play_link">START BOT</a>';
- console.log('Game will stop soon! Let me finish.');
- stopped = true;
- }
- // quick and dirty hack if you have very little bitcoins like 0.00000001
- function deexponentize(number){
- return number * 10000000;
- }
- function iHaveEnoughMoni(){
- var balance = deexponentize(parseFloat($('#balance').text()));
- var current = deexponentize($('#double_your_btc_stake').val());
- return ((balance)*2/100) * (current*2) > stopPercentage/100;
- }
- function stopBeforeRedirect(){
- var minutes = parseInt($('title').text());
- if( minutes < stopBefore )
- {
- console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing. Won: ' + won);
- stopGame();
- return true;
- }
- return false;
- }
- function switch_hilo(){
- if(bet_L)
- {
- bet_L = 0;
- }else{
- bet_L = 1;
- }
- }
- function click_hilo() {
- if(bet_L){
- $hiButton.trigger('click');
- }else{
- $loButton.trigger('click');
- }
- }
- // Unbind old shit
- $('#double_your_btc_bet_lose').unbind();
- $('#double_your_btc_bet_win').unbind();
- // Loser
- $('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
- if( $(event.currentTarget).is(':contains("lose")') ) {
- gameLost = gameLost + 1;
- roundnumb();
- console.log('%cWin: ' + gameWin + ' Lost: ' + gameLost, 'color: #00CC00');
- endtime=(new Date()).getTime();
- var time=Math.floor((endtime-startTime )/1000);
- higherBet();
- console.log(realtime(time));
- console.log('You LOST!');
- //console.log('You LOST! Multiplying your bet and betting again.');
- LSC++;
- console.log(bet_count + '. Clicked '+ betlabel[bet_L] +', LOST! - ' + LSC);
- bet_L = 1; // get again HI
- if(LSC== 3 || LSC== 6 || LSC==8 || LSC==11 || LSC==12 || LSC==14 || LSC==16 || LSC==18 || LSC==20 || LSC==22 ) {
- switch_hilo();
- } else {
- bet_L = 1;
- }
- if(LSC >= max_loss) {
- console.log('Forced Stop! Restarting!');
- reset();
- if( stopped ) {
- stopped = false;
- return false;
- }
- }else{
- multiply();
- setTimeout(function() {
- click_hilo(bet_L);
- },
- getRandomWait());
- }
- bet_count++;
- }
- });
- // Winner
- $('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
- if( $(event.currentTarget).is(':contains("win")') ) {
- gameWin = gameWin + 1;
- roundnumb();
- console.log('%cWin: ' + gameWin + ' Lost: ' + gameLost, 'color: #FF0000');
- endtime=(new Date()).getTime();
- var time=Math.floor((endtime-startTime )/1000);
- console.log(realtime(time));
- higherBet();
- console.log('You WON!');
- won++;
- if( stopBeforeRedirect() )
- {
- return;
- }
- if(bet_count > max_bet) {
- console.log('Won: '+ won +', Stop now or risk losing Everything!');
- reset();
- if( stopped )
- {
- stopped = false;
- return false;
- }
- } else {
- if( iHaveEnoughMoni() ) {
- console.log(bet_count + '. Clicked '+ betlabel[bet_L] +','+ won +' WON!');
- //console.log('You WON! But don\'t be greedy. Restarting!');
- reset();
- if( stopped )
- {
- stopped = false;
- return false;
- }
- }
- else
- {
- //console.log('You WON! Betting again');
- console.log(bet_count + '. '+ won +' WON!');
- }
- setTimeout(function(){
- //bet_L = 1;
- //if(bet_L == 0){
- bet_L = 1;
- //}
- click_hilo();
- }, getRandomWait());
- }
- bet_count++;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement