";
// out += "
";
if (SHOW_TEST_MULT_CONF) $('#double_your_btc').prepend(out);
}
function rewards(after_refresh) {
if (LOGGING > 4) console.log("%c[RPBonuses] [Debug] Function rewards begin", 'color:grey');
var bonus_missing_time = {};
var t = missingTime();
var d = new Date();
var min_missing_min = 5;
var milli_between_bonuses = HOURS_BETWEEN_BUY_BONUS*60*60*1000;
reward_points = parseInt($('.user_reward_points').text().replace(',',""));
// Create a RP History
if (after_refresh) {
rp_hist_arr.push(reward_points);
setCookie ("rp_hist_arr", JSON.stringify(rp_hist_arr), 31);
// Debug for RP history check
if (LOGGING > 4) console.log("%c[RPBonuses] [Debug] rp_hist: " +rp_hist_arr, 'color:grey');
}
if ($("#bonus_container_free_points").length != 0) {
// Some promo is already active
bonus_missing_time.text = $('#bonus_span_free_points').text();
bonus_missing_time.hour = parseInt(bonus_missing_time.text.split(":")[0]);
bonus_missing_time.min = parseInt(bonus_missing_time.text.split(":")[1]);
if (LOGGING > 3) console.log("[RPBonuses] Promo RP is %c active %c for "+bonus_missing_time.hour+":"+bonus_missing_time.min, 'color: purple', css_reset);
setCookie("last_bonus", d.getTime(), 365);
isBonusActive = true;
if(Boolean(PROMO_MODE)) $("#script_output_title_msg_mode").text("Promo");
$('#script_output_title_bonus_wait_hours').text('Active '+bonus_missing_time.hour+'h '+bonus_missing_time.min+"m").addClass('bold');
} else {
// No promos active
var last_bonus_diff = Math.floor(d.getTime() - last_bonus);
//if (LOGGING > 4) console.log("%c[RPBonuses] [Debug] lastBonus diff: "+last_bonus_diff+" -- last_bonus: "+last_bonus+" -- now: "+d.getTime()+" var setted: "+milli_between_bonuses, 'color:grey');
//If disabled not buying
if (! Boolean(BONUS_WOF)) {
if (LOGGING > 3) console.log('[RPBonuses] Not buying WOF Bonuses. Not Active by config');
$('#script_output_title_bonus_wait_hours').text('Disabled').removeClass('true').addClass('false');
return false;
} // or if missing time not satisfied
if ( last_bonus_diff < milli_between_bonuses ) {
var min_between_bonuses = Math.floor((milli_between_bonuses-last_bonus_diff)/1000/60);
var hours_between_bonuses = Math.floor(min_between_bonuses/60);
if (LOGGING > 3) console.log('[RPBonuses] Not buying RPBonuses. Wait HOURS_BETWEEN_BUY_BONUS before buy again, missing: '+hours_between_bonuses+'h '+min_between_bonuses%60+'m');
$('#script_output_title_bonus_wait_hours').text('Wait '+hours_between_bonuses+"h "+min_between_bonuses%60+"m").removeClass('true').addClass('false');
return false;
} // or if missing time on roll error
if (t[0] < 0){
if (LOGGING > 3) console.log('[RPBonuses] Error getting missing time less then 0, that was'+t[0]+":"+t[1]);
$('#script_output_title_bonus_wait_hours').text('E0001').removeClass('true').addClass('false');
return false;
} // or before missing 10-20 minutes
if ( t[0] >= min_missing_min ) {
if (LOGGING > 3) console.log('[RPBonuses] Not buying RPBonuses. Wait '+Math.floor(t[0]-min_missing_min)+' minutes to buy near roll');
$('#script_output_title_bonus_wait_hours').text('Wait '+Math.floor(t[0]-min_missing_min)+' m');
return false;
}
// Buy WOF Bonus
$('.rewards_link').not('.hide_menu').click();
tot_rp_spent_rewards = parseInt(tot_rp_spent_rewards);
if (LOGGING > 4) console.log("[RPBonuses] Tot rp spent in Bonuses before: "+tot_rp_spent_rewards);
setTimeout(function() {
if (reward_points < 900) {
if (LOGGING > 2) console.log("[RPBonuses] No enough points to buy bonus. Less then 12. Waiting for points in next rolls");
} else if (reward_points < 1800) {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 1 WOF");
RedeemRPProduct('free_wof_1');
tot_rp_spent_rewards+=900;
} else if (reward_points < 2700) {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 2 WOF");
RedeemRPProduct('free_wof_2');
tot_rp_spent_rewards+=1800;
} else if (reward_points < 3600) {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 3 WOF");
RedeemRPProduct('free_wof_3');
tot_rp_spent_rewards+=2700;
} else if (reward_points < 4500) {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 4 WOF");
RedeemRPProduct('free_wof_4');
tot_rp_spent_rewards+=3600;
} else {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 5 WOF");
RedeemRPProduct('free_wof_5');
tot_rp_spent_rewards+=4500;
}
if (reward_points >= 4800 && Boolean(BONUS1000) ) {
if (LOGGING > 1) console.log("[RPBonuses] buying bonus 1000% roll - not convenient anymore");
setTimeout(function(){ RedeemRPProduct('fp_bonus_1000')},random(5000,10000));
tot_rp_spent_rewards+=3200;
}
$("#script_output_title_msg_mode").text("Promo");
setTimeout(function(){
setCookie("tot_rp_spent_rewards",tot_rp_spent_rewards,7);
if (LOGGING > 4) console.log("[RPBonuses] Tot rp spent in Bonuses after: "+tot_rp_spent_rewards);
$('.free_play_link').not('.hide_menu').click();
}, random(10000,20000));
} ,random(2000,16000));
}
}
function Roll() {
if (LOGGING > 4) console.log("%c[Roll] [Debug] Function Roll begin", 'color:grey');
var d = new Date();
var h = d.getHours();
var t = missingTime();
if (!Boolean(ROLL)) {
$("#script_output_title_msg_mode").text("Disabled").removeClass('true').addClass('false');
return true;
}
rollTryCount++;
if ($('#free_play_form_button').is(':visible') && ! $('#play_without_captchas_button').is(':visible')) {
r=random(1,100);
if ( isNight() && Boolean(NIGHT_MODE) ) {
if (r <= 30) rand=random(2400000,7200000);
else rand=random(1000000,3600000);
rolling_mode="Night";
} else {
if (r <= 10) rand=random(9000,7200000); // xx%, long wait, more than hour
else if (r <= 30) rand=random(6000,1800000); // long but not longest
else if (r <= 71) rand=random(3000,1200000); // xx% cases medium
else rand=random(500,60000); // xx% cases fast roll
rolling_mode="Day";
}
if (Boolean(SLOW_MODE)) {
if (r <= 5) rand=random(3000,100000);
else if (r <= 20) rand=random(300000,1500000);
else if (r <= 40) rand=random(60000,2000000);
else rand=random(120000,3000000);
rolling_mode="Slow";
}
if (Boolean(isBonusActive) && Boolean(PROMO_MODE) ) { //If promo is active, roll faster
if (r <= 5) rand=random(9000,3600000);
else if (r <= 20) rand=random(6000,1500000);
else if (r <= 40) rand=random(3000,1000000);
else rand=random(500,240000);
rolling_mode="Promo";
} else if ( isNight() && Boolean(GHOST_MODE)) {
// console.log("Ghost mode is active, don't free roll in the night");
$("#script_output_title_msg_mode").text('Ghost');
var waiting_milli;
if (stopNight > h) {
waiting_milli = (stopNight - h + 1)*60*60*1000;
} else {
waiting_milli = (stopNight + (24 - h + 1))*60*60*1000;
}
if (waiting_milli > 14400000) waiting_milli = random(14400000,16000000);
rand=random(waiting_milli, (waiting_milli + 3600000));
//Regresh every 4/6 hours max to update refers
if (LOGGING > 2) console.log("%c[Roll] Ghost Mode, Refresh page in rand "+rand/1000+" s", 'color: grey');
setTimeout(function(){
location.reload();
}, rand );
return true;
}
if (tot_btc_winning_rolling == 0) {
rand=random(1000,2000);
if (LOGGING > 2) console.log('>>>>> First Execution, fast ROLL');
}
$("#script_output_title_msg_mode").text(rolling_mode);
//rand = rand(1000,2000);
// Real ROLL Function
rollAndRetrieve(rand);
} else if ($('#play_without_captchas_button').is(':visible') ){
if (Boolean(PLAY_WITHOUT_CAPTCHA)) {
//Try to play without captcha, if enough RP
if (LOGGING > 2) console.log ("[Roll] Captcha Roll");
captchaRoll();
} else {
return false;
}
} else if (rollTryCount >= 10) {
// refresh page after 10 minutes trying the next case
location.reload();
} else if (t[0] <= 0) {
// Not in the home page window, try again in a bit
$('#script_output_title_msg_roll').html('Waiting 1m');
if (LOGGING > 2) console.log("[Roll] Retry in 1m");
setTimeout(function(){
Roll();
}, 60000 );
} else {
$('#script_output_title_msg_roll').html('Waiting Next Roll');
//$("#script_output_title_msg_mode").text("Wait");
if (LOGGING > 2) console.log("[Roll] No roll");
}
}
function captchaRoll() {
if (LOGGING > 4) console.log("%c[Roll] [Debug] Function captchaRoll begin", 'color:grey');
$('#play_without_captchas_button').click();
setTimeout(function(){
var cost_rp = $('.play_without_captcha_description span').text();
if (LOGGING > 2) console.log ("%c[Roll] Try to play without captcha for "+cost_rp+" RP points. You have "+reward_points+" RP.", 'color:purple;');
if (reward_points >= cost_rp ) {
// ROLL anyway paying
if (LOGGING > 2) console.log ("[Roll] Roll with Captcha");
$('#script_output_title_msg_roll').html('Captcha OK');
r=random(1,100);
if (r <= 10) rand=random(9000,7200000); // xx%, long wait, more than hour
else if (r <= 30) rand=random(6000,1800000); // long but not longest
else if (r <= 71) rand=random(3000,1200000); // xx% cases medium
else rand=random(500,60000); // xx% cases fast roll
rolling_mode="Captcha";
$("#script_output_title_msg_mode").text(rolling_mode);
if (tot_btc_winning_rolling == 0) {
rand=random(1000,2000);
if (LOGGING > 2) console.log('>>>>> First Execution, fast ROLL');
}
rand = random(500,60000);
rollAndRetrieve(rand);
tot_rp_spent_captcha = Math.floor (parseInt(tot_rp_spent_captcha)+parseInt(cost_rp));
setCookie("tot_rp_spent_captcha", tot_rp_spent_captcha, 7);
} else {
if (LOGGING > 2) console.log ("%c[Roll] Not enough RP. No Roll", 'color: red');
$('#script_output_title_msg_roll').html('Miss RP'); // Status on page
}
}, random(1000,3000));
}
function rollAndRetrieve (rand) {
if (LOGGING > 4) console.log("%c[Roll] [Debug] Function rollAndRetrieve begin", 'color:grey');
var d = new Date();
var h = d.getHours();
// Show hour when will roll in status panel
// new date to modify various time during function
var d1 = new Date();
d1.setSeconds(d.getSeconds() + rand/1000);
var [{ value: year },,{ value: month },,{ value: day },,{ value: hour },,{ value: minute }] = dateTimeFormat.formatToParts(d1);
$('#script_output_title_msg_roll').html('Roll at '+hour+':'+minute+'');
if (LOGGING > 2) console.log('%c[Roll] ---Will roll in '+rand/1000/60+' minutes','color:green');
setTimeout(function(){
//Duplicate the visibility chek to avoid error when humans roll and don't refresh.
if ( $('#free_play_form_button').is(':visible') ){
$('body').focus();
//Update Status on page
$('#script_output_title_msg_roll').html('++ Rolling NOW!'); // Status on page
if (LOGGING > 2) console.log('%c+++ROLL!','color:purple; font-weight: bold');
// Execute the roll!!
setTimeout(function(){ $('#free_play_form_button').click(); }, 500);
setTimeout(function(){
// get some errors and log those :(
if ( $('#free_play_error').html().length > 0 ) {
if (LOGGING > 1) console.log("%c[Roll] Some error occurred in Roll: "+$('#free_play_error').html() );
return false;
} else {
var win_btc = $('#winnings').text();
var win_lottery = $('#fp_lottery_tickets_won').text();
var win_rp = $('#fp_reward_points_won').text();
executions++;
}
// close tedious popup now
closePopupInterval($('.close-reveal-modal'));
//Update Status on page
$('#script_output_title_msg_roll').html('++ Rolled'); // Status on page
$('#script_output_title_executions_num').text(executions);
setCookie('executions', executions, 7);
if (LOGGING > 2) console.log('%c[Roll] Execution number: '+executions,'font-weight:bold; color:green');
if (LOGGING > 2) console.log('%c[Roll] Got '+win_btc+' btc, '+win_lottery+' tickets and '+win_rp+' RP!','font-weight:bold; color:green');
if (win_btc > 0) {
tot_btc_winning_rolling = parseFloat(parseFloat(tot_btc_winning_rolling) + parseFloat(win_btc)).toFixed(8);
setCookie('tot_btc_winning_rolling', tot_btc_winning_rolling, 7);
if (LOGGING > 2) console.log('%c[Roll] BTC Won totally with script %c'+tot_btc_winning_rolling,'color: gray', 'font-weight:bold');
} else {
if (LOGGING > 1) console.log('%c[Roll] Some error retrieving Roll Winnings. Winning btc was: '+win_btc, 'color: red');
}
if (win_lottery > 0) {
tot_lottery_winning_rolling = parseFloat(parseFloat(tot_lottery_winning_rolling) + parseFloat(win_lottery)).toFixed(0);
setCookie('tot_lottery_winning_rolling', tot_lottery_winning_rolling, 7);
if (LOGGING > 2) console.log('%c[Roll] Tickets Won with script %c'+tot_lottery_winning_rolling,'color: gray', 'font-weight:bold');
} else {
if (LOGGING > 1) console.log('%c[Roll] Some error retrieving Roll Winnings. Winning lottery was: '+win_btc, 'color: red');
}
if (win_rp > 0) {
tot_rp_winning_rolling = parseFloat(parseFloat(tot_rp_winning_rolling) + parseFloat(win_rp)).toFixed(0);
setCookie('tot_rp_winning_rolling', tot_rp_winning_rolling, 7);
if (LOGGING > 2) console.log('%c[Roll] RP Won with script %c'+tot_rp_winning_rolling,'color: gray', 'font-weight:bold');
} else {
if (LOGGING > 1) console.log('%c[Roll] Error retrieving Roll Winnings. Winning RP was: '+win_btc, 'color: red');
}
}, 6999);
} else {
if (LOGGING > 3) console.log('[Roll] Already Rolled maybe by some human..');
//Update Status on page
$('#script_output_title_msg_roll').html('Already Rolled'); // Status on page
setTimeout(function(){ location.reload(); }, 30000);
}
},rand);
//Random Action After ROLL
var rand1=rand+random(1000,600000);
rand=random(0,100);
if (rand > ROLL_P) {
if (LOGGING > 2) console.log('[Roll] [Debug] Reload page after roll in '+rand1/1000/60+' minutes!');
setTimeout(function(){ location.reload(); }, rand1);
} else if (rand <= ROLL_P && Boolean(MULTIPLY) && Boolean(isMultiplyPlayable)) {
// Show hour when will multiply in status panel
d1.setSeconds(d.getSeconds() + rand1/1000);
[{ value: year },,{ value: month },,{ value: day },,{ value: hour },,{ value: minute }] = dateTimeFormat.formatToParts(d1);
if (LOGGING > 0) console.log('[Roll] ---Will multiply in '+rand1/1000/60+' minutes!');
$('#script_output_multiply_status').html('Multiply at: '+hour+':'+minute+'');
setTimeout(function(){ multiply(true, false); }, rand1);
} else {
if (LOGGING > 2) console.log('[Roll] No action after roll. Rand was '+rand);
}
}
function lottery () {
//Plan buying lottery ticket
if(Boolean(LOTTERY)){
if (LOGGING > 4) console.log("%c[Lottery] [Debug] Function lottery begin", 'color:gray');
var r = random(1,100);
var d = new Date();
var h = d.getHours();
var satbalance = parseInt($('#balance').text().split(".")[1]);
var randl = random(1,LOTTERY_MAX_TICKETS).toFixed(0); //Tickets to buy
if ( isNight() ) return true;
else if (satbalance <= randl) return true;
else if (r>= LOTTERY_P) return true;
if (LOGGING > 2) console.log("[Lottery] Buy %c"+ randl + " lottery tickets %cin some time....", 'color:yellow', 'color:reset');
setTimeout(function(){
$('#lottery_tickets_purchase_count').val(randl);
setTimeout(function(){
$('#purchase_lottery_tickets_button').click();
if (LOGGING > 2) console.log("%c[Lottery] Bought "+ randl + " lottery tickets", 'color:yellow');
tot_lottery_tickets = Math.floor(parseInt(tot_lottery_tickets) + parseInt(randl));
setCookie('tot_lottery_tickets',tot_lottery_tickets,7);
}, random(2000,4000));
}, random(40000,120000));
}
}
// Multiply, called after the free roll, sometimes.
// ******** MULTIPLY GAME LOGIC START *********
// Pre start and selector
function multiply(after_roll, forced) {
if (LOGGING > 4) console.log("%c[Multiply] [Debug] Function multiply begin", 'color:grey');
var d = new Date();
var h = d.getHours();
var t = missingTime();
var max_missing_min = 0;
var milli_between_multiplies = Math.floor(MULTIPLY_WAIT_HOURS*60*60*1000);
var balance = parseFloat($('#balance').text()).toFixed(8);
var bonus_mul = false;
var last_multiply_diff = Math.floor(d.getTime() - last_multiply);
if (LOGGING > 4) console.log("%c[Multiply] [Debug] lastMultiply diff: "+last_multiply_diff+" -- last_multiply: "+last_multiply+" -- now: "+d.getTime(), 'color:grey');
if ($("#bonus_account_table").length != 0) {
var bonus_mul_balance = $('#bonus_account_balance').text().split(" ")[0];
var bonus_mul_wager_remaining = $('#bonus_account_wager').text().split(" ")[0];
if (LOGGING > 2) console.log('%c[Multiply] bonus balance: '+bonus_mul_balance+', wager remaining: '+bonus_mul_wager_remaining, 'color:grey');
bonus_mul = true;
} else bonus_mul = false;
if (!Boolean(MULTIPLY) && !Boolean(forced)) {
if (LOGGING > 3) console.log('[Multiply] Not playing multiply. Disabled by config');
$('#script_output_title_multiply_wait_hours').text('Disabled').removeClass('true').addClass('false');
$('#multiply_strategy').hide();
return false;
}
if ( !Boolean(MULTIPLY_AT_NIGHT) && isNight() && !Boolean(forced)) {
if (LOGGING > 3) console.log('%c[Multiply] Not playing multiply in the night','color:gray');
$('#script_output_title_multiply_wait_hours').text('Wait Morning');
return false;
}
if ( balance < MAX_BET && bonus_mul_balance < MAX_BET && !Boolean(forced)) {
if (LOGGING > 3) console.log('[Multiply] Not enough balance for MAX_BET');
$('#script_output_title_multiply_wait_hours').text('Adjust MaxBet');
return false;
}
if ( last_multiply_diff < milli_between_multiplies && !Boolean(forced)) {
var min_between_mult=Math.floor((milli_between_multiplies - last_multiply_diff)/1000/60);
var hours_between_mult=Math.floor(min_between_mult/60);
if (LOGGING > 3) console.log('[Multiply] Not playing multiply. Wait MULTIPLY_WAIT_HOURS before play again, missing '+hours_between_mult+"h "+min_between_mult%60+"m");
$('#script_output_title_multiply_wait_hours').text('Wait '+hours_between_mult+"h "+min_between_mult%60+"m");
//$('#ref_multiply_missing_hours').text(Math.ceil((milli_between_multiplies - last_multiply_diff)/1000/60/60));
$('#script_output_title_multiply_wait_hours').removeClass('true').addClass('false');
return false;
}
if ( t[0] > 0 && t[0] <= max_missing_min && !Boolean(forced)) {
if (LOGGING > 3) console.log('[Multiply] Not playing multiply. Wait to play not near next roll, missing just %c'+t[0]+' min', 'color:purple');
$('#script_output_title_multiply_wait_hours').text('Wait '+t[0]+'m');
return false;
}
if (Boolean(isMultiplyRunning)) {
if (LOGGING > 3) console.log('[Multiply] Not playing multiply. Some other istance already playing');
return false;
}
if (Boolean(after_roll)) {
if (!Boolean(forced)) $('.double_your_btc_link').not('.hide_menu').click();
tot_multiply_games = parseInt(tot_multiply_games)+1;
setCookie("tot_multiply_games", tot_multiply_games, 30);
setCookie("last_multiply", d.getTime(), 30);
$('#script_output_multiply_status').html('Multiply: Running!');
if (LOGGING > 4) console.log(Boolean(after_roll)+", "+balance+", "+bonus_mul_balance+", "+MAX_BET+", "+Boolean(MULTIPLY));
multiply_manual();
} else {
isMultiplyPlayable = true;
if (LOGGING > 3) console.log('[Multiply] Yes can play multiply '+isMultiplyPlayable);
}
}
function multiply_manual() {
var bet_count=0; var bet_remaining=0;
var past_bet; var bet_amount; var bet_odds; var bet_hilo;
var winnings=0;
var won=0; // won lost or error -1, 1 or 0
var consecutive_lost=0; var consecutive_win=0;
var fast_bet=false; var log_msg = ""; var c;
var multiply_message="";
var curr_multiply_balance=0; var curr_multiply_wagered = 0;
var max_consecutive_losts_session=0; var max_consecutive_wins_session=0;
var max_consecutive_losts_inplay_session=0; var max_bet_session=0;
var last_session_hist=[];
var balance = parseFloat($('#balance').text()).toFixed(8);
// Global vars setting to avoid duplicate games and increments.
// as error reported bug on play
game2_consecutive_lost_passed=false; game2_finished_loosing=false;
game2_play_after_losses=0; game2_step=0;
forceMultiplyStopHard=false; forceMultiplyStopSoft=false;
game_play_began=false; game_play_count=0;
// Multilpy Running
isMultiplyRunning = true;
if ( $('#multiply_full_container').length) {
multiply_message = "Running!";
$('#multiply_message').html(multiply_message);
}
// Activate DOM Monitors
/// *** NEW VERSION ***
if (LOGGING > 4) console.log("[Multiply] Activating MutationObserver Monitors, beginning to play");
const targetNode = document.getElementById('double_your_btc_result');
const config = { attributes: true, childList: true, subtree: true };
const callback = function(mutationsList, observer) {
//if (LOGGING > 4) console.log("%cDom modified.", "color: grey");
if ( $('#double_your_btc_error').html().length > 0 ) {
var multiply_error = $('#double_your_btc_error').html();
console.log('%c[Multiply] Fatal Error in multiply: '+multiply_error, 'color: red');
//$('#script_output_title_multiply_wait_hours').text('Fatal Error').removeClass(true).addClass('false');
setCookie('multiply_error', multiply_error, 31);
multiply_message = "Finish for some error";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
} else if ( $("#double_your_btc_bet_win").html().length > 0 ) {
won = 1; c="green"; fast_bet = true;
winnings = $("#double_your_btc_bet_win").html().split(" ")[6];
if (winnings > 0) {
tot_multiply_balance = parseFloat(parseFloat(tot_multiply_balance) + parseFloat(winnings)).toFixed(8);
curr_multiply_balance = parseFloat(parseFloat(curr_multiply_balance) + parseFloat(winnings)).toFixed(8);
}
consecutive_win++;
consecutive_lost=0;
if ( $('#multiply_full_container').length) {
$('#multiply_cons_wins > b').html(consecutive_win).addClass("green-bg");
setTimeout(function () { $("#multiply_cons_wins > b").removeClass("green-bg"); },500);
}
} else if ($("#double_your_btc_bet_lose").html().length > 0 ) {
won = -1; c = "red";
winnings = $("#double_your_btc_bet_lose").html().split(" ")[6];
if (winnings > 0) {
tot_multiply_balance = parseFloat(parseFloat(tot_multiply_balance) - parseFloat(winnings)).toFixed(8);
curr_multiply_balance = parseFloat(parseFloat(curr_multiply_balance) - parseFloat(winnings)).toFixed(8);
}
consecutive_lost++;
consecutive_win=0;
if ( $('#multiply_full_container').length) {
$('#multiply_cons_losts > b').html(consecutive_lost).addClass("red-bg");
setTimeout(function () { $("#multiply_cons_losts > b").removeClass("red-bg"); },500);
}
} else won = 0;
if (won != 0) {
// COOKIES for STATISTICS
setCookie("tot_multiply_balance", tot_multiply_balance, 7);
setCookie('curr_multiply_balance',curr_multiply_balance,7);
var rolled = $('#previous_roll').text();
last_session_hist.push(Math.round(curr_multiply_balance*100000000));
setCookie('last_multiply_session_hist',JSON.stringify(last_session_hist),7)
// Session Cookie
if (consecutive_lost >= max_consecutive_losts_session) {
max_consecutive_losts_session=consecutive_lost;
setCookie('max_consecutive_losts_session', max_consecutive_losts_session, 7);
}
if (consecutive_lost >= max_consecutive_losts_inplay_session && bet_amount > MIN_BET) {
max_consecutive_losts_inplay_session=consecutive_lost;
setCookie('max_consecutive_losts_inplay_session',max_consecutive_losts_inplay_session,7);
}
if (bet_amount >= max_bet_session) {
max_bet_session=parseFloat(bet_amount).toFixed(8);
setCookie('max_bet_session',max_bet_session,7);
}
// General Cookies
if (consecutive_lost > max_consecutive_losts_inplay && bet_amount > MIN_BET) {
max_consecutive_losts_inplay = consecutive_lost;
setCookie('max_consecutive_losts_inplay',max_consecutive_losts_inplay,7);
}
if (consecutive_lost > max_consecutive_losts) {
max_consecutive_losts=consecutive_lost;
setCookie('max_consecutive_losts', consecutive_lost, 365);
}
if ( rolled != '7777' ){
jackpot_distance++;
setCookie('jackpot_distance', jackpot_distance, 31);
}
if ( $('#multiply_full_container').length) {
// Update the values
$('#multiply_bet_count > b').html(bet_count).addClass("green-bg");
setTimeout(function () { $("#multiply_bet_count > b").removeClass("green-bg"); },200);
$('#multiply_play_count > b').html(game_play_count);
$('#multiply_max_cons_losts > b').html(max_consecutive_losts_session);
$('#multiply_max_bet > b').html(max_bet_session);
$('#balance_before > b').html(balance);
$('#balance_now > b').html(parseFloat($('#balance').text()).toFixed(8));
$('#multiply_wagered > b').html(curr_multiply_wagered);
$('#multiply_profit > b').html(curr_multiply_balance);
}
// Next bet values getting It return a FLOAT number. Will be converted in bet function.
bet_amount = get_bet_amount( past_bet, consecutive_lost, consecutive_win);
bet_hilo = get_bet_hilo(consecutive_lost);
bet_odds = get_bet_odds();
if (LOGGING > 2) {
log_msg = "Rolled:"+rolled+",%c Won:"+parseFloat(winnings).toFixed(8)+"%c, Played#:"+bet_count;
log_msg += "/"+MAX_ROLLS_AT_MULTIPLY+"/"+game_play_count+", L/W: "+consecutive_lost+"/"+consecutive_win;
log_msg += ", CurrBal:"+curr_multiply_balance+", TotBal:"+tot_multiply_balance;
log_msg += " ";
console.log(log_msg, css_bold+"color:"+c, css_reset);
}
// EXIT CONDITIONS -- Play or finished logic
if (Boolean(forceMultiplyStopHard)) {
multiply_message = "Finish for Stop Button pressed";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
} else if ( bet_count >= MAX_ROLLS_AT_MULTIPLY || Boolean(forceMultiplyStopSoft)) {
if (LOGGING > 2) console.log("%cSoft finish, wait ending this play", css_bold+"color:"+c+", "+css_reset);
if ( !Boolean(game_play_began) ) {
multiply_message = "Finish for Stop Soft or Max Roll passed";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
}
} else if (game_play_count >= MAX_PLAY && !Boolean(game_play_began)) {
multiply_message = "Finish for Game Play count passed";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
} else if (bet_amount > MAX_BET) {
multiply_message = "Finish for bet amount passed max bet";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
} else if (curr_multiply_balance >= MAX_WIN) {
multiply_message = "Finish for MAX_WIN passed";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return true;
} else if (bet_amount < 0.00000001) {
multiply_message = "Finish for error in bet amount value";
if (LOGGING > 2) console.log("%c"+multiply_message, css_bold+"color:"+c);
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
return false;
}
curr_multiply_wagered = parseFloat(parseFloat(curr_multiply_wagered) + parseFloat(bet_amount)).toFixed(8);
tot_multiply_wagered = parseFloat(parseFloat(tot_multiply_wagered) + parseFloat(bet_amount)).toFixed(8);
setCookie('tot_multiply_wagered',tot_multiply_wagered, 365);
setCookie('curr_multiply_wagered',curr_multiply_wagered, 30);
if (past_bet != bet_amount) fast_bet=false;
else fast_bet=true;
bet_count++;
past_bet=bet_amount;
//Security wait of 30 seconds if speed fast (3) and every 500 collected
// call the bet
bet(bet_amount, bet_hilo, bet_odds, fast_bet);
} else {
var winlength=$("#double_your_btc_bet_win").html().length;
var loslength=$("#double_your_btc_bet_lose").html().length;
var domtree=$('#double_your_btc_result').html();
multiply_message = "Finish for no value in DOM var";
if (LOGGING > 1) console.log("%cFinish for no value in won var, was: "+won+", win l: "+winlength+", los l: "+loslength, css_bold+"color:"+c);
if (LOGGING > 3) console.log("%cFinish for no value in won var, DOM was: "+domtree, css_bold+"color: grey");
multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message);
}
};
// Begin the observer
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
// Disable Animation
$("#disable_animation_checkbox").prop( "checked", true );
// First bet that cause all the others and Dom modifications
setTimeout(function(){
bet_hilo = get_bet_hilo(0);
bet_amount = get_bet_amount(MIN_BET,0,0);
bet_odds = get_bet_odds();
bet_count++; past_bet=bet_amount;
bet(bet_amount, bet_hilo, bet_odds, false);
}, random (3500,6500) );
}
function get_bet_amount(past_bet, consecutive_lost, consecutive_win){
if (STRATEGY == 0) {
if (consecutive_lost == 0) {
game_play_began=false;
return BAS_BET;
}
else {
if (consecutive_lost == 1) {
game_play_began = true;
game_play_count++;
tot_multiply_play++;
setCookie('tot_multiply_play', tot_multiply_play, 7);
}
return past_bet*2;
}
} else if (STRATEGY == 1 || WAIT_PLAY_AFTER_LOSSES == 0){
if (consecutive_lost < MIN_LOSSES_BEFORE_PLAY) {
if (Boolean(game_play_began)) {
game_play_began=false;
}
return MIN_BET;
} else if (consecutive_lost == MIN_LOSSES_BEFORE_PLAY){
game_play_began=true;
tot_multiply_play++;
game_play_count++;
setCookie('tot_multiply_play', tot_multiply_play, 7);
return BAS_BET;
} else {
return past_bet+(past_bet*INCR/100);
}
} else if (STRATEGY == 2 || STRATEGY == 3) {
if (!Boolean(game2_consecutive_lost_passed)) {
if (Boolean(game_play_began)) game_play_began=false;
if (consecutive_lost < MIN_LOSSES_BEFORE_PLAY) {
game2_step=1;
return MIN_BET;
} else if (consecutive_lost == MIN_LOSSES_BEFORE_PLAY){
// passed tot lost, next step -> else
game2_step=2;
game2_consecutive_lost_passed = true;
return MIN_BET;
} else return "-009";
} else {
if (!Boolean(game2_finished_loosing)) {
if (consecutive_win == 0 ) {
game2_step=3;
return MIN_BET;
} else {
//finished loosing, first win, next step -> else
game2_step=4;
game2_finished_loosing=true;
game2_play_after_losses++;
return get_bet_amount(MIN_BET,consecutive_lost,consecutive_win);
}
} else {
if (!Boolean(game_play_began)){
if (game2_play_after_losses < WAIT_PLAY_AFTER_LOSSES) {
game2_step=5;
game2_play_after_losses++;
return MIN_BET;
} else if (game2_play_after_losses >= WAIT_PLAY_AFTER_LOSSES){
// Begin to play, next step -> else
game2_step=6;
game_play_began=true;
tot_multiply_play++;
game_play_count++;
setCookie('tot_multiply_play', tot_multiply_play, 7);
return BAS_BET;
} else return "-008";
} else {
if (consecutive_lost > 0) {
game2_step=7;
return past_bet+(past_bet*INCR/100);
} else {
// Playing and won, go back to the begin
game_play_began=false;
game2_step=0;
game2_consecutive_lost_passed=false;
game2_finished_loosing=false;
game2_play_after_losses=0;
if (STRATEGY == 3) {
MIN_LOSSES_BEFORE_PLAY++;
if (LOGGING > 2) console.log("New MIN_LOSSES_BEFORE_PLAY value is: "+MIN_LOSSES_BEFORE_PLAY);
}
return MIN_BET;
}
}
}
}
} else return "-010";
}
function get_bet_odds () {
if (STRATEGY == 0) { return 2; }
else return ODDS;
}
function get_bet_hilo (index) {
if (HIGH_LOW == 3 ) {
var olaer = ['H','L','L','H','H','H','L','L','L','L','H','H','H','H','H','L','L','L','L','L','L','H','H','H','H','H','H','H','L','L','L','L','L','L','L','L'];
var key = index % olaer.length;
return olaer[key];
} else if (HIGH_LOW == 1) {
return "H";
} else if (HIGH_LOW == 2) {
return "L";
} else {
var r = random(1,10);
if (r<5) return 'H';
else return 'L';
}
}
function bet(amount, hl, odds, fast) {
var toclick; var wait_time_1=0; var wait_time_2=0;
if (hl == "L") toclick = "#double_your_btc_bet_lo_button";
else toclick = "#double_your_btc_bet_hi_button";
//if (LOGGING > 4) console.log(">> playing: "+hl+", betting: "+amount.toFixed(8) );
tot_multiply_bets++;
setCookie('tot_multiply_bets', tot_multiply_bets, 7);
if (SPEED == 0) {
wait_time_1 = random(2000,10000); wait_time_2=random(1000,5000);
} else if (SPEED == 1) {
if (Boolean(fast)) { wait_time_1 = random(300,900); wait_time_2=random(100,200); }
else { wait_time_1 = random(1133,5544); wait_time_2=random(100,1000); }
} else if (SPEED == 2) {
wait_time_1 = random(300,1000); wait_time_2=random(100,200);
} else {
wait_time_1 = random(10,20); wait_time_2=0;
}
setTimeout (function(){
$("#double_your_btc_stake").val(parseFloat(amount).toFixed(8));
$("#double_your_btc_payout_multiplier").val(odds);
setTimeout(function(){ $(toclick).click(); }, wait_time_1 );
}, wait_time_2 );
}
function multiplyEndGame(bet_amount, bet_count, consecutive_lost, curr_multiply_balance, observer, multiply_message) {
// Finished playing multiply
// Deactivate DOM Monitors
observer.disconnect();
if ( $('#multiply_full_container').length) {
$('#multiply_message').html(multiply_message);
}
multiply_hist_arr.push(tot_multiply_balance);
setCookie('multiply_hist_arr',JSON.stringify(multiply_hist_arr),14);
console.log("%cMultiply hist array: "+multiply_hist_arr, 'color:grey');
if (LOGGING > 2) {
if (bet_amount > MAX_BET) {
console.log("%c Max Bet limit passed. Max Bet: "+MAX_BET+", Next Bet: "+bet_amount, 'color: red');
} else if (bet_count >= MAX_ROLLS_AT_MULTIPLY ) {
console.log("%c Max Rolls limit passed. Max Rolls: "+MAX_ROLLS_AT_MULTIPLY+", Tot Rolls: "+bet_count+" with "+consecutive_lost+" cons losts", 'color: red');
} else if (game_play_count >= MAX_PLAY) {
console.log("%c Max Plays limit passed. Max Plays: "+MAX_PLAY+", Tot Plays: "+game_play_count, 'color: red');
}
}
if (LOGGING > 4) console.log("%c Disabling Monitors, finished multiply", css_bold+'color:green');
if (LOGGING > 4) console.log("%c Tot Balance: "+tot_multiply_balance+", Tot games: "+tot_multiply_games+", Tot bets: "+tot_multiply_bets, css_bold+'color: green');
if (LOGGING > 4) console.log("%c Session Balance: "+curr_multiply_balance+", Session tot bets: "+bet_count, css_bold+'color:green');
$('#script_output_multiply_status').html('Multiply: Done!');
isMultiplyRunning=false;
setTimeout(function(){
isMultiplyRunning = false;
$('.free_play_link').not('.hide_menu').click();
}, random(3000,30000));
}
function missingTime () {
var min = 0; var sec = 0; var str = "";
str = $('title').text().split(" ")[0];
//if (LOGGING > 4) console.log("%c[missingTime] [Debug] string: "+str, 'color: grey');
if (str.length <= 7 && str.length >= 3) {
min = str.split(':')[0]; if (min.length > 0) min = min.replace('m','');
sec = str.split(':')[1]; if (sec.length > 0) sec = sec.replace('s','');
} else if ( $('#free_play_form_button').is(':visible') ) {
min = 0; sec = 0;
} else { min = -1; sec = -1; }
return [min,sec];
}
function isNight(){
var d = new Date();
var h = d.getHours();
if ( stopNight > startNight && h >= startNight && h <= stopNight) {
// console.log(h+" -- "+stopNight)
return true;
} else if (stopNight < startNight && h >= startNight || h <= stopNight ) {
return true;
}
else return false;
}
function random(min,max){
return min + (max - min) * Math.random();
}
function closePopupInterval (target) {
//if (LOGGING > 4) console.log("%c[Debug] Function closePopupInterval begin", 'color:grey');
if (target.is(':visible')) {
setTimeout(function(){
if (LOGGING > 3) console.log("%cClose ADS", 'color: grey');
target.click();
ads_closed ++;
$('#script_output_title_ads_closed_num').text(ads_closed);
}, random (500,120000));
} else {
//if (LOGGING > 4) console.log("%cNot visible: "+target.attr('id')+" "+target.attr('class'), 'color: grey');
}
}
function closeRandomPopupInterval (target, randomness) {
//if (LOGGING > 4) console.log("%c[Debug] Function closeRandomPopupInterval begin", 'color:grey');
var rand = random(1,100);
if (rand < randomness && target.is(':visible')) {
setTimeout(function(){
if (LOGGING > 3) console.log("%cClose Random ADS", 'color: grey');
target.click();
ads_closed ++;
$('#script_output_title_ads_closed_num').text(ads_closed);
}, random (500,120000));
} else {
//if (LOGGING > 4) console.log("%cNot visible: "+target.attr('id')+" "+target.attr('class'), 'color: grey');
}
}
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i 2) console.log("%c Resettnig all stats deleting all cookies", 'color:red');
setCookie("last_bonus",0,365); setCookie("last_multiply",0,30); setCookie("rp_hist_arr","[]",31); setCookie("tot_multiply_balance",0,7); setCookie("tot_multiply_games",0,30);
setCookie("tot_rp_spent_captcha",0,7); setCookie("tot_rp_spent_rewards",0,7); setCookie('curr_multiply_balance',0,7); setCookie('curr_multiply_wagered',0,30);
setCookie('executions',0,7); setCookie('last_multiply_session_hist',0,7); setCookie('max_bet_session',0,7); setCookie('max_consecutive_losts',0,365);
setCookie('max_consecutive_losts_inplay',0,7); setCookie('max_consecutive_losts_inplay_session',0,7); setCookie('max_consecutive_losts_session',0,7);
setCookie('multiply_error',0,31); setCookie('multiply_hist_arr',"[]",14); setCookie('tot_btc_winning_rolling',0,7); setCookie('tot_lottery_tickets',0,7);
setCookie('tot_lottery_winning_rolling',0,7); setCookie('tot_multiply_balance',0,7); setCookie('tot_multiply_bets',0,7); setCookie('tot_multiply_play',0,7);
setCookie('tot_multiply_wagered',0,365); setCookie('tot_rp_winning_rolling',0,7);
location.reload();
}
function showStatus(){
if (LOGGING > 4) console.log("%c[Debug] Function showStatus begin", 'color:grey');
var t=missingTime();
var date = new Date();
var script_output_msg_1 = "";
var script_output_msg_2 = "";
var [{ value: month },,{ value: day },,{ value: year },,{ value: hour },,{ value: minute }] = dateTimeFormat.formatToParts(date);
var ca='red'; var cb='red'; var cc='red'; var css='font-weight: bold; color:';
var c1='purple'; var c2='olive';
var c3='brown'; var c4='teal';
if (LOGGING > 0) console.log(">>>>>>>>>>%c Status:%c ["+hour+":"+minute+"]", css_bold+'color:'+c1, css_bold);
//Rewards and multiply infos and colors
if (Boolean(BONUS_WOF)) ca = 'green'; if (Boolean(MULTIPLY)) cb='green'; if (Boolean(LOTTERY)) cc='green';
var cssa='font-weight: bold; color:'+ca;
var cssb='font-weight: bold; color:'+cb;
var cssc='font-weight: bold; color:'+cc;
if (LOGGING > 0) console.log(">>>>>>>>>> Buying Rewards: "+"%c"+Boolean(BONUS_WOF)+""+"%c; Playing Multiply: "+"%c"+Boolean(MULTIPLY)+""+"%c; Buying Lottery: "+"%c"+Boolean(LOTTERY), cssa, css_reset,cssb, css_reset, cssc);
if (t[0] > 0 || t[1] > 0) {
if (LOGGING > 0) console.log(">>>>>>>>>> Missing "+"%c"+t[0]+" min "+t[1]+" sec"+"%c for next roll",css_bold+"color:"+c1,css_reset);
}
if (LOGGING > 0) console.log(">>>>>>>>>> BTC won with script: "+"%c"+tot_btc_winning_rolling, css_bold+'color:'+c4);
if (LOGGING > 0) console.log(">>>>>>>>>> Tickets won with script: "+"%c"+tot_lottery_winning_rolling, css_bold+'color:'+c4);
if (LOGGING > 0) console.log(">>>>>>>>>> RP won with script: "+"%c"+tot_rp_winning_rolling, css_bold+'color:'+c4);
if (LOGGING > 0) console.log(">>>>>>>>>> RP Spent with rewards: "+"%c"+tot_rp_spent_rewards, css_bold+'color:'+c1);
if (LOGGING > 0) console.log(">>>>>>>>>> RP Spent with captcha: "+"%c"+tot_rp_spent_captcha, css_bold+'color:'+c1);
if (LOGGING > 0) console.log(">>>>>>>>>> Multiply Balance: "+"%c"+tot_multiply_balance, css_bold+'color:'+c3);
if (LOGGING > 0) console.log(">>>>>>>>>> Multiply Games played: "+"%c"+tot_multiply_games, css_bold+'color:'+c3);
if (LOGGING > 0) console.log(">>>>>>>>>> Multiply Wagered: "+"%c"+tot_multiply_wagered, css_bold+'color:'+c3);
// Update Status Message OnPage
script_output_msg_1 = "Config: ";
script_output_msg_1 += "WOF BONUS <> ";
script_output_msg_1 += "BONUS1000 <> ";
script_output_msg_1 += "MULTIPLY <> ";
script_output_msg_1 += "LOTTERY";
$('#script_output_msg_1').html(script_output_msg_1);
script_output_msg_2 = " Script Winnings: ";
script_output_msg_2 += ""+tot_btc_winning_rolling+" btc; ";
script_output_msg_2 += ""+tot_lottery_winning_rolling+" tickets; ";
script_output_msg_2 += ""+tot_rp_winning_rolling+" RP.";
script_output_msg_2 += "";
script_output_msg_2 += " Script Spent: ";
script_output_msg_2 += ""+tot_lottery_tickets+" in lottery tickets; ";
script_output_msg_2 += ""+tot_rp_spent_rewards+" RP in bonus; ";
script_output_msg_2 += ""+tot_rp_spent_captcha+" RP in captcha. ";
script_output_msg_2 += "";
script_output_msg_2 += " Script Multiply Balance: ";
script_output_msg_2 += ""+tot_multiply_balance+" btc in ";
script_output_msg_2 += ""+tot_multiply_games+" games and ";
script_output_msg_2 += ""+tot_multiply_bets+" bets";
$('#script_output_msg_2').html(script_output_msg_2);
}
function setBtcPrice(){
//if (LOGGING > 4) console.log("%c[Debug] Function setBtcPrice begin", 'color:grey');
var btc_price=$('#btc_usd_price').html().split('.')[0].replace('$','').replace(',','');
var i=1;
var to=2000;
if (i>=10) return false;
else if (isNaN(btc_price)) {
if (LOGGING > 4) console.log("%c[setBtcPrice] Price NA, try again in "+to*i/1000+" s", 'color:grey');
setTimeout(function(){ setBtcPrice(); }, to*i );
i++;
return true;
} else {
$('#usdxbtc').html(btc_price);
var usd_price=parseFloat(100000000/btc_price).toFixed(0);
$('#satxusd').html(usd_price);
}
}