Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var config = {
- target: { value: '-', type: 'text', label: 'User to follow' },
- maxBet: { value: 1e8, type: 'balance', label: 'Max Bet' },
- stopMin: { value: 1e8, type: 'balance', label: 'Stop if BR is below'},
- stopMax: { value: 1e8, type: 'balance', label: 'Stop if BR is above'},
- betScaleFactor: { value: '1.0', type: 'text', label: 'Bet scale factor' }
- };
- engine.on('BET_PLACED', bet => {
- if (bet.uname.toLowerCase() === config.target.value.toLowerCase()) {
- if (userInfo.balance < 100) {
- stop('Your balance is too low to bet.');
- }
- log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.');
- const bettableBalance = Math.floor(userInfo.balance / 100) * 100;
- const wager = Math.min(bettableBalance, Math.max(100, Math.floor(bet.wager * Number(config.betScaleFactor.value) / 100) * 100), config.maxBet.value);
- if (engine.gameState != 'GAME_STARTING') {
- // do not queue the bet if the current game is no longer accepting bets
- return;
- }
- engine.bet(wager, bet.payout); // aim at target's payout
- }
- });
- engine.on('CASHED_OUT', cashOut => {
- if (cashOut.uname.toLowerCase() === config.target.value.toLowerCase()) {
- log('Spotted', cashOut.uname, 'cashing out at', cashOut.cashedAt + 'x.');
- if (engine.currentlyPlaying()) {
- engine.cashOut();
- }
- }
- if (userInfo.balance > config.stopMax.value || userInfo.balance < config.stopMin.value)
- {
- stop(`Stopping script due to balance being either too high or too low...`);
- engine.removeListener('GAME_STARTING', onGameStarting);
- engine.removeListener('GAME_ENDED', onGameEnded);
- return;
- stopBet = true;
- //stop('Insufficient balance to make the bet')
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement