Unfortunately there doesn't seem to be much interest, so I'll just release it for everybody.
If you find it useful, please drop something into my tipjar in my signature, thanks.
var minstake = 0.00000001; // minimum stake
var autorounds = 500; // play 500 rounds only
var handbrake = 0.00001024; // pause when stake reaches 1024 Satoshis
var autoruns = 1;
function playnow() {
if (autoruns > autorounds ) { console.log('Limit reached'); return; }
document.getElementById('double_your_btc_bet_hi_button').click();
setTimeout(checkresults, 100);
return;
}
function checkresults() {
if (document.getElementById('double_your_btc_bet_hi_button').disabled === true) {
setTimeout(checkresults, 100);
return;
}
var stake = document.getElementById('double_your_btc_stake').value * 1;
var won = document.getElementById('double_your_btc_bet_win').innerHTML;
if (won.match(/(\d+\.\d+)/) !== null) { won = won.match(/(\d+\.\d+)/)[0]; } else { won = false; }
var lost = document.getElementById('double_your_btc_bet_lose').innerHTML;
if (lost.match(/(\d+\.\d+)/) !== null) { lost = lost.match(/(\d+\.\d+)/)[0]; } else { lost = false; }
if (won && !lost) { stake = minstake; console.log('Bet #' + autoruns + '/' + autorounds + ': Won ' + won + ' Stake: ' + stake.toFixed(8)); }
if (lost && !won) { stake = lost * 2; console.log('Bet #' + autoruns + '/' + autorounds + ': Lost ' + lost + ' Stake: ' + stake.toFixed(8)); }
if (!won && !lost) { console.log('Something went wrong'); return; }
document.getElementById('double_your_btc_stake').value = stake.toFixed(8);
autoruns++;
if (stake >= handbrake) {
document.getElementById('handbrakealert').play();
console.log('Handbrake triggered! Execute playnow() to override');
return;
}
setTimeout(playnow, 100);
return;
}
document.getElementById('double_your_btc_stake').value = minstake.toFixed(8);
var sound = document.createElement('audio');
sound.id = 'handbrakealert';
sound.src = 'http://www.mediacollege.com/downloads/sound-effects/star-trek/tos/tos-redalert.wav';
sound.preload = 'auto';
document.getElementsByTagName('body')[0].appendChild(sound);
Usage:
Open the webconsole in Firefox by pressing CTRL+SHIFT+K
Disable "Net" and "CSS" logging to hide distracting output
Copy & Paste the above code into the console and hit enter
Type in "playnow();" (no quotes) and hit enter to start
Sit back and watch
If you get a handbrake alert, just do "playnow();" (or cursor-up) again (you can adjust your stake before you do).
You can change the stake limit anytime by issuing eg "handbrake = 0.00010240;"
Same for the minimum stake: "minstake = 0.00000010;"
Hints:
Try to play while there is no 1 hour countdown running (or pause the script) because the page reloads and that messes up the game.
The script tries to play as fast as possible. However, freebitcoin throttles you after some time (by account, not IP I think)
Pay attention to typos. A stake of 0.000001 kills you faster than 0.0000001 (personal experience)
If you want to stop before the limit is reached, change the limit (with eg "autorounds = 1;")
Try with 1 Satoshi as minimum first. Remember that losses need to be covered exponentially (3 losses: bet 8, 4 losses: bet 16, and so on)