disorderlyNY Posted July 1, 2020 Share Posted July 1, 2020 I'm trying to combine the functions of the regular Martingale script and the Payout Martingale script. So what I want to achieve On Lose, is to multiply the bet by a set amount AND increase the payout by a set amount. On win it would reset both 'base bet' and 'base payout'. I've combine the 2 scripts already but it is not functioning properly. Currently, on Win, the log is reporting both a "Win" and "Loss" and increasing the bet and payout. Also currently, On Lose, the log does not report anything and continues the existing bet and payout. The current combined script and and screenshot of the log is attached. Does anyone know how to fix this and make it function properly? Willing to tip anyone who can find the solution!!! var config = { baseBet: { label: 'base bet', value: currency.minAmount * 1.2, type: 'number' }, basePayout: { label: 'base payout', value: 2, type: 'number' }, stop: { label: 'stop if bet >', value: 1e8, type: 'number' }, onLoseTitle: { label: 'On Lose', type: 'title' }, onLoss: { label: '', value: 'increase', type: 'radio', options: [ { value: 'reset', label: 'Return to base bet' }, { value: 'increase', label: 'Increase bet by (loss multiplier)' }, { value: 'increase', label: 'Increase payout by (loss payout)' } ] }, lossMultiplier: { label: 'loss multiplier', value: 2, type: 'number' }, lossAdd: { label: 'loss payout +/-', value: 1, type: 'number' }, onWinTitle: { label: 'On Win', type: 'title' }, onWin: { label: '', value: 'reset', type: 'radio', options: [ { value: 'reset', label: 'Return to base bet' }, { value: 'increase', label: 'Increase bet and payout' }, { value: 'increase', label: 'Increase payout by (win payout)' } ] }, winMultiplier: { label: 'win multiplier', value: 2, type: 'number' }, winAdd: { label: 'win payout +/-', value: 1, type: 'number' }, } function main () { var currentBet = config.baseBet.value; var currentPayout = config.basePayout.value; engine.on('GAME_STARTING', function () { engine.bet(currentBet, currentPayout); }) engine.on('GAME_ENDED', function () { var history = engine.getHistory() var lastGame = history[0] // If we wagered, it means we played if (!lastGame.wager) { return; } // we won.. if (lastGame.cashedAt) { if (config.onWin.value === 'reset') { currentBet = config.baseBet.value; } else { currentBet *= config.winMultiplier.value; } if (config.onWin.value === 'reset') { currentPayout = config.basePayout.value; } else { currentPayout += config.winAdd.value; } log.success('We won, so next bet will be ' + currentBet + ' ' + currency.currencyName + ' at payout ' + currentPayout + ' x'); if (config.onLoss.value === 'reset') { currentBet = config.baseBet.value; } else { currentBet *= config.lossMultiplier.value; } if (config.onLoss.value === 'reset') { currentPayout = config.basePayout.value; } else { currentPayout += config.lossAdd.value; } log.error('We lost, so next bet will be ' + currentBet + ' ' + currency.currencyName + ' at payout ' + currentPayout + ' x'); } if (currentBet > config.stop.value) { log.error('Was about to bet' + currentBet + 'which triggers the stop'); engine.stop(); } }) } The screenshot of the log below is only 3 bets. First is the initial bet which won. The log says the bet both won and lost. The second bet was increased even though it should have stayed. The second bet lost, but nothing was changed or mentioned in the log. Instead, the third bet was placed at the existing bet and payout which makes so sense to me, because it should have either reset or increased. Please help!!!! Link to comment Share on other sites More sharing options...
][NT3L][G3NC][ Posted July 4, 2020 Share Posted July 4, 2020 So Im Assuming lastGame.cashedAt = True only When You WIn? if (lastGame.cashedAt) { if (config.onWin.value === 'reset') { currentBet = config.baseBet.value; } else { currentBet *= config.winMultiplier.value; } if (config.onWin.value === 'reset') { currentPayout = config.basePayout.value; } else { currentPayout += config.winAdd.value; } log.success('We won, so next bet will be ' + currentBet + ' ' + currency.currencyName + ' at payout ' + currentPayout + ' x'); } else { if (config.onLoss.value === 'reset') { currentBet = config.baseBet.value; } else { currentBet *= config.lossMultiplier.value; } if (config.onLoss.value === 'reset') { currentPayout = config.basePayout.value; } else { currentPayout += config.lossAdd.value; } log.error('We lost, so next bet will be ' + currentBet + ' ' + currency.currencyName + ' at payout ' + currentPayout + ' x'); } Link to comment Share on other sites More sharing options...
][NT3L][G3NC][ Posted July 4, 2020 Share Posted July 4, 2020 Basically What Was Wrong // Your Code Was LIke THis if(WIN) { winCode // If Won Then Execute WinCode lossCode // Then Also Execute Loss Code } // THis Should Be The Fix if(WIN) { winCode // If Won Execute WinCode } else { // Else We Lost lossCode // Execute Loss Code } Link to comment Share on other sites More sharing options...
Eldon45 Posted December 29, 2021 Share Posted December 29, 2021 So, I dropped some .sav files into my Gzdoom directory the other day. I have read more details and loaded up Brutal Doom and it has worked fine ever since then (have played about half an hour of DD already), however recently when I try to load them again they crash on me. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.