Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- settings: { type: 'noop', label: 'Wager & Payout Settings' },
- wager: { value: 77700, type: 'balance', label: 'wager' },
- payout: { value: 1.17, type: 'multiplier', label: 'payout' },
- increments: { value: 100000, type: 'balance', label: 'add each time for recover' },
- maxbet: { value: 1277700, type: 'balance', label: 'max bet' },
- stopLossWarning: { type: 'noop', label: 'Stop Loss Settings' },
- stopOnHighBalance: { value: 100000000, type: 'balance', label: 'Stop if BR above' },
- stopOnLowBalance: { value: 0.1, type: 'multiplier', label: 'Stop if BR below X' },
- warning1: { type: 'noop', label: 'Pauses bets if X consecutive busts happens' },
- pauseOnXlosses: { value: 3, type: 'multiplier', label: 'Pause after X losses' },
- warning2: { type: 'noop', label: 'Resume betting after X consecutive games above X' },
- resumeOnXGames: { value: 3, type: 'multiplier', label: 'Resume after X rounds' },
- resumeOnXGamesAboveMP: { value: 1.17, type: 'multiplier', label: 'above X payout' },
- };
- var currentBet = config.wager.value;
- let peakBalance = userInfo.balance;
- let lastWager = 0;
- let lastMP = 0;
- let isRecovering = false;
- let isPaused = false;
- let losses = 0;
- let skips = 0;
- engine.bet(roundBit(currentBet), config.payout.value);
- engine.on('GAME_STARTING', onGameStarted);
- engine.on('GAME_ENDED', onGameEnded);
- function onGameStarted() {
- /* if our balance is larger than stopOnHighBalance or smaller than stopOnLowBalance we don't give a shit, kill this thing */
- if ((userInfo.balance >= config.stopOnHighBalance.value) || (userInfo.balance <= config.stopOnLowBalance.value))
- return;
- /* not doing anything when we are paused */
- if (isPaused) return;
- if (isRecovering) {
- /* if we are recovering, we add 1000 to each bet */
- lastWager += config.increments.value;
- /* but we will never go beyond maxbet */
- lastWager = (lastWager > config.maxbet.value) ? config.maxbet.value : lastWager;
- /* make our bet */
- makeBet(lastWager, config.payout.value);
- } else {
- /* if we are not recovering we flatbet our base */
- makeBet(config.wager.value, config.payout.value);
- }
- }
- function onGameEnded() {
- let lastGame = engine.history.first();
- /* if we are paused and a game has ended, we skipped */
- /* our condition to unpause is when the last n games of history had a bust higher than configured */
- if (isPaused) {
- /* see how many of the previous games were above the configured multiplier */
- let nGames = engine.history.slice(0, config.resumeOnXGames.value).filter(g => { return g.bust >= config.resumeOnXGamesAboveMP.value }).length;
- /* if they all were, we can unpause */
- if (nGames == config.resumeOnXGames.value) {
- isPaused = false;
- losses = 0; /* reset our counter so we don't pause again after 1 loss */
- log('AutoPause disabled. Resuming betting')
- }
- }
- /* if we did not play, we have nothing else to take care of */
- if (!lastGame.wager) return;
- /* if we won the game and cashed out */
- if (lastGame.cashedAt) {
- losses = 0; /* reset our losses counter */
- /* display our win in log */
- let profit = Math.round((lastGame.wager * lastGame.cashedAt - lastGame.wager) / 100)
- log('we won', profit, 'bits');
- } else {
- /* we lost, lets count our losses */
- losses++;
- /* if we lost equal or greater amounts than pauseOnXlosses we want to pause */
- if (losses >= config.pauseOnXlosses.value) {
- isPaused = true;
- log('we lost', losses, 'times. Pause...');
- }
- else {
- isPaused = false;
- log('we lost', losses, 'times.');
- }
- }
- /* check if we recovered or are at peak balance */
- if (userInfo.balance >= peakBalance) {
- peakBalance = userInfo.balance;
- isRecovering = false;
- } else isRecovering = true;
- }
- function makeBet(wager, payout) {
- lastWager = wager;
- lastMP = payout;
- engine.bet(wager, payout);
- log("placing a bet for", wager / 100, "on", payout);
- }
- function roundBit(bet) {
- return Math.round(bet / 100) * 100;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement