Hey I'm trying to create a simple script for ethercrash one that increases payout by 1 on every lose and resets upon win here is my current script it works but It increases payout by a multiplier much like martingale which I don't want.
here is my current working script need help fixing it to only add +1 to basepayout every lose
var baseBetInBits = 100; //base bet
var baseMultiplier = 2; //base multiplier
var baseBetInSatoshis = Math.round(baseBetInBits * 100);
var baseMultiplierInPercentage = Math.round(baseMultiplier * 100);
var currentBet = baseBetInSatoshis;
var currentMulti = baseMultiplierInPercentage;
var gamesLost = 0;
engine.on('game_starting', function (info) {
if (gamesLost) {
currentMulti = Math.round(currentMulti + baseMultiplierInPercentage);
currentBet = baseBetInSatoshis;
}
else {
currentBet = baseBetInSatoshis;
currentMulti = baseMultiplierInPercentage;
}
engine.placeBet(currentBet, currentMulti);
console.log(currentBet, currentMulti);
});
engine.on('game_started', function (data) {
//console.log('Game Started', data);
});
engine.on('game_crash', function (data) {
if (data.game_crash < currentMulti) {
gamesLost++;
}
else {
gamesLost = 0;
}
console.log("GamesLost: " + gamesLost);
});
engine.on('player_bet', function (data) {
//console.log('The player ', data.username, ' placed a bet. This player could be me
.')
});
engine.on('cashed_out', function (resp) {
//console.log('The player ', resp.username, ' cashed out. This could be me.');
});
engine.on('msg', function (data) {})