Advertisement
E187

Bustabit - Modified Sniper

Feb 9th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  var config = {
  2.   target: { value: '-', type: 'text', label: 'User to follow' },
  3.   maxBet: { value: 1e8, type: 'balance', label: 'Max Bet' },
  4.   stopMin: { value: 1e8, type: 'balance', label: 'Stop if BR is below'},
  5.   stopMax: { value: 1e8, type: 'balance', label: 'Stop if BR is above'},
  6.   betScaleFactor: { value: '1.0', type: 'text',  label: 'Bet scale factor' }
  7. };
  8.  
  9.  
  10. engine.on('BET_PLACED', bet => {
  11.   if (bet.uname.toLowerCase() === config.target.value.toLowerCase()) {
  12.     if (userInfo.balance < 100) {
  13.       stop('Your balance is too low to bet.');
  14.     }
  15.  
  16.     log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.');
  17.  
  18.     const bettableBalance = Math.floor(userInfo.balance / 100) * 100;
  19.     const wager = Math.min(bettableBalance, Math.max(100, Math.floor(bet.wager * Number(config.betScaleFactor.value) / 100) * 100), config.maxBet.value);
  20.  
  21.     if (engine.gameState != 'GAME_STARTING') {
  22.       // do not queue the bet if the current game is no longer accepting bets
  23.       return;
  24.     }
  25.  
  26.     engine.bet(wager, bet.payout); // aim at target's payout
  27.   }
  28. });
  29.  
  30. engine.on('CASHED_OUT', cashOut => {
  31.   if (cashOut.uname.toLowerCase() === config.target.value.toLowerCase()) {
  32.     log('Spotted', cashOut.uname, 'cashing out at', cashOut.cashedAt + 'x.');
  33.  
  34.     if (engine.currentlyPlaying()) {
  35.       engine.cashOut();
  36.     }
  37.   }
  38.   if  (userInfo.balance > config.stopMax.value || userInfo.balance < config.stopMin.value)
  39.   {
  40.       stop(`Stopping script due to balance being either too high or too low...`);
  41.       engine.removeListener('GAME_STARTING', onGameStarting);
  42.       engine.removeListener('GAME_ENDED', onGameEnded);
  43.       return;
  44.       stopBet = true;
  45. //stop('Insufficient balance to make the bet')
  46.   }
  47. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement