var multiplier = 3; var baseBet = 0.00000005; var bet = baseBet; var balanceOld = parseFloat($('#balances-lg').text()); var losingStreakLimit = 10000; var losingStreak = 0; var run = false; var clicked = true; $('#history-my-bets-dice').unbind('DOMNodeInserted'); $('#history-my-bets-dice').bind('DOMNodeInserted', function(e){ console.clear(); if(!run) return; var updatedBalance = parseFloat($($(e.target).children()[7]).text()); var profit = parseFloat($('#balances-lg').text()) - balanceOld; if(updatedBalance < 0) {//lose losingStreak++; console.log('LOSS ' + bet.toFixed(8)); profit -= bet; if(losingStreak < losingStreakLimit) bet *= multiplier; else { // stop(); // console.log('PROFIT ' + profit.toFixed(8)); // console.log('BALANCE ' + $('#balances-lg').text().trim()); // $('#amount').val(baseBet.toFixed(8)); // return; bet = baseBet; } } else { //win losingStreak = 0; profit += bet * 0.2375; console.log('WIN ' + (bet * 0.2375).toFixed(20)); bet = baseBet; } console.log('PROFIT ' + profit.toFixed(8)); console.log('BALANCE ' + $('#balances-lg').text().trim()); $('#amount').val(bet.toFixed(8)); clicked = false; }); clearInterval(handle); clearInterval(seedchanger); var handle = setInterval(function() { if(clicked == false) { $('#btn-bet-dice').trigger('click'); } },100); var seedchanger = setInterval(function() { $('#btn-change-seeds').trigger('click'); console.log('SEED CHNGED'); if(run == false) { start(); } }, 180000); function clickEvent(e) { if(!run) return; clicked = true; } $('#btn-bet-dice').unbind('click',clickEvent); $('#btn-bet-dice').bind('click',clickEvent); function end() { $('#btn-bet-dice').unbind('click',clickEvent); $('#history-my-bets-dice').unbind('DOMNodeInserted'); clearInterval(handle); clearInterval(seedchanger); } function start() { balanceOld = parseFloat($('#balances-lg').text()); // baseBet = parseFloat($('#amount').val()); bet = baseBet; run = true; $('#btn-bet-dice').trigger('click'); } function stop() { losingStreak = 0; profit = 0; run = false; clicked = true; }