Guest User

Ostatni kolor

a guest
Mar 5th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. // CONFIG
  2. var initialBetAmount = 1;
  3. var safety = 1;
  4. //1=0-49%
  5. //2=50-74%-1draw
  6. //3=75-86%-2draws
  7.  
  8.  
  9. var selection = 'lastcolor';
  10. function tick(){var a=getStatus();if(a!==lastStatus&&"unknown"!==a){switch(a){case"waiting":bet();break;case"rolled":rolled()}lastStatus=a,printInfo()}}
  11. function checkBalance(){return currentBetAmount*safety>getBalance()?(console.warn("BANKRUPT! Not enough balance for next bet, aborting."),clearInterval(refreshIntervalId),!1):!0}
  12. function printInfo(){var a=" \nStatus: "+lastStatus+"\nRolls played: "+currentRollNumber+"\nInitial bet amount: "+initialBetAmount+"\nCurrent bet amount: "+currentBetAmount+"\nLast roll result: "+(null===wonLastRoll()?"-":wonLastRoll()?"won":"lost");console.log(a)}
  13. function rolled(){return"anti-martingale"===mode?void antiMartingale():(martingale(),void currentRollNumber++)}
  14. function antiMartingale(){currentBetAmount=wonLastRoll()?2*currentBetAmount:initialBetAmount}
  15. function martingale(){currentBetAmount=wonLastRoll()?initialBetAmount:2*currentBetAmount}
  16. function bet(){checkBalance()&&(setBetAmount(currentBetAmount),setTimeout(placeBet,50))}
  17. function setBetAmount(a){$betAmountInput.val(a)}
  18. function placeBet(){return"lastcolor"===lastRollColor?($lastcolorButton.click(),void(lastselection="lastcolor")):($notlastcolorButton.click(),void(lastselection="notlastcolor"))}
  19. function getStatus(){var a=$statusBar.text();if(hasSubString(a,"Rolling in"))return"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"}
  20. function getBalance(){return parseInt($balance.text())}
  21. function hasSubString(a,b){return a.indexOf(b)>-1}
  22. function getColor(a){return 0==a?"green":a>=1&&7>=a?"lastcolor":"notlastcolor"}
  23. function wonLastRoll(){return lastselection?lastRollColor===lastselection:null}var currentBetAmount=initialBetAmount,currentRollNumber=1,lastStatus,lastselection,lastRollColor,$balance=$("#balance"),$betAmountInput=$("#betAmount"),$statusBar=$(".progress #banner"),$lastcolorButton=$("#panel1-7 .betButton"),$notlastcolorButton=$("#panel8-14 .betButton"),refreshIntervalId=setInterval(tick,500);
Advertisement
Add Comment
Please, Sign In to add comment