View difference between Paste ID: pZKs0hxm and bi5F88LK
SHOW: | | - or go back to the newest paste.
1
var config = {};
2
 
3
//For BustABit
4
//1.32x Script by SellingScripts
5
 
6
//You can change these variables:
7
var wageredBits = 5000;
8
var maxLosses = 12;
9
var risingBetPercentage = 1;
10
 
11
 
12
var baseCashout = 1.32;
13
var maxBet = 3000;
14
 
15
 
16
var currentBet;//used in determining what the current bet amount is
17
var currentCashout = baseCashout;//used in determining what the current cashout is
18
//var stopScriptOnLoss = true;//will stop the script in the event of "maxLosses" losses in a row
19
var playing = false;//will delay initial start by one game so that if script is ran between 'game_started' and 'game_crash' phase
20
//it will not prematurly increase bet if busts below "currentCashout"
21
var lossStreak = 0;//number of losses in a row
22
var userBalance = userInfo.balance/100;//the users balance
23
 
24
//used to determine if all user set variables were set to values that make sense
25
function idiotTest(){
26
    if(userBalance<wageredBits)
27
        stop("wageredBits is higher than your balance");
28
    if(maxLosses<3 || maxLosses>20)
29
        stop("use a number between 3 and 20 for max losses inclusive");
30
    if(risingBetPercentage>1 || risingBetPercentage<0)
31
        stop("risingBetPercentage must be between 0 and 1 inclusive");
32
}
33
idiotTest();
34
 
35
//calculates the base bet as determined by your maxLosses and wageredBits
36
function calcBase(wagered,limit){
37
    var base = wagered;
38
    var multiplier = 1;
39
    if(base>maxBet)
40
        base = maxBet;
41
    for(let i=0;i<limit-1;i++){
42
        base = (base*multiplier)/(multiplier+1);
43
    }
44
    if(Math.floor(base)<1)
45
        stop("Need a min of " + 1*Math.pow(5,limit-1) + " bits to run with your parameters, and you only set wageredBits to " + wageredBits);
46
    return Math.floor(base);
47
}
48
currentBet = calcBase(wageredBits,maxLosses);
49
//log("Bet " + currentBet);
50
 
51
engine.on('GAME_STARTING', function() {
52
    if(playing){
53
        log("Current balance: " + userInfo.balance + " will bet " + currentBet + " at " + currentCashout);
54
        engine.bet(currentBet*100, currentCashout);
55
    }
56
});
57
 
58
engine.on('GAME_ENDED', function() {
59
    if(!playing){
60
        playing = true;
61
        log("Game start!");
62
        return;
63
    }
64
    if(engine.history.first().bust<currentCashout){
65
        currentCashout = 2;
66
        if(lossStreak==0)
67
            currentBet *= 2;
68
        else
69
            currentBet *= 2;  
70
        lossStreak++;
71
        log("LOST: new bet is " + currentBet + " new cashout is " + currentCashout);
72
    }
73
    else{
74
        currentBet = calcBase(Math.floor(wageredBits),maxLosses);
75
        currentCashout = baseCashout;
76
        lossStreak = 0;
77
        if(risingBetPercentage!=0){
78
            wageredBits = initialWagered;
79
            var newBal = parseFloat((userInfo.balance/100-userBalance).toFixed(2));
80
            wageredBits += newBal*risingBetPercentage
81
            currentBet = calcBase(Math.floor(wageredBits),maxLosses);
82
        }
83
        log("WON: "+ "new bet is " + currentBet + " new cashout is " + currentCashout);
84
    }
85
    if(lossStreak==maxLosses){
86
        stop("Max Losses reached");
87
    }
88
});