Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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: 4.99,
  13.       type: 'multiplier',
  14.       label: 'Payout'
  15.     },
  16.     stopLossWarning: {
  17.       type: 'noop',
  18.       label: 'Stop Loss Settings'
  19.     },
  20.     stopBelow: {
  21.       value: 5000000,
  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: 'two', 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: 15,
  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: 1,
  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 = 6;
  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.   var randomNumber = randomInt(153, 162)/100
  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, 4, 5, 6];
  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.   function randomInt(min,max){
  156.     return Math.floor(Math.random()*(max-min+1)+min);
  157. }
  158.  
  159.  
  160.  
  161.   function onGameStarted() {
  162.     if (!currentlyPlaying) {
  163.       initScript();
  164.     }
  165.     let currentBet = getCurrentBetLightGuide();
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.     if (!currentBet) {
  173.       currentlyPlaying = false;
  174.       printEndStatus();
  175.    
  176.       initScript();
  177.     }
  178.     makeBet();
  179.   }
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.   function onGameEnded() {
  190.     ALL_GAMES.push(engine.history.first().bust);
  191.     let lastGame = engine.history.first();
  192.    
  193.    
  194.    
  195.    
  196.     if (autoStop >= 1)
  197.     {      
  198.  
  199.  
  200.  
  201.  
  202.  
  203.     if (lastGame.bust >= config.payout.value)
  204.         {
  205.             winCounter += 1;
  206.             var resume = config.winCounterGo.value - winCounter;
  207.             log('AutoPause: Need (' + resume + ') more consecutive games to go back in');
  208.        
  209.                
  210.                 if (winCounter >= config.winCounterGo.value)
  211.                 {
  212.                     log('AutoPause has been disabled. Resumming Betting');
  213.                     autoStop *= 0;
  214.                     winCounter *= 0;
  215.                 }
  216.         }
  217.         else if (lastGame.bust < config.payout.value)
  218.         {
  219.             winCounter *= 0;
  220.         }
  221.        
  222.        
  223.    
  224.     }
  225.    
  226.    
  227.    
  228.     // If we wagered, it means we played
  229.     if (!lastGame.wager) {
  230.       return;
  231.     }
  232.     let lastBet = getCurrentBetLightGuide();
  233.  
  234.  
  235.  
  236.  
  237.     if (lastGame.cashedAt) // **************************IF PROFIT THEN ********************
  238.     {
  239.       let profit = Math.round(((lastBet * config.payout.value) - lastBet) / 100);
  240.       netProfit += profit;
  241.       SESSION_NET_PROFIT += profit;
  242.       SMALL_SESSION_NET_PROFIT += profit
  243.       logTime(`Won ${profit} bits`);
  244.       if (baseList.length > 1) {
  245.         baseList.splice(baseList.length - 1, 1);
  246.       }
  247.       baseList.splice(0, 1);
  248.       wins += 1;
  249.       lossCounter *= 0;
  250.     }
  251.    
  252.    
  253.    
  254.     else // **********************IF BET BUSTS THEN THIS CODE IS EXECUTED ***********************
  255.     {
  256.       var lost = lastBet / 100;
  257.       logTime(`BUST - ${lost} `);
  258.       netProfit -= lost;
  259.       SESSION_NET_PROFIT -= lost;
  260.       baseList.push(lastBet / config.wager.value);
  261.       loses += 1;
  262.       lossCounter += 1;
  263.       if (lossCounter >= config.lossCounterStop.value)
  264.       {
  265.           autoStop += 1;
  266.           log('AutoPause Enabled -- Detected ' + config.lossCounterStop.value + ' consecutive busts.');
  267.       }
  268.     }
  269.  
  270.  
  271.     if(userInfo.balance > config.stopAbove.value || userInfo.balance < config.stopBelow.value)
  272.         {
  273.             stop('Stopping script due to balance being either too high or too low...');
  274.             //stop('Insufficient balance to make the bet')
  275.         }
  276.    
  277.    
  278.    
  279.    
  280.    
  281.    
  282.    
  283.     currentGamesPlayed += 1;
  284.     // logTime(`Net profit: ${netProfit} Current bet: ${getCurrentBetLightGuide() / 100}`);
  285.     let currentBalanceNeeded = netProfit + ((getCurrentBetLightGuide() / 100) * -1);
  286.     if (currentBalanceNeeded < balanceNeeded) {
  287.       balanceNeeded = currentBalanceNeeded;
  288.     }
  289.  
  290.     if (currentBalanceNeeded < SESSION_MAX_BALANCE_NEEDED) {
  291.       SESSION_MAX_BALANCE_NEEDED = currentBalanceNeeded;
  292.     }
  293.  
  294.     logTime('Net profit: ' + netProfit + ' bits.');
  295.   }
  296.  
  297.  
  298.  
  299.  
  300.  
  301.   function printEndStatus() {
  302.    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) + ' %');
  303.    logTime(`SESSION NET PROFIT ${SESSION_NET_PROFIT} bits');  
  304.   logTime('SESSION TIMES ENTERED ${SESSION_TIMES_ENTERED}`);
  305.   }
  306.  
  307.  
  308.  
  309.  
  310.  
  311.   function makeBet()
  312.   {
  313.       if (autoStop >= 1)
  314.       {
  315.           log('Skipping Bet...');
  316.       }
  317.   else{
  318.     let currentBet = getCurrentBetLightGuide();
  319.     if (!currentBet) {
  320.      
  321.       return;
  322.     }
  323.     engine.bet(currentBet, config.payout.value);
  324.     if (currentBet > maxBet) {
  325.       maxBet = currentBet;
  326.     }
  327.     logTime('Betting ' + Math.round(currentBet / 100) + ' bits at ' + config.payout.value + 'x ');
  328.   }
  329.  
  330.  }
  331.  
  332.  
  333.  
  334.  
  335.  
  336.   function logTime(msg) {
  337.     let today = new Date();
  338.     let calendarDate = ``;
  339.     let now = ``;
  340.     log(`${now} ${msg}`);
  341.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement