SHOW:
|
|
- or go back to the newest paste.
| 1 | // Reverse Martingale v 1.20 | |
| 2 | // By: MartinG | |
| 3 | ||
| 4 | /******************/ | |
| 5 | ||
| 6 | var baseBet = 25; | |
| 7 | var cashout = 1.38; | |
| 8 | var returnToBaseAfterWinStreak = 10; | |
| 9 | ||
| 10 | /******************/ | |
| 11 | ||
| 12 | baseBet = Math.round(baseBet) * 100; | |
| 13 | cashout = Math.round(cashout * 100); | |
| 14 | ||
| 15 | var currentGameData; | |
| 16 | var wonLast = false; | |
| 17 | var profitLast = 0; | |
| 18 | var winStreak = 0; | |
| 19 | var currentBet = baseBet; | |
| 20 | ||
| 21 | engine.on('game_started', function(data) {
| |
| 22 | currentGameData = data; | |
| 23 | }); | |
| 24 | ||
| 25 | engine.on('game_starting', function(info) {
| |
| 26 | if(wonLast) winStreak++; | |
| 27 | ||
| 28 | if(!wonLast || winStreak >= returnToBaseAfterWinStreak) {
| |
| 29 | ||
| 30 | winStreak = 0; | |
| 31 | currentBet = baseBet + (wonLast ? 0 : profitLast); | |
| 32 | ||
| 33 | } else {
| |
| 34 | ||
| 35 | currentBet += profitLast; | |
| 36 | ||
| 37 | } | |
| 38 | ||
| 39 | console.log("profitLast", profitLast);
| |
| 40 | ||
| 41 | engine.placeBet(Math.round((currentBet)/100)*100, cashout); | |
| 42 | }); | |
| 43 | ||
| 44 | engine.on('game_crash', function(data) {
| |
| 45 | ||
| 46 | profitLast = 0; | |
| 47 | ||
| 48 | if (!currentGameData || !currentGameData.hasOwnProperty(engine.getUsername())) return; | |
| 49 | wonLast = engine.lastGamePlay() != 'LOST'; | |
| 50 | ||
| 51 | var gd = currentGameData[engine.getUsername()]; | |
| 52 | ||
| 53 | if(gd.hasOwnProperty('bonus')) {
| |
| 54 | profitLast += gd.bonus; | |
| 55 | } | |
| 56 | ||
| 57 | if(wonLast && gd.hasOwnProperty('stopped_at')) {
| |
| 58 | var s = gd.stopped_at/100 - 1; | |
| 59 | var b = gd.bet; | |
| 60 | profitLast += s * b; | |
| 61 | } | |
| 62 | ||
| 63 | }); |