-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path1.35xChasingSmart.js
102 lines (64 loc) · 1.97 KB
/
1.35xChasingSmart.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//////////////////////////////////
// MartinG's Martingale
// v 2.0.3
/*////////////////////////////////
MartinG's Martingale, is just a classic martingale strategy that makes it
really easy to configure.
Just tell it what streak protection you want (maxLossStreakPerRound) and how
much you can afford to loose if there is a streak (costOfLoosingRound).
Also you can set the desired cashout.
There is no need to calculate the base bet or multiplier.
NOTE: Base Bet will be printed in console. If your base bet is less than 1 bit,
that probably means your costOfLoosingRound is too low or your
maxLossStreakPerRound is too high.
*//////////////////////////////////
var cashout = 1.35;
var maxLossStreakPerRound = 3;
var costOfLoosingRound = 500;
/////////////////////////////////
// No need to change anything below this line
/////////////////////////////////
var baseBet = 1;
var p = baseBet * (cashout - 1);
var losses = 0;
var lostBits = 0;
var nextBet = baseBet;
function loose(_lostBits, _nextBet, _losses) {
if(_losses >= maxLossStreakPerRound) {
return _lostBits;
} else {
_lostBits = _lostBits + _nextBet + p;
_nextBet = (_lostBits + p) / (cashout - 1);
return loose(_lostBits, _nextBet, _losses + 1);
}
}
baseBet = costOfLoosingRound/loose(0,baseBet,0);
p = baseBet * (cashout - 1);
nextBet = baseBet;
console.log("Base Bet: " + baseBet);
var playing = false;
engine.on('game_starting', function(info) {
engine.placeBet(Math.floor(nextBet)*100, Math.round(cashout * 100));
playing = true;
});
engine.on('game_crash', function(data) {
if(!playing) {
return;
}
playing = false;
if(engine.lastGamePlay() == 'LOST') {
losses = losses + 1;
lostBits = lostBits + nextBet + p;
if(losses >= maxLossStreakPerRound) {
losses = 0;
lostBits = 0;
nextBet = baseBet;
} else {
nextBet = (lostBits + p) / (cashout - 1);
}
} else {
losses = 0;
lostBits = 0;
nextBet = baseBet;
}
});