console.clear();
// Tick the increase button
$('#id-bet-on-lose').click();
// Won variable
var won = null;
(function() {
console.log("This script is coded by Christian **** (clasher.7526@gmail.com). If you have any problems, contact me");
var balance = parseFloat(prompt("Type in your exact balance!!!", '0.000001'));
if (balance == null || isNaN(balance)){alert("Invalid balance, aborting");return;}
var stopAmount = parseFloat(stopAmount);
var risk = prompt("How much risk you want to have? 1 - Low, 2 - Medium, 3 - High, 4 - Auto Mode", '1');
if (risk != "1" && risk != "2" && risk != "3" && risk != "4"){
alert("Invalid risk entered, aborting");
return false;
}
if (risk == "1") {low();}
else if (risk == "2"){medium();}
else if (risk == "3"){high();}
else {automode();}
function medium() {
if (balance < 0.00001)
{
var amount = document.getElementById("amount").value = "0.00000001";
var chance = $.trim($("#editable-chance-field").val("2%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("2"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
else if (balance < 0.0001 && balance > 0.00001){
var amount = document.getElementById("amount").value = "0.00000005";
var chance = $.trim($("#editable-chance-field").val("44%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("100"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
else if (balance < 0.001 && balance > 0.0001) {
var amount = document.getElementById("amount").value = "0.00000050";
var chance = $.trim($("#editable-chance-field").val("44%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("100"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
else if (balance < 0.01 && balance > 0.001) {
var amount = document.getElementById("amount").value = "0.00000500";
var chance = $.trim($("#editable-chance-field").val("44%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("100"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
else if (balance < 0.1 && balance > 0.01) {
var amount = document.getElementById("amount").value = "0.00001096";
var chance = $.trim($("#editable-chance-field").val("44%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("100"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stopAmount){alert("You got your profit, enjoy");kill();}}, 1);
}
else if (balance > 0.1) {
var amount = document.getElementById("amount").value = "0.00002500";
var chance = $.trim($("#editable-chance-field").val("0.99%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
}
function wait(ms){
var start = new Date().getTime();
var end = start;
while(end < start + ms) {
end = new Date().getTime();
}
}
function high() {
if (balance < 0.00001)
{
var amount = document.getElementById("amount").value = "0.00000005";
var chance = $.trim($("#editable-chance-field").val("39.5%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("5"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.0001 && balance > 0.00001){
var amount = document.getElementById("amount").value = "0.00000010";
var chance = $.trim($("#editable-chance-field").val("20%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("20"));
// First click the updated condition
$('#updated_condition').click();
// Tick increase on win button
$('#id-bet-on-win').click();
var increase = $.trim($("#pourc-bet-on-win").val("0"));
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.001 && balance > 0.0001) {
var amount = document.getElementById("amount").value = "0.000000100";
var chance = $.trim($("#editable-chance-field").val("29.12%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("1.6"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.01 && balance > 0.001) {
var amount = document.getElementById("amount").value = "0.00000015";
var chance = $.trim($("#editable-chance-field").val("29.73%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("50"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.1 && balance > 0.01) {
var amount = document.getElementById("amount").value = "0.00000100";
var chance = $.trim($("#editable-chance-field").val("34,66%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("50"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance > 0.1) {
var amount = document.getElementById("amount").value = "0.001000";
var chance = $.trim($("#editable-chance-field").val("34.66%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("86"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your profit, enjoy");kill();}}, 1);
}
function low() {
if (balance < 0.00001)
{
var amount = document.getElementById("amount").value = "0.00000002";
var chance = $.trim($("#editable-chance-field").val("8%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("10"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.0001 && balance > 0.00001){
var amount = document.getElementById("amount").value = "0.00000005";
var chance = $.trim($("#editable-chance-field").val("10%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("10"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.001 && balance > 0.0001) {
var amount = document.getElementById("amount").value = "0.00000001";
var chance = $.trim($("#editable-chance-field").val("9.90%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("11"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.01 && balance > 0.001) {
var amount = document.getElementById("amount").value = "0.00000005";
var chance = $.trim($("#editable-chance-field").val("0.99%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("76"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance < 0.1 && balance > 0.01) {
var amount = document.getElementById("amount").value = "0.00000050";
var chance = $.trim($("#editable-chance-field").val("0.99%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
else if (balance > 0.1) {
var amount = document.getElementById("amount").value = "0.00001000";
var chance = $.trim($("#editable-chance-field").val("0.99%"));
var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("1.5"));
// First click the updated condition
$('#updated_condition').click();
// Wait 50 ms
wait(50);
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your lose, try again:)");kill();}}, 1);
}
function kill(){
var stopBot = $('#btn-bet-stop-pilot-dice').click();
var startBot = $('#btn-bet-start-pilot-dice').click();
var stopout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit < minus){alert("You got your profit, enjoy");kill();}}, 1);
var timeout = setTimeout(function(){var profit = $('#auto_stats_profit').html(); var profit = parseFloat(profit);if (profit > stop){alert("You got your lose, try again:)");kill();}}, 1);
}
function automode() {
// Here is the new method published in version 1.2
var risk1 = prompt("What's your automode risk? 1 - Low, 2 - Medium, 3 - High", '1');
if (risk1 != "1" && risk1 != "2" && risk1 != "3"){
alert("Invalid automode risk, aborting");
return false;
}
if (risk1 == "1")automode_low();
else if (risk1 == "2")automode_medium();
else automode_high();
}
function automode_low() {
var amount = document.getElementById("amount").value = "0.00000001";
var chance = $.trim($("#editable-chance-field").val("49.5%"));
//var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("100"));
// First click the updated condition
$('#updated_condition').click();
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
function automode_high() {
var amount = document.getElementById("amount").value = "0.00000001";
var chance = $.trim($("#editable-chance-field").val("49.5%"));
//var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("300"));
// First click the updated condition
$('#updated_condition').click();
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
function automode_medium() {
var amount = document.getElementById("amount").value = "0.00000001";
var chance = $.trim($("#editable-chance-field").val("49.5%"));
//var payout = document.getElementById('editable-payout').innerHTML = "49.5000";
// var increase = document.getElementById('pourc-bet-on-lose').value = "2";
// jQuery needed here:
var increase = $.trim($("#pourc-bet-on-lose").val("200"));
// First click the updated condition
$('#updated_condition').click();
$('#btn-bet-start-pilot-dice').click();
var stoprollButton = document.getElementById("btn-bet-stop-pilot-dice").innerHTML = "Stop Bot";
var startrollButton = document.getElementById("btn-bet-start-pilot-dice").innerHTML = "Start Bot";
}
function doubleamount() {
var attr = $(this).attr("rel");
var amount = parseFloat($("#amount" + attr).val());
amount = round_float(amount * 2, devise_decimal);
$("#amount" + attr).val(amount);
window['var_amount' + attr] = amount;
calculate_profit();
}
})();
// This is the modified bitsler play function
var stopAmount = prompt("Type in the amount after you want to stop", '0.0001');
var again = prompt("Type in 1 if you want to start the bot automatically after getting the profit and 2 for no", '1');
if (isNaN(stopAmount) || stopAmount == null){alert("Invalid Profit after to Stop, aborting");}
function play() {
if (game_in_progress == true) {
$("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
return false;
}
game_in_progress = true;
if (autobet_mode == false) {
var amount = $("#amount").val();
var condition = $("#condition-input").val();
var game = $("#game-input").val();
}
else {
var amount = auto_amount;
var condition = auto_condition;
var game = auto_game;
}
amount = round_float(amount, devise_decimal);
var profit = parseFloat($("#profit").val());
var balance = parseFloat($("#balance-"+devise).val());
var error = false;
var error_value = "";
var error_title = "";
var error_info = "";
if (auto_stats_profit > stopAmount) {
if (again == "2"){
error_title = "Got your profit";
error_info = "You got the profit you want!";
error_value = "Play again or have a nice day (clasher.7526@gmail.com) Christian";
error = true;}
else {
roll_by_condition();
$('#btn-bet-stop-pilot-dice').click();
$('#btn-bet-start-pilot-dice').click();
}
}
else if (amount > balance) {
error_title = "Bet amount";
error_info = "Maximum bet: "+number_format(balance, devise_decimal);
error_value = "Bet amount - Maximum bet: "+number_format(balance, devise_decimal);
error = true;
}
else if (amount > bet_max) {
error_title = "Bet amount";
error_info = "Maximum bet: "+number_format(bet_max, devise_decimal);
error_value = "Bet amount - Maximum bet: "+number_format(bet_max, devise_decimal);
error = true;
}
else if (amount < bet_min) {
error_title = "Bet amount";
error_info = "Minimum bet: "+number_format(bet_min, devise_decimal);
error_value = "Bet amount - Minimum bet: "+number_format(bet_min, devise_decimal);
error = true;
}
if (error == true) {
game_in_progress = false;
$("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
if (autobet_mode == true) {
if (number_bet_done >= 1) {
$("#modal-stop-autobet-numbers").html(number_bet_done);
$("#modal-stop-autobet-value").html(error_value);
$("#modal-stop-autobet-reason").modal("show");
}
else {
showErrorNotification(error_title, error_info);
}
stop_pilot_mode();
}
else {
showErrorNotification(error_title, error_info);
}
return;
}
$.ajax({
type: "POST",
url: server_front_name+"/api/bet",
data: {
access_token : access_token,
username : user_username,
type : "dice",
amount : amount,
condition : condition,
game : game,
devise : devise
},
success: function(text) {
var val = JSON.parse(text);
if (val.return.success == 'true') {
bet_nb_errors = 0;
var username = val.return.username;
var id = val.return.id;
var type = val.return.type;
var devise = val.return.devise;
var ts = val.return.ts;
var time = val.return.time;
var winning_chance = val.return.winning_chance;
var roll_number = val.return.roll_number;
var amount_return = val.return.amount_return;
var new_balance = val.return.new_balance;
var show = val.return.show;
var amount = val.return.amount;
var condition = val.return.condition;
var game = val.return.game;
var payout = val.return.payout;
$("#won-bet span").html(amount_return);
$("#won-bet span").removeClass("text-danger text-success");
if (amount_return >= 0) {
$("#won-bet span").addClass("text-success");
$("#won-bet span").html("+"+number_format(round_float(amount_return, 8), 8));
}
else {
$("#won-bet span").addClass("text-danger");
$("#won-bet span").html(number_format(round_float(amount_return, 8), 8));
}
show_result_bet();
$("#balance-"+devise).val(round_float(new_balance, 12));
if (amount_return >= 0)
$(".balance-"+devise+"-html").addClass("result-bet-win");
else
$(".balance-"+devise+"-html").addClass("result-bet-lose");
$(".balance-"+devise+"-html").html(round_float(new_balance, 8));
if (amount_return >= 0)
setTimeout(function() { $(".balance-"+devise+"-html").removeClass("result-bet-win"); }, 350);
else
setTimeout(function() { $(".balance-"+devise+"-html").removeClass("result-bet-lose"); }, 350);
addBetHistory("my-bets", type, id, username, time, amount, devise, winning_chance, roll_number, amount_return, condition, game, payout);
var notifications = val.return.notifications;
for (var prop in notifications) {
if (notifications[prop].name == "rcvJackpotDice")
rcvJackpotDice(notifications[prop]);
else {
rcvnotificationbet(notifications[prop]);
}
}
var time_delay = getTimeDelay(amount, devise, "dice");
if (autobet_mode == false) {
setTimeout(function() {
$("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
}, time_delay);
}
else {
number_bet_done++;
if (unlimited_bet == false) {
number_rolls--;
$("#limit-rolls-input").val(number_rolls);
var pourcBarre = ((number_rolls_total-number_rolls)/number_rolls_total)*100;
$("#progress-bar-pilot-mode div").css("width", pourcBarre+"%");
}
if (amount_return >= 0) {
auto_stats_won++;
}
else {
auto_stats_lost++;
}
auto_stats_lucky = ((((parseInt(auto_stats_won)/parseInt(number_bet_done))*100)/parseFloat(winning_chance))*100).toFixed(2);
auto_stats_wagered = parseFloat(auto_stats_wagered)+parseFloat(amount);
auto_stats_profit = parseFloat(auto_stats_profit)+parseFloat(amount_return);
if (on_win == "id-bet-win" && amount_return >= 0) {
auto_amount = parseFloat(auto_amount)+parseFloat(auto_amount*(pourc_on_win/100));
}
else if (amount_return >= 0) {
auto_amount = auto_amount_var;
}
if (on_lose == "id-bet-lose" && amount_return < 0) {
auto_amount = parseFloat(auto_amount)+parseFloat(auto_amount*(pourc_on_lose/100));
}
else if (amount_return < 0) {
auto_amount = auto_amount_var;
}
var tmp = Math.pow(10, 8);
auto_amount = Math.round(auto_amount*tmp)/tmp;
update_stats_auto();
if ((number_bet_done < number_rolls_total) || unlimited_bet == true) {
var speed_bet_val = $("#speed-bet").val();
var time_by_bet = parseInt(time_delay/50);
if (autobet_stop == false) {
setTimeout(function() { play(); }, time_by_bet);
}
else {
stop_pilot_mode();
}
}
else {
stop_pilot_mode();
}
}
game_in_progress = false;
if (val.return.event == true) {
socket.emit("event", {});
}
}
else {
game_in_progress = false;
if (val.return.type != "abort") {
if (autobet_mode == false) {
showErrorNotification(val.return.value, val.return.info);
$("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
}
else {
if (number_bet_done >= 1) {
$("#modal-stop-autobet-numbers").html(number_bet_done);
$("#modal-stop-autobet-value").html(val.return.value);
$("#modal-stop-autobet-reason").modal("show");
}
else {
showErrorNotification(val.return.value, val.return.info);
}
stop_pilot_mode();
}
}
else {
if (bet_nb_errors >= 2) {
bet_nb_errors = 0;
if (autobet_mode == false) {
showErrorNotification(val.return.value, val.return.info);
$("#btn-bet-dice, #btn-bet-start-pilot-dice, #btn-bet-start-fast-dice").button("reset");
}
else {
if (number_bet_done >= 1) {
$("#modal-stop-autobet-numbers").html(number_bet_done);
$("#modal-stop-autobet-value").html(val.return.value);
$("#modal-stop-autobet-reason").modal("show");
}
else {
showErrorNotification(val.return.value, val.return.info);
}
stop_pilot_mode();
}
}
else {
bet_nb_errors++;
setTimeout(function() { play(); }, 1000);
}
}
}
},
error: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);},
timeout: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);},
abort: function (xhr, ajaxOptions, thrownError) {game_in_progress = false;setTimeout(function() { play(); }, 1000);}
});
}