Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. var config = {
  2. target: { value: '', type: 'text', label: 'User to follow' },
  3. maxBet: { value: 1e8, type: 'balance', label: 'Max Bet' }
  4. };
  5.  
  6.  
  7. engine.on('BET_PLACED', bet => {
  8. if (bet.uname.toLowerCase() === config.target.value.toLowerCase()) {
  9. if (userInfo.balance < 100) {
  10. stop('Your balance is too low to bet.');
  11. }
  12.  
  13. log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.');
  14.  
  15. const bettableBalance = Math.floor(userInfo.balance / 100) * 100;
  16. const wager = Math.min(bettableBalance, Math.ceil(bet.wager / 10000)*100, config.maxBet.value);
  17.  
  18. if (engine.gameState != 'GAME_STARTING') {
  19. // do not queue the bet if the current game is no longer accepting bets
  20. return;
  21. }
  22.  
  23. engine.bet(wager, bet.payout); // aim at target's payout
  24. }
  25. });
  26.  
  27. engine.on('CASHED_OUT', cashOut => {
  28. if (cashOut.uname.toLowerCase() === config.target.value.toLowerCase()) {
  29. log('Spotted', cashOut.uname, 'cashing out at', cashOut.cashedAt + 'x.');
  30.  
  31. if (engine.currentlyPlaying()) {
  32. engine.cashOut();
  33. }
  34. }
  35. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement