Sorry I haven't been in here for a while. Thanks again to @Skelefor always being so helpful! You've been an invaluable resource to me while I've been learning.
And @Frmrclrripper If I'm understanding you correctly, then I think I fixed the script to work how you want it to. You DON'T want to change the equation for currentPayout. keep it at var currentPayout = ((1/chance)*99); the way I have it written, it NEEDS this equation to figure out the correct payout. Chance = 1 means there is a 1% chance to win.
Then to get a payout that starts @ 990x:
- startingChance should be set to 0.1.
-So your balance doesnt drain at the same rate, decrease the multipliers. (labeled "varix" in the script)
- New varix = (((old varix-1)/10)+1). Basically increasing at 1/10th the speed it was before. (1.25 is now 1.025, etc...)
-Increase the "losecount" parameters by 10x (190, 260).
-on lose, our chance increased by 1% everytime, so we have to lower that integer to (0.01).
So I applied all of those changes, I fixed the mistake that was pointed out by Skele and I believe this SHOULD function how you wanted. I ran it for a few mintues and it appears to be working correctly.
var config = {
baseBet: {
label: 'Base Bet',
value: currency.minAmount,
type: 'number'
},
startingChance: {
label: 'Starting Chance',
value: 0.1,
type: 'number'
},
}
var chance = config.startingChance.value;
var currentPayout = ((1/chance)*99);
var losecount = 0;
var betcount = 0;
var varix = 1.025;
var previousBet = currentBet;
var runningbalance = currency.amount;
var originalbalance = currency.amount;
var baseBet = config.baseBet.value;
var currentBet = baseBet;
function main () {
game.onBet = function () {
game.bet(currentBet, currentPayout).then(function(payout) {
runningbalance -= currentBet;
previousBet = currentBet;
betcount += (1);
if (payout > 1) {
var netwin = currentBet * currentPayout;
runningbalance += netwin;
currentBet = baseBet;
losecount = 0;
chance = 0.1;
varix = 1.025;
} else {
if (losecount >= 190) {
varix = 1.05;
}
if (losecount >= 260) {
varix = 1.066;
}
losecount += (1);
currentBet = (previousBet * varix);
chance += (0.01);
}
currentPayout = ((1/chance)*99);
if (betcount % 100 == 0) {
logSummary();
}
log.info('Betting: ' + currentBet.toFixed(7) + ' ' + ' X ' + ' ' + currentPayout.toFixed(2));
});
}
}
function logSummary() {
var netNumber = runningbalance - originalbalance;
var netPecentage = (netNumber / originalbalance) * 100;
if (originalbalance < runningbalance) {
log.success('Total Profit: ' + netNumber.toFixed(7) + '(' + netPecentage.toFixed(2) + '%)');
} else {
log.error('Total Profit: ' + netNumber.toFixed(7) + '(' + netPecentage.toFixed(2) + '%)');
}
}