View difference between Paste ID: 6QK9yDY7 and Q7zFfWkK
SHOW: | | - or go back to the newest paste.
1
var config = {
2
    msg:                { type: 'noop', label: '-- Created By SellingScripts --' },
3
    baseBet:            { value: 1000, type: 'balance', label: 'Base Bet' },
4
    crashTarget:        { value: 5, type: 'multiplier', label: 'Cash Out' },
5
    multiOnloss:        { value: 1.25, type: 'multiplier', label: 'Increase on Loss - First Cash Out' },
6
    playafterXgames:    { value: 10, type: 'multiplier', label: 'Only Play After X Games' },
7
    underXgames:        { value: 5, type: 'multiplier', label: 'Only Play After X Games UNDER this multiplier' },
8
    maxLosestreak1:      { value: 15, type: 'text', label: 'Number of LOSSES Before Pausing' },
9
    maxSkipAfterGreen1:  { value: 5, type: 'text', label: 'Number of GREENS Before Resuming' },
10
    secondCrashTarget:  { value: 10, type: 'multiplier', label: 'New Cash Out After Resuming' },
11
    secondMultiOnLoss1:  { value: 1.12, type: 'text', label: 'Increase on Loss - Second Cash Out' },
12
    stoploss:  { value: 20000000, type: 'text', label: 'Stop Loss if Bet is GREATER than' },
13
    stopprofit:  { value: 1000000000, type: 'text', label: 'Stop Profit if Balance is GREATER than' },
14
 
15
};
16
 
17
log('Script is running..');
18
log('Welcome! Your balance is ' + userInfo.balance / 100 + ' bits!');
19
log('Good Luck =)');
20
 
21
 
22
var stoploss = parseFloat(config.stoploss.value);
23
var stopprofit = parseFloat(config.stopprofit.value);
24
var maxLosestreak = parseFloat(config.maxLosestreak1.value);
25
var maxSkipAfterGreen = parseFloat(config.maxSkipAfterGreen1.value);
26
var secondMultiOnLoss = parseFloat(config.secondMultiOnLoss1.value);
27
 
28
 
29
 
30
 
31
var lastBet;
32
 
33
var losestreak = 0;
34
var skipAfterGreen = 0;
35
var roundCounter = 0;
36
 
37
var isLosestreak = false;
38
var isAfterGreen = false;
39
 
40
 
41
var currentBet = 0;
42
var Xgames = 0;
43
 
44
 
45
 
46
//Events to follow
47
engine.on('GAME_STARTING', ongamestart);
48
engine.on('GAME_ENDED', ongameend);
49
 
50
//Game Starting Event
51
function ongamestart() {
52
    if (currentBet/100 > stoploss) {
53
        stop("Stop Loss has been reached.");
54
    }
55
    if (userInfo.balance/100 > stopprofit) {
56
        stop("Max Profit has been reached.");
57
    }
58
    if (isAfterGreen) {
59
        engine.bet(roundBit(currentBet), config.secondCrashTarget.value);
60
        skipAfterGreen = 0;
61
        log("Betting: " + roundBit(currentBet) / 100 + " bits for " + config.secondCrashTarget.value + "x");
62
    } else {
63
        engine.bet(roundBit(currentBet), config.crashTarget.value);
64
        log("Betting: " + roundBit(currentBet) / 100 + " bits for " + config.crashTarget.value + "x");
65
    }
66
}
67
 
68
//Game Ending Event
69
function ongameend() {
70
    var lastGame = engine.history.first()
71
 
72
    // Xgames counter
73
    if (lastGame.bust < config.underXgames.value) {
74
        Xgames++;
75
    } else {
76
        Xgames = 0;
77
    }
78
 
79
    // Did we bet last round?
80
    if (lastGame.wager) {
81
        //We Won
82
        if (lastGame.cashedAt) {
83
            currentBet = 0;
84
            lastBet = 0;
85
            isAfterGreen = false;
86
            losestreak = 0;
87
            log("We won, cashed at: " + lastGame.cashedAt + "x");
88
            Xgames = 0;
89
        } else {
90
            losestreak++;
91
            log("We lost!");
92
 
93
            if (losestreak >= maxLosestreak) {
94
                if (isLosestreak === false && isAfterGreen === true) {
95
                    lastBet = currentBet * secondMultiOnLoss;
96
                } else if (isLosestreak === false) {
97
                    lastBet = currentBet * config.multiOnloss.value;
98
                }
99
                currentBet = 0;
100
                isLosestreak = true;
101
                log("We will pause. Maximum of " + maxLosestreak + " losses reached.");
102
            } else {
103
                if (isAfterGreen) {
104
                    currentBet *= secondMultiOnLoss;
105
                    isLosestreak = false;
106
                    log('We lost. Betting', roundBit(currentBet) / 100, 'next round');
107
                } else {
108
                    currentBet *= config.multiOnloss.value;
109
                    isLosestreak = false;
110
                    log('We lost. Betting', roundBit(currentBet) / 100, 'next round');
111
                }
112
            }
113
        }
114
    } else {
115
        if (isLosestreak === true && roundCounter !== 0) {
116
            if (lastGame.bust >= 2) {
117
                skipAfterGreen++;
118
                losestreak = 0;
119
                isAfterGreen = false;
120
                log('The red streak ended, waiting for ' + maxSkipAfterGreen + ' greens before betting. ' + skipAfterGreen);
121
                if (skipAfterGreen >= maxSkipAfterGreen) {
122
                    currentBet = lastBet;
123
                    losestreak = 0;
124
                    isAfterGreen = true;
125
                    isLosestreak = false;
126
                    log("We will resume. There has been " + maxSkipAfterGreen + " greens.");
127
                }
128
            }
129
        } else {
130
            if (Xgames >= config.playafterXgames.value) {
131
                currentBet = config.baseBet.value;
132
                log('X Games target of', config.playafterXgames.value, 'has been met. Next round we will bet. ');
133
                isAfterGreen = false;
134
                losestreak = 0;
135
            } else {
136
                currentBet = 0;
137
                log('X Games count', Xgames);
138
                losestreak = 0;
139
            }
140
        }
141
    }
142
    roundCounter++;
143
}
144
 
145
//Math Rounding Function
146
function roundBit(bet) {
147
    return Math.round(bet / 100) * 100;
148
}