Created
June 14, 2017 21:39
-
-
Save anonymous/4029caa0bee5fb72397d924e949859a6 to your computer and use it in GitHub Desktop.
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
/* | |
Created this script to automate betting on freebitco.in | |
Open Multipy BTC game on freebitco.in | |
Copy and paste code below into Chrome developer console and press Enter | |
I accept donations :) | |
1Coin5Nq5bYpst6nCie91CaSYuc9LjLKBn | |
Thanks | |
*/ | |
if (typeof observer != 'undefined') { | |
observer.disconnect(); | |
} | |
$('#double_your_btc_payout_multiplier').val("4.00"); | |
var btnIdStr = 'double_your_btc_bet_hi_button'; | |
var target = document.getElementById(btnIdStr); | |
var multiplier = 4; | |
var startBet = 3; // in satoshi | |
var betNumber = 1; | |
function nextBet() { | |
return toSatoshi(getBet(betNumber++, multiplier)).toFixed(8); | |
} | |
function reset() { | |
betNumber = 1; | |
return nextBet(); | |
} | |
function getBet(n, multiplier) { | |
var base = 2 * (multiplier - 1); | |
var a = Math.floor(n / (base-1)); | |
var m = n % (base-1); | |
if(m != 0) { | |
var bet = Math.pow(base, a) * m; | |
} else { | |
var bet = Math.pow(base, a-1) * (base-1); | |
} | |
return startBet * bet; | |
} | |
function toSatoshi(amount) { | |
return amount / 100000000; | |
} | |
// create an observer instance | |
var observer = new MutationObserver(function (mutations) { | |
mutations.forEach(function (mutation) { | |
if (mutation.oldValue == 'disabled') { | |
if($("#double_your_btc_bet_win").is(':visible')) { | |
// win | |
$('#double_your_btc_stake').val(reset()); | |
} else { | |
// lose | |
var next = nextBet(); | |
console.log(next) | |
$('#double_your_btc_stake').val(next); | |
} | |
setTimeout(function () { | |
$('#' + btnIdStr).click(); | |
}, 500); | |
} | |
}); | |
}); | |
// configuration of the observer: | |
var config = { | |
attributes: true, | |
childList: false, | |
characterData: false, | |
attributeOldValue: true | |
}; | |
// pass in the target node, as well as the observer options | |
observer.observe(target, config); | |
// start the game | |
reset(); | |
$('#double_your_btc_stake').val(reset()); | |
$('#' + btnIdStr).click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment