Sunteți pe pagina 1din 3

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){
$payout.val(val);
}
function getBalance(){
return parseFloat($bal.text());
}
function multiply(){
var current = $stake.val();
var multiply = (current * multiplier);
multiply = multiply.toFixed(8);
stake = multiply;
$stake.val(multiply);
}
function randomIntFromInterval(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}
function getRandomWait(){
var wait = randomIntFromInterval(50, maxWait);
console.log('Waiting for ' + wait + 'ms before next bet.');
return wait ;
}
function reset(){
v = '';
if (useFixedBase) {
v = baseBet;
} else {
v = getBalance() * growthRate;
v = v.toFixed(8);
}
$stake.val(v);
}
function reseed(){
charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var randomString = '';
for (var i = 0; i < 16; i++) {
var randomPoz = Math.floor(Math.random() * charSet.length);
randomString += charSet.substring(randomPoz, randomPoz + 1);
}
$('#next_client_seed').val(randomString);
}
function startGame(){
stopped = false;
reseed();
console.log('Game started!');
initialBalance = getBalance();
beforeSeqBalance = getBalance();
reset();
$btn.trigger('click');
}
function stopGame(){
console.log('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($stake.val());
return ((balance*2)/100) * (current*2) > stopPercentage/100;
}
function stopBeforeRedirect(){
var minutes = parseInt($('title').text());
if( minutes < stopBefore )
{
console.log('Approaching redirect! Stop the game so we don\'t get redirected
while loosing.');
stopGame();
return true;
}
return false;
}
function nextClick() {
setTimeout(function(){
$btn.trigger('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() {
console.log('P/L for this session: ' + getPL().toFixed(8) + ' BTC');
}

var modifiedEvent = "DOMSubtreeModified";


// Unbind old shit
$lose.unbind();
$win.unbind();
// Loser
$lose.bind(modifiedEvent,function(event){
if( $(event.currentTarget).is(':contains("lose")') )
{
logPL();

multiply();
nextBet(false);
}
});
// Winner
$win.bind(modifiedEvent,function(event){
if( $(event.currentTarget).is(':contains("win")') )
{
logPL();
if( stopBeforeRedirect() )
{
return;
}
if( iHaveEnoughMoney() )
{
reset();
if( stopped )
{
stopped = false;
return false;
}
}
else
{
console.log('You WON! Betting again');
}
profit = getBalance() - beforeSeqBalance;
beforeSeqBalance = getBalance();
console.log('You earned ' + (profit * 100000000) + ' satoshis this round!');
nextBet(true);
}
});
startGame();

S-ar putea să vă placă și