You are on page 1of 1

// CONFIG ////////////////

var initialBetAmount = 1;
var mode = 'martingale'; // can be 'martingale' or 'anti-martingale' () )
//////////////////////////
var selection = 'lastcolor';
function tick(){var a=getStatus();if(a!==lastStatus&&"unknown"!==a){switch(a){ca
se"waiting":bet();break;case"rolled":rolled()}lastStatus=a,printInfo()}}
function checkBalance(){return getBalance()<currentBetAmount?(console.warn("BANK
RUPT! Not enough balance for next bet, aborting."),clearInterval(refreshInterval
Id),!1):!0}
function printInfo(){var a=" \nStatus: "+lastStatus+"\nRolls played: "+currentRo
llNumber+"\nInitial bet amount: "+initialBetAmount+"\nCurrent bet amount: "+curr
entBetAmount+"\nLast roll result: "+(null===wonLastRoll()?"-":wonLastRoll()?"won
":"lost");console.log(a)}
function rolled(){return"anti-martingale"===mode?void antiMartingale():(martinga
le(),void currentRollNumber++)}
function antiMartingale(){currentBetAmount=wonLastRoll()?2*currentBetAmount:init
ialBetAmount}
function martingale(){currentBetAmount=wonLastRoll()?initialBetAmount:2*currentB
etAmount}
function bet(){checkBalance()&&(setBetAmount(currentBetAmount),setTimeout(placeB
et,50))}
function setBetAmount(a){$betAmountInput.val(a)}
function placeBet(){return"lastcolor"===lastRollColor?($lastcolorButton.click(),
void(lastselection="lastcolor")):($notlastcolorButton.click(),void(lastselection
="notlastcolor"))}
function getStatus(){var a=$statusBar.text();if(hasSubString(a,"Rolling in"))ret
urn"waiting";if(hasSubString(a,"***ROLLING***"))return"rolling";if(hasSubString(
a,"rolled")){var b=parseInt(a.split("rolled")[1]);return lastRollColor=getColor(
b),"rolled"}return"unknown"}
function getBalance(){return parseInt($balance.text())}
function hasSubString(a,b){return a.indexOf(b)>-1}
function getColor(a){return 0==a?"green":a>=1&&7>=a?"lastcolor":"notlastcolor"}
function wonLastRoll(){return lastselection?lastRollColor===lastselection:null}v
ar currentBetAmount=initialBetAmount,currentRollNumber=1,lastStatus,lastselectio
n,lastRollColor,$balance=$("#balance"),$betAmountInput=$("#betAmount"),$statusBa
r=$(".progress #banner"),$lastcolorButton=$("#panel1-7 .betButton"),$notlastcolo
rButton=$("#panel8-14 .betButton"),refreshIntervalId=setInterval(tick,500);