Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.19 KB | None | 0 0
  1. var config = {
  2. BaseSettings: {
  3. type: 'noop',
  4. label: 'Base Bet & Payout'
  5. },
  6. wager: {
  7. value: 100,
  8. type: 'balance',
  9. label: 'Base bet'
  10. },
  11. payout: {
  12. value: 2,
  13. type: 'multiplier',
  14. label: 'Payout'
  15. },
  16. stopLossWarning: {
  17. type: 'noop',
  18. label: 'Stop Loss Settings'
  19. },
  20. stopBelow: {
  21. value: 2500000,
  22. type: 'balance',
  23. label: 'Stop if BR Below'
  24. },
  25. stopAbove: {
  26. value: 100000000,
  27. type: 'balance',
  28. label: 'Stop if BR Above'
  29. },
  30. autoPauseType: {
  31. value: 'one', type: 'radio', label: 'AutoPause Settings',
  32. options: {
  33. one: { value: 'one', type: 'noop', label: 'Go Back In After x Amount of Greens' },
  34. two: { value: 'two', type: 'noop', label: 'Go Back In After x Amount of Games' },
  35. }
  36. },
  37. warning1: {
  38. type: 'noop',
  39. label: 'Pauses bets if x consecutive busts happens'
  40. },
  41. lossCounterStop: {
  42. value: 5,
  43. type: 'text',
  44. label: 'AutoStop After:'
  45. },
  46. warning2: {
  47. type: 'noop',
  48. label: 'Resumes betting after x consecutive greens'
  49. },
  50. winCounterGo: {
  51. value: 2,
  52. type: 'text',
  53. label: 'Resume After:'
  54. },
  55.  
  56. };
  57.  
  58. let wantedProfitInBits = config.wager.value / 100;
  59. let netProfit = 0;
  60. let baseList = [];
  61. let currentGamesPlayed = 0;
  62. let maxBet = 0;
  63. let balanceNeeded = 0;
  64. let wins = 0;
  65. let loses = 0;
  66. let currentlyPlaying = true;
  67. let SPLIT_INTO = 3;
  68. var MAX_LOSE = 0;
  69. var SESSION_NET_PROFIT = 0;
  70. var SESSION_MAX_BALANCE_NEEDED = 0;
  71. var ALL_GAMES = [];
  72. var SESSION_TIMES_ENTERED = 0;
  73. addLast50();
  74. var SMALL_SESSION_NET_PROFIT = 0;
  75. var lossCounter = 0;
  76. var autoStop = 0;
  77. var winCounter = 0;
  78. var sessionBR = userInfo.balance
  79.  
  80.  
  81.  
  82. function addLast50() {
  83. var LATEST_50_GAMES = engine.history.toArray();
  84. // logTime(`LATEST_50 length ${LATEST_50_GAMES.length}`)
  85. for (let i = 0; i <= LATEST_50_GAMES.length - 1; i++) {
  86. ALL_GAMES.unshift(LATEST_50_GAMES[i].bust);
  87. }
  88. ALL_GAMES.push(engine.history.first().bust)
  89. for (var i = 0; i < ALL_GAMES.length - 1; i++) {
  90. // logTime(`id ${i} ${ALL_GAMES[i]}`);
  91. }
  92. }
  93.  
  94.  
  95.  
  96. initScript();
  97.  
  98.  
  99. function getCurrentBetLightGuide() {
  100. let currentMultiplier = 0;
  101. let currentBet = null;
  102. if (netProfit >= 0 && currentGamesPlayed > 0) {
  103. return currentBet;
  104. }
  105. if (baseList.length >= 2) {
  106. currentMultiplier = baseList[0] + baseList[baseList.length - 1];
  107. currentBet = (currentMultiplier * config.wager.value);
  108. } else if (baseList.length === 1) {
  109. currentMultiplier = baseList[0];
  110. currentBet = (currentMultiplier * config.wager.value) * 2;
  111. } else {
  112. currentMultiplier = null;
  113. }
  114. return currentBet;
  115. }
  116.  
  117.  
  118. logTime(`AutoPause Information:`);
  119. logTime(`Pause Betting After: ` + config.lossCounterStop.value + ' Consecutive Busts.');
  120. logTime(' Resume Betting After: ' + config.winCounterGo.value + ' Consecutive Games At ' + config.payout.value + '.0 Or Higher ');
  121. logTime('Stop script if balance goes below: ' + (config.stopBelow.value)/100 + ' bits, Or if balance goes above: ' + (config.stopAbove.value)/100 + 'bits.');
  122.  
  123.  
  124. function initScript() {
  125.  
  126. SESSION_TIMES_ENTERED += 1;
  127. baseList = [1, 2, 3];
  128. netProfit = 0;
  129. currentGamesPlayed = 0;
  130. maxBet = 0;
  131. balanceNeeded = 0;
  132. wins = 0;
  133. loses = 0;
  134. currentlyPlaying = true;
  135. SMALL_SESSION_NET_PROFIT = 0;
  136. }
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. // Try to bet immediately when script starts
  144. if (engine.gameState === "GAME_STARTING") {
  145. makeBet();
  146. }
  147.  
  148.  
  149.  
  150.  
  151. engine.on('GAME_STARTING', onGameStarted);
  152. engine.on('GAME_ENDED', onGameEnded);
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. function onGameStarted() {
  160. if (!currentlyPlaying) {
  161. initScript();
  162. }
  163. let currentBet = getCurrentBetLightGuide();
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. if (!currentBet) {
  171. currentlyPlaying = false;
  172. printEndStatus();
  173.  
  174. initScript();
  175. }
  176. makeBet();
  177. }
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187. function onGameEnded() {
  188. ALL_GAMES.push(engine.history.first().bust);
  189. let lastGame = engine.history.first();
  190.  
  191.  
  192.  
  193.  
  194. if (autoStop >= 1)
  195. {
  196.  
  197.  
  198.  
  199.  
  200.  
  201. if (lastGame.bust >= config.payout.value)
  202. {
  203. winCounter += 1;
  204. var resume = config.winCounterGo.value - winCounter;
  205. log('AutoPause: Need (' + resume + ') more consecutive games to go back in');
  206.  
  207.  
  208. if (winCounter >= config.winCounterGo.value)
  209. {
  210. log('AutoPause has been disabled. Resumming Betting');
  211. autoStop *= 0;
  212. winCounter *= 0;
  213. }
  214. }
  215. else if (lastGame.bust < config.payout.value)
  216. {
  217. winCounter *= 0;
  218. }
  219.  
  220.  
  221.  
  222. }
  223.  
  224.  
  225.  
  226. // If we wagered, it means we played
  227. if (!lastGame.wager) {
  228. return;
  229. }
  230. let lastBet = getCurrentBetLightGuide();
  231.  
  232.  
  233.  
  234.  
  235. if (lastGame.cashedAt) // **************************IF PROFIT THEN ********************
  236. {
  237. let profit = Math.round(((lastBet * config.payout.value) - lastBet) / 100);
  238. netProfit += profit;
  239. SESSION_NET_PROFIT += profit;
  240. SMALL_SESSION_NET_PROFIT += profit
  241. logTime(`Won ${profit} bits`);
  242. if (baseList.length > 1) {
  243. baseList.splice(baseList.length - 1, 1);
  244. }
  245. baseList.splice(0, 1);
  246. wins += 1;
  247. lossCounter *= 0;
  248. }
  249.  
  250.  
  251.  
  252. else // **********************IF BET BUSTS THEN THIS CODE IS EXECUTED ***********************
  253. {
  254. var lost = lastBet / 100;
  255. logTime(`BUST - ${lost} `);
  256. netProfit -= lost;
  257. SESSION_NET_PROFIT -= lost;
  258. baseList.push(lastBet / config.wager.value);
  259. loses += 1;
  260. lossCounter += 1;
  261. if (lossCounter >= config.lossCounterStop.value)
  262. {
  263. autoStop += 1;
  264. log('AutoPause Enabled -- Detected ' + config.lossCounterStop.value + ' consecutive busts.');
  265. }
  266. }
  267.  
  268.  
  269. if(userInfo.balance > config.stopAbove.value || userInfo.balance < config.stopBelow.value)
  270. {
  271. stop('Stopping script due to balance being either too high or too low...');
  272. //stop('Insufficient balance to make the bet')
  273. }
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281. currentGamesPlayed += 1;
  282. // logTime(`Net profit: ${netProfit} Current bet: ${getCurrentBetLightGuide() / 100}`);
  283. let currentBalanceNeeded = netProfit + ((getCurrentBetLightGuide() / 100) * -1);
  284. if (currentBalanceNeeded < balanceNeeded) {
  285. balanceNeeded = currentBalanceNeeded;
  286. }
  287.  
  288. if (currentBalanceNeeded < SESSION_MAX_BALANCE_NEEDED) {
  289. SESSION_MAX_BALANCE_NEEDED = currentBalanceNeeded;
  290. }
  291.  
  292. logTime('Net profit: ' + netProfit + ' bits.');
  293. }
  294.  
  295.  
  296.  
  297.  
  298.  
  299. function printEndStatus() {
  300. logTime(`Played: ` + currentGamesPlayed + ' Net profit: ' + netProfit + ' bits. Balance needed: ' + balanceNeeded * -1 + ' bits Max bet: ' + maxBet / 100 + ' bits. Wins: ' + (wins / (wins + loses) * 100) + ' % Loses: ' + (loses / (wins + loses) * 100) + ' %');
  301. logTime(`SESSION NET PROFIT ${SESSION_NET_PROFIT} bits');
  302. logTime('SESSION TIMES ENTERED ${SESSION_TIMES_ENTERED}`);
  303. }
  304.  
  305.  
  306.  
  307.  
  308.  
  309. function makeBet()
  310. {
  311. if (autoStop >= 1)
  312. {
  313. log('Skipping Bet...');
  314. }
  315. else{
  316. let currentBet = getCurrentBetLightGuide();
  317. if (!currentBet) {
  318.  
  319. return;
  320. }
  321. engine.bet(currentBet, config.payout.value);
  322. if (currentBet > maxBet) {
  323. maxBet = currentBet;
  324. }
  325. logTime('Betting ' + Math.round(currentBet / 100) + ' bits at ' + config.payout.value + 'x ');
  326. }
  327.  
  328. }
  329.  
  330.  
  331.  
  332.  
  333.  
  334. function logTime(msg) {
  335. let today = new Date();
  336. let calendarDate = ``;
  337. let now = ``;
  338. log(`${now} ${msg}`);
  339. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement