$('body').append('<div style="position:fixed;top:0;left:0;width:100%;heig ht:100%;min-height:100%;text-align: center;z-index:100000;background-color:white;" class=""><table style="margin:0 auto;"><tr><td>balance</td><td id="balance_b"></td></tr><tr><td>win</td><td id="roundwin_b"></td></tr><tr><td>bet</td><td id="current_bet_b"></td></tr><tr><td>time</td><td id="time_b"></td></tr></table></div>');
bconfig = {
maxBet: 15,
wait: 1,
toggleHilo: true,
alertMultiplier: 15000
};
initialBalance = parseFloat($('#balance').html());
hilo = 'hi';
multiplier = 1.5;
startTime = new Date().getTime();
rollDice = function() {
if ($('#double_your_doge_bet_lose').html() !== '') {
$('#double_your_doge_2x').click();
$('#double_your_doge_2x').click();
multiplier=multiplier*2;
if (bconfig.toggleHilo) toggleHiLo();
} else {
setStartBet();
$('#double_your_doge_bet_win').html('');
var cmsg = {
lose: $('#double_your_doge_bet_lose').html(),
win: $('#double_your_doge_bet_win').html()
};
cmsg = JSON.stringify(cmsg);
}
//if (multiplier > bconfig.alertMultiplier) {
$('#double_your_doge_bet_' + hilo + '_button').click();
/*} else {
if (parseFloat($('#balance').html()) < (parseFloat($('#double_your_doge_stake').val()) * 2) ||
parseFloat($('#double_your_doge_stake').val()) > bconfig.maxBet) {
$('#double_your_doge_min').click();
$('#double_your_doge_2x').click();
$('#double_your_doge_2x').click();
multiplier = 1.5;
}
$('#double_your_doge_bet_' + hilo + '_button').click();
}*/
// setTimeout(rollDice, (multiplier * bconfig.wait) + Math.round(Math.random() * 100));
};
toggleHiLo = function() {
if (hilo === 'hi') {
hilo = 'lo';
} else {
hilo = 'hi';
}
};
setStartBet = function() {
$('#double_your_doge_min').click();
$('#double_your_doge_2x').click();
$('#double_your_doge_2x').click();
$('#double_your_doge_2x').click();
multiplier = 1.5;
// if ((Math.random() * 10) > 5) {
// } else {
// $('#double_your_doge_min').click();
// $('#double_your_doge_2x').click();
// multiplier = 2;
// }
}
currentMsg = '';
bChange = function(next) {
var cmsg = {
lose: $('#double_your_doge_bet_lose').html(),
win: $('#double_your_doge_bet_win').html()
};
cmsg = JSON.stringify(cmsg);
if (currentMsg !== cmsg) {
$('#balance_b').html($('#balance').html());
$('#roundwin_b').html((parseFloat($('#balance').ht ml()) - initialBalance).toFixed(
);
$('#current_bet_b').html($('#double_your_doge_stak e').val());
$('#time_b').html((Math.round(((new Date().getTime()) - startTime) / 1000) / 60 / 60).toFixed(2) + ' h');
currentMsg = cmsg;
next();
}
setTimeout(function() {
setTimeout(function() {
bChange(next);
}, bconfig.wait)
}, 50);
};
bChange(rollDice);