I've edited the script a bit more. There are a few more changes, so I'll just post the entire code below for you to use if you want. It essentially does the exact same thing as above (pick a target, and bet a percentage of their bet rounded down to the nearest whole bit), but it gives you an input box under the "User to follow" and "Max Bet" input boxes where you input the percentage you want to use. Stops you having to go in to the script and edit it every time you want to adjust your percentage. Note that you are now picking the percentage you want, not the fraction. So if you want 2%, just type 2, rather than typing 50 as you had to do above. Should also work with decimal points if you want to go <1%. I've also updated the log so it tells you exactly how much you are betting each time. Enjoy.
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();
}
}
})