/*
Commands:
start() - Start the Martingale Bot
stopNow() - Stop the Martingale Bot
stopAfterWin() - Stop the Martingale Bot After Winning
*/
//Settings
var initialBet = "0.0000005";//CHANGE THIS TO YOUR START BET LEAVE EVERYTHING ELSE ALONE
var chanceToWin = "49.5";
//Your don't need to change anything below here
var payoutMultiplier;
var martingaleMultiplier;
var nextBet;
var bStopNow = false;
var bStopAfterWin = false;
function start() {
payoutMultiplier = 99/parseFloat(chanceToWin);
martingaleMultiplier = payoutMultiplier/(payoutMultiplier-1);
nextBet = parseFloat(initialBet);
roll();
}
function stopNow() {
bStopNow = true;
}
function stopAfterWin() {
bStopAfterWin = true;
}
function roll() {
var hi_lo = Math.round(Math.random());
if (hi_lo == 0)
hi_lo = 'hi';
else
hi_lo = 'hi';
socket.emit("bet", csrf, { chance: chanceToWin, bet: nextBet.toFixed(8), which: hi_lo });
}
socket.on("wins", function (data) {
if (bStopNow || bStopAfterWin)
{
bStopNow = false;
bStopAfterWin = false;
return;
}
nextBet = parseFloat(initialBet);
roll();
});
socket.on("losses", function (data) {
if (bStopNow)
{
bStopNow = false;
return;
}
nextBet = nextBet * martingaleMultiplier;
roll();
});
socket.on("jderror", function (data) {
roll();
});