View difference between Paste ID: qcGAGEJr and krDgzbwG
SHOW: | | - or go back to the newest paste.
1
// BitNielsBank bustabit script //
2
 
3
var totalEarned = 0;
4
var maxBet = 3500; // Should be equal to latest number in bets
5
var loseStreak = 0;
6
var gamesPlayed = 0;
7
 
8
// Our bets, first number is bet with 0 loses, second with 1...
9
var bets = [25, 100, 600, 2500, 3500];
10
 
11
// Our multipliers per lose, first multiplier is with 0 loses, second with 1...
12
var multiplier = [2, 1.5, 1.25, 1.25, 2];
13
 
14
// When a game starts do this
15
engine.on('game_starting', function(info) {
16
      console.log("New game started with a losestreak of "+loseStreak);
17
      console.log("We are betting "+bets[loseStreak]+" bits.")
18
 
19
20
totalEarned -= bets[loseStreak];
21
 
22
23
if(bets[loseStreak] < maxBet){
24
engine.placeBet(bets[loseStreak]*100, Math.round(multiplier[loseStreak]*100));
25
}
26
});
27
 
28
// When a game ends do this
29
engine.on('game_crash', function(data) {
30
      console.log("Game finished");
31
 
32
 
33
if(data.game_crash < multiplier[loseStreak]*100){
34
 console.log("We lost! Crashed at "+ data.game_crash/100+", we needed "+ multiplier[loseStreak]);
35
 
36
37
loseStreak += 1;
38
}else{
39
 console.log("We won! Crash at "+ data.game_crash/100+", we cashed at "+ multiplier[loseStreak]+". We won "+ multiplier[loseStreak]*bets[loseStreak] +" bits");
40
 
41
totalEarned += (multiplier[loseStreak]*bets[loseStreak])
42
 
43
loseStreak = 0;
44
}
45
 
46
console.log("Total earned: "+totalEarned);
47
});