var baseBet = '0.
00000001';
growthRate = 0.05; // Defaultnya 0.0001
stopPercentage = 0.08, // Dalam persen (%), tidak direkomendasikan melampaui
0.08 %, defaultnya 0.0004
maxWait = 100, // In milliseconds
stopped = false,
stopBefore = 3, // Dalam menit (Berhenti sebelum Roll per jam)
multiplier = 2,
initialBalance = 0,
profit = 0,
beforeSeqBalance = 0;
var useFixedBase = true;
var $loButton = $('#double_your_btc_bet_lo_button'),
$hiButton = $('#double_your_btc_bet_hi_button'),
$stake = $('#double_your_btc_stake'),
$payout = $('#double_your_btc_payout_multiplier'),
$lose = $('#double_your_btc_bet_lose'),
$win = $('#double_your_btc_bet_win'),
$btn = $loButton
$bal = $('#balance');
var hiSide = true; // kalau true = Hi, kalau false = Lo
function setPayout(val){
$[Link](val);
}
function getBalance(){
return parseFloat($[Link]());
}
function multiply(){
var current = $[Link]();
var multiply = (current * multiplier);
multiply = [Link](8);
stake = multiply;
$[Link](multiply);
}
function randomIntFromInterval(min,max)
{
return [Link]([Link]()*(max-min+1)+min);
}
function getRandomWait(){
var wait = randomIntFromInterval(50, maxWait);
[Link]('Waiting for ' + wait + 'ms before next bet.');
return wait ;
}
function reset(){
v = '';
if (useFixedBase) {
v = baseBet;
} else {
v = getBalance() * growthRate;
v = [Link](8);
}
$[Link](v);
}
function reseed(){
charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var randomString = '';
for (var i = 0; i < 16; i++) {
var randomPoz = [Link]([Link]() * [Link]);
randomString += [Link](randomPoz, randomPoz + 1);
}
$('#next_client_seed').val(randomString);
}
function startGame(){
stopped = false;
reseed();
[Link]('Game started!');
initialBalance = getBalance();
beforeSeqBalance = getBalance();
reset();
$[Link]('click');
}
function stopGame(){
[Link]('Game will stop soon! Let me finish.');
stopped = true;
}
// quick and dirty hack if you have very little bitcoins like 0.0000001
function deexponentize(number){
return number * 1000000;
}
function exponentize(number){
return number / 1000000;
}
function iHaveEnoughMoney(){
var balance = deexponentize(getBalance());
var current = deexponentize($[Link]());
return ((balance*2)/100) * (current*2) > stopPercentage/100;
}
function stopBeforeRedirect(){
var minutes = parseInt($('title').text());
if( minutes < stopBefore )
{
[Link]('Approaching redirect! Stop the game so we don\'t get redirected
while loosing.');
stopGame();
return true;
}
return false;
}
function nextClick() {
setTimeout(function(){
$[Link]('click');
}, getRandomWait());
}
function nextBet(won) {
if (!won) {
hiSide = !hiSide;
}
if (hiSide) {
$btn = $hiButton;
} else {
$btn = $loButton;
}
// $btn = $hiButton;
nextClick();
}
function getPL(){
return getBalance() - initialBalance;
}
function logPL() {
[Link]('P/L for this session: ' + getPL().toFixed(8) + ' BTC');
}
var modifiedEvent = "DOMSubtreeModified";
// Unbind old shit
$[Link]();
$[Link]();
// Loser
$[Link](modifiedEvent,function(event){
if( $([Link]).is(':contains("lose")') )
{
logPL();
multiply();
nextBet(false);
}
});
// Winner
$[Link](modifiedEvent,function(event){
if( $([Link]).is(':contains("win")') )
{
logPL();
if( stopBeforeRedirect() )
{
return;
}
if( iHaveEnoughMoney() )
{
reset();
if( stopped )
{
stopped = false;
return false;
}
}
else
{
[Link]('You WON! Betting again');
}
profit = getBalance() - beforeSeqBalance;
beforeSeqBalance = getBalance();
[Link]('You earned ' + (profit * 100000000) + ' satoshis this round!');
nextBet(true);
}
});
startGame();