-
-
Save RHavar/49f3403c440ecde5a34d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseBet = 10; // in Bits | |
var cashout; 20 | |
var mult; | |
// set one of mult or cashout, and the other will be calculated for you: | |
// mult = 1.12; | |
cashout = 1.5; | |
// what percentage to increase the net profit by each time we lose a bet; 0 for pure martingale | |
greed_percent = 5; | |
if (!mult) | |
mult = cashout / (cashout - 1) * (1 + greed_percent/100); | |
else if (!cashout) | |
cashout = mult / (mult - 1) * (1 + greed_percent/100); | |
var satoshis = baseBet * 100; | |
var crash = Math.floor(cashout*100 + 1e-6); | |
var currentBet = false; | |
engine.on('game_starting', function () { | |
if (currentBet && engine.lastGameWasLost()) | |
currentBet *= mult; | |
else | |
currentBet = satoshis; | |
if (currentBet < engine.getBalance()) { | |
console.log('place bet of', Math.round(currentBet/100), 'at', crash/100); | |
engine.placeBet(Math.round(currentBet/100)*100, crash, false); | |
} | |
else { | |
engine.stop(); | |
console.log('You ran out of bits :('); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment