aşağıdaki kodda target i takip ederken yüzde ile takip ediyor. misal takip ettiği 100 koyuyorsa oda yüzdesini seçiyor yüzde 1 derse 1 koyar.

yapmak istediğim ise, misal ben diyorum ki hedef 5000 koymadan takip etmesin.

bunu nasıl yapabiliriz.


var config = {
  target: { value: '', type: 'text', label: 'User to follow' },
  maxBet: { value: 1e8, type: 'balance', label: 'Max Bet' },
  percent: { value: 10, type: 'text', label: 'Percentage' }
};


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.');
    }

    const bettableBalance = Math.floor(userInfo.balance / 100) * 100;
    const wager = Math.min(bettableBalance, (bet.wager / 100) * config.percent.value, config.maxBet.value);

    log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.', config.percent.value + '% of', bet.wager / 100, 'bit(s) is', Math.floor(wager / 100), 'bit(s).');

        if (engine.gameState != 'GAME_STARTING') {
      // do not queue the bet if the current game is no longer accepting bets
      return;
    }

    engine.bet(Math.floor(wager / 100) * 100, 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();
    }
  }
})