0% found this document useful (0 votes)
127 views6 pages

Var Config

The document contains configuration settings for a betting strategy. It defines variables for tracking betting amounts, wins/losses, streaks, and balances. Functions calculate the next bet amount based on the configuration and betting results.

Uploaded by

tsoenami147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views6 pages

Var Config

The document contains configuration settings for a betting strategy. It defines variables for tracking betting amounts, wins/losses, streaks, and balances. Functions calculate the next bet amount based on the configuration and betting results.

Uploaded by

tsoenami147
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

var config = {

betPercentage: {
label: 'Total percentage of bankroll to bet',
value: 0.000005,
type: 'number'
},
lossesBeforeMinBet: {
label: 'Losses before minimum bet (range)',
value: '10-20',
type: 'text'
},
payout: {
label: 'Payout',
value: 3,
type: 'number'
},
bettingPattern: {
label: 'Betting Pattern',
value: 'HLHL',
type: 'text'
},
onLoseTitle: {
label: 'On Loss',
type: 'title'
},
onLoss: {
label: '',
value: 'increase',
type: 'radio',
options: [{
value: 1.2,
label: 'Return to base bet'
}, {
value: 'increase',
label: 'Increase bet by (loss multiplier)'
}
]
},
lossMultiplier: {
label: 'Loss multiplier',
value: 1.5,
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 by (win multiplier)'
}
]
},
winMultiplier: {
label: 'Win multiplier',
value: 1.2,
type: 'number'
},
otherConditionsTitle: {
label: 'Stop Settings',
type: 'title'
},
playOrStop: {
label: 'Once loss stop reached, continue betting (Martingale counter reset)
or stop betting?',
value: 'reset',
type: 'radio',
options: [{
value: 'stop',
label: 'Stop betting'
}, {
value: 'continue',
label: 'Continue betting'
}
]
},
winGoalAmount: {
label: 'Stop once you have made this much',
value: 1000000000,
type: 'number'
},
lossStopAmount: {
label: 'Stop betting after losing this much without a win.',
value: 4,
type: 'number'
},
loggingLevel: {
label: 'Logging level',
value: 'compact',
type: 'radio',
options: [{
value: 'info',
label: 'info'
}, {
value: 'compact',
label: 'compact'
}, {
value: 'verbose',
label: 'verbose'
}
]
}
};

var stop = 0;
var lossesForBreak = 2;
var roundsToBreakFor = 2;
var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = 0;
var totalNumberOfGames = 0;
var originalbalance = 0;
var runningbalance = 0;
var consequetiveLostBets = 0;
var lossStopAmountVar = config.lossStopAmount.value;

function main() {

var originalbalance = currency.amount;


var runningbalance = currency.amount;
var currentBet = GetNewBaseBet();
console.log('Starting martingale...');
console.log('currentBet in main=' + currentBet);

engine.on('GAME_STARTING', function() {
if (stop) {
return;
}

if (numberOfRoundsToSkip > 0) {
numberOfRoundsToSkip--;
return;
}

if (lossStopAmountVar > 0 && currency.amount < originalbalance -


lossStopAmountVar) {
console.log('You have reached the loss stop amount. Stopping...');
stop = 1;
return;
}

if (config.winGoalAmount.value && currency.amount >= originalbalance +


config.winGoalAmount.value) {
console.log('You have reached the win goal. Stopping...');
stop = 1;
return;
}

console.log('currentBet in game_StartingEvent=' + currentBet);

var bet = Math.round(currentBet / 100) * 100;


engine.bet(bet, config.payout.value);

console.log('Betting', bet / 100, 'on', config.payout.value, 'x');

totalNumberOfGames++;
totalWagers += currentBet;
});

engine.on('GAME_ENDED', function() {
var lastGame = engine.history.first();

if (lastGame.wager) {
totalWagers -= lastGame.wager;
}

if (lastGame.cashedAt) {
netProfit += lastGame.wager * (lastGame.cashedAt - 1);
totalWins++;
currentStreak++;
loseStreak = 0;
if (currentStreak > longestWinStreak) {
longestWinStreak = currentStreak;
}

if (config.onWin.value === 'reset') {


currentBet = GetNewBaseBet();
} else {
currentBet *= config.winMultiplier.value;
}
} else {
totalLoses++;
loseStreak++;
currentStreak = 0;
if (loseStreak > longestLoseStreak) {
longestLoseStreak = loseStreak;
}

if (config.onLoss.value === 'reset') {


currentBet = GetNewBaseBet();
} else {
currentBet *= config.lossMultiplier.value;
}
}

runningbalance += (lastGame.cashedAt ? lastGame.wager * (lastGame.cashedAt - 1)


: -lastGame.wager);
engine.emit('TOTAL_WAGER_UPDATE');
});

engine.on('TOTAL_WAGER_UPDATE', function() {
var averageBetSize = totalWagers / totalNumberOfGames;
var averageProfit = netProfit / totalNumberOfGames;
console.log('*', engine.getBalance() / 100, '*', 'Avg Bet:',
Math.round(averageBetSize) / 100, 'Total Games:', totalNumberOfGames, 'Net
Profit:', Math.round(netProfit) / 100, 'Avg Profit:', Math.round(averageProfit) /
100, '***');
});

function GetNewBaseBet() {
var returnValue = 0;

// Get the bet percentage based on the current position in the pattern
var bettingPattern = config.bettingPattern.value.toUpperCase();
var patternIndex = totalNumberOfGames % bettingPattern.length;
var betPercentage = (bettingPattern[patternIndex] === 'H') ?
config.betPercentage.value : (config.betPercentage.value / 2);

returnValue = runningbalance * (betPercentage / 100);

console.log('runningbalance=' + runningbalance);
console.log('betPercentage=' + betPercentage);
console.log('returnValue=' + returnValue);
console.log('patternIndex=' + patternIndex);

var percentage = Math.floor(lossesForBreak / roundsToBreakFor * 100);


var lossesBeforeMinBetLow =
parseFloat(config.lossesBeforeMinBet.value.split('-')[0]);
var lossesBeforeMinBetHigh =
parseFloat(config.lossesBeforeMinBet.value.split('-')[1]);
let retValue = 0;

console.log("lossesForBreak=" + lossesForBreak);
console.log("roundsToBreakFor=" + roundsToBreakFor);

console.log("percentage=" + percentage);
console.log("lossesBeforeMinBetLow=" + lossesBeforeMinBetLow);
console.log("lossesBeforeMinBetHigh=" + lossesBeforeMinBetHigh);

if (percentage < lossesBeforeMinBetLow) {


retValue = Math.max(Math.round(returnValue), 100);
} else if (percentage >= lossesBeforeMinBetHigh) {
retValue = Math.max(Math.round(returnValue), 1000);
} else {
var minBet = 100;
var maxBet = 1000;
var difference = maxBet - minBet;
var adjustedPercentage = (percentage - lossesBeforeMinBetLow) /
(lossesBeforeMinBetHigh - lossesBeforeMinBetLow);
var adjustedBet = Math.round(adjustedPercentage * difference);
console.log("difference=" + difference);
console.log("adjustedPercentage=" + adjustedPercentage);
console.log("adjustedBet=" + adjustedBet);
retValue = minBet + adjustedBet;
}

console.log('retValue=' + retValue);
return retValue;
}

console.log('Starting martingale...');

engine.on('GAME_STARTING', function() {
console.log('Betting', currentBet / 100, 'bits...');
});

engine.on('GAME_ENDED', function() {
var lastGame = engine.history.first();
if (lastGame.cashedAt) {
console.log('You won', (lastGame.wager * (lastGame.cashedAt - 1)) / 100,
'bits!');
if (config.playOrStop.value === 'reset') {
console.log('Resetting losses...');
lossesForBreak = 0;
roundsToBreakFor = 0;
currentStreak = 0;
numberOfRoundsToSkip = 0;
}
} else {
console.log('You lost', lastGame.wager / 100, 'bits...');
lossesForBreak += lastGame.wager / 100;
roundsToBreakFor++;
if (consequetiveLostBets >= 5) {
numberOfRoundsToSkip = 2;
}
if (consequetiveLostBets >= 10) {
numberOfRoundsToSkip = 3;
}
consequetiveLostBets++;
}
});

You might also like