Jump to content

NEW Crash Script - with a shit load of options


Dinscore
 Share

Recommended Posts

On 5/4/2022 at 10:13 PM, Bigmattyboy said:

hey guys! big thanks to @Skelefor the code, so the hashdice script now has a range that you can adjust yourself in the script before it starts betting minimum. i have also taken the time to change the stop-loss variables - there is now an option for it to stop the script or reset the martingale counter instead, and i have made it so that the stop-loss value is based x amount of bets you're able to double rather than a specific number you have to calculate yourself.

please let me know what you think!

 

var config = {
    betPercentage: {
        label: 'Total percentage of bankroll to bet',
        value: 0.0015,
        type: 'number'
    },
    lossesBeforeMinBet: {
        label: 'Losses before minimum bet (range)',
        value: 2-5,
        type: 'text'
    },
    payout: {
        label: 'payout',
        value: 2,
        type: 'number'
    },

    onLoseTitle: {
        label: 'On Loss',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'increase',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (loss multiplier)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (win multiplier)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Stop Settings',
        type: 'title'
    },
    playOrStop: {
        label: 'Once loss stop reached, continue betting (Martingale counter reset) or stop betting?',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'stop',
                label: 'Stop betting'
            }, {
                value: 'continue',
                label: 'Continue betting'
            }
        ]
    },
    winGoalAmount: {
        label: 'Stop once you have made this much',
        value: currency.amount,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Stop betting after losing this many times in a row without a win',
        value: 1,
        type: 'number'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [{
                value: 'info',
                label: 'info'
            }, {
                value: 'compact',
                label: 'compact'
            }, {
                value: 'verbose',
                label: 'verbose'
            }
        ]
    }
};
// deleted input parameters
var stop = 0;
var lossesForBreak = 0;
var roundsToBreakFor = 0;

// end deleted parameters
var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = GetNewBaseBet();
var totalNumberOfGames = 0;
var originalbalance = currency.amount;
var runningbalance = currency.amount;
var consequetiveLostBets = 0;
var lossStopAmountVar = 0;

function main() {

maxLossesBeforeMinBet = GetLossesBeforeMinBet(2-3);

function GetLossesBeforeMinBet()
{
    if(config.lossesBeforeMinBet.value.toString().indexOf('-') >= 0)
    {
        var numbers = config.lossesBeforeMinBet.value.split('-');
        
        return GetRandomInt(Number.parseInt(numbers[0]), Number.parseInt(numbers[1]));
    }
    else
    {
        return Number.parseInt(config.lossesBeforeMinBet.value);
    }
}

// Returns a random integer between the min and max.
function GetRandomInt(min, max)
{
var retValue = Math.floor(Math.random() * (max - min)) + min;

log.info('Number of losses before pause is set to ' + retValue + '');
return retValue;
}

    game.onBet = function () {

        // if we are set to skip rounds then do so.
        if (numberOfRoundsToSkip > 0) {
            numberOfRoundsToSkip -= 1;
            log.info('Skipping round to relax, and the next ' + numberOfRoundsToSkip + ' rounds.');
            return;
        } else {

                if(totalNumberOfGames == 0)
                {
                    // this is so we account for the first round.
                    currentBet = GetNewBaseBet();
                }

                if(loseStreak >= maxLossesBeforeMinBet)
                {
                    if(game.history[0] >= (config.payout.value * 100))
                    {
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();
                    }
                    else
                    {
                        game.bet(currency.minAmount).then(function (payout) {
                        runningbalance -= currency.minAmount;
                        totalWagers += currency.minAmount;
                        totalNumberOfGames += 1;

                        if (payout > 1) {
                        var netwin = currency.minAmount * config.payout.value - currency.minAmount;
                        consequetiveLostBets = 0;
                        netProfit += netwin;
                        runningbalance += netwin + currency.minAmount;
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();

                        }
                        })
                        log.info('Betting minimum until a win hits');
                        return;
                    }
                }

            log.info('Placed bet for the amount of ' + currentBet);
            game.bet(currentBet, config.payout.value).then(function (payout) {
                runningbalance -= currentBet;
                totalWagers += currentBet;
                totalNumberOfGames += 1;

                if (payout > 1) {
                    var netwin = currentBet * config.payout.value - currentBet;
                    consequetiveLostBets = 0;
                    if(config.loggingLevel.value != 'compact')
                    {
                        LogMessage('We won a net profit of: ' + netwin.toFixed(8), 'success');
                    }
                    netProfit += netwin;
                    runningbalance += netwin + currentBet;

                    if (loseStreak > 0) {
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();
                    }

                    currentStreak += 1;
                    totalWins += 1;

                    LogSummary('true', currentBet);

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        currentBet *= config.winMultiplier.value;
                    }

                    LogMessage('We won, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('We lost a net amount of: ' + currentBet.toFixed(8));
                        netProfit -= currentBet;
                        loseStreak += 1;
                        currentStreak = 0;
                        totalLoses += 1;
                        consequetiveLostBets += currentBet;

                        LogSummary('false', currentBet);

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            currentBet *= config.lossMultiplier.value;
                        }
                            LogMessage('We lost, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');
                    }

                    if (currentStreak > longestWinStreak) {
                        longestWinStreak = currentStreak;
                    }
                    if (loseStreak > longestLoseStreak) {
                        longestLoseStreak = loseStreak;
                    }

                    recordStats();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // we have earned enough stop and quit.
                        log.success('The net profits ' + netProfit.toFixed(8) + ' which triggers stop the for making enough.');
                        game.stop();
                    }
                    if (config.playOrStop.value === 'stop') {
                    if (config.lossStopAmount.value != 0 && config.lossStopAmount.value <= loseStreak && currentBet > currency.minAmount){
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        game.stop();
                        }
                    }
                    if (config.playOrStop.value === 'continue') {
                    if (config.lossStopAmount.value != 0 && config.lossStopAmount.value <= loseStreak && currentBet > currency.minAmount){
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        currentBet = GetNewBaseBet();
                        }   
                    }
                    }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total wagers: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Net Profit: ' + netProfit.toFixed(8), 'info');
            LogMessage('Current win streak: ' + currentStreak, 'info');
            LogMessage('Current Lose streak: ' + loseStreak, 'info');
            LogMessage('Total wins: ' + totalWins, 'info');
            LogMessage('Total Losses: ' + totalLoses, 'info');
            LogMessage('Longest win streak: ' + longestWinStreak, 'info');
            LogMessage('Longest lose streak: ' + longestLoseStreak, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = runningbalance * (config.betPercentage.value / 100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculating base bet to ' + returnValue.toFixed(8) + ' which is ' + config.betPercentage.value + ' percent of ' + runningbalance.toFixed(8), 'info');
        }
        else
        {
            LogMessage('The recalculated bet amount ' + returnValue.toFixed(8) + ' is lower than the minimum allowed bet.  Setting bet to the minimum allowable amount of ' + currency.minAmount, 'info');
            returnValue = currency.minAmount;
        }

        return returnValue;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('Winner!! You won ' + winAmount.toFixed(8));
            } else {
                log.error('Loser!! You lost ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var losePercentage = (totalLoses / totalNumberOfGames) * 100;

            log.info('Total Games: ' + totalNumberOfGames);
            log.info('Wins: ' + totalWins + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losePercentage.toFixed(2) + ' % )');

            var netNumber = runningbalance - originalbalance;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (originalbalance < runningbalance) {
                log.success('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determines whether or not to log an event or not to make it easier later
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compact') {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'info':
                    log.info(message);
                    break;
                case 'compact':
                    break;
                case 'verbose':
                    if (isVerbose)
                        log.info(message);
                    break;
                }
            } else {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'compact':
                    log.info(message);
                    break;
                case 'info':
                    break;
                case 'verbose':
                    break;
                }
            }
        }
    }

 

$$$

Link to comment
Share on other sites

  • 4 weeks later...

I'm trying a script but I think I'm doing something wrong, can you help me?

//Bc Game Hash Dice 

var config = {
 baseBet: { label: "base bet", value:
currency.minAmount, type: "number" },
  //payout: { label: "payout", value: 2, type: "number" },
  minChange: { label: "min change", value: 1, type:
"number" },
   maxChance: { label: "max cahge", value:98, type:
"number" },
  stop: { label: "stop if bet >", value: 1e8, type: "number" },
  balanceRisk: { label: "balance risk %", value: 100, type:
"number" },
  targetProfit: {label:'Target-Profit-Stop; value: 1000,
type:'number'},
  targetBalance: {label:'Target-Balance-Stop; value:
1000, type:'number'},
  onLoseTitle: { label: "On Lose", type: "title" },
  onLoss: {
    label: "",
    value: "reset",
    type:"radio",
    options: { 
      { value: "reset", label: "Return to base bet" },
      { value: "increase", label: "lncrease bet by (loss
multiplier)" },
    },
  },
  lossStreak: { label: "loss streak", value:2, type: "number"
},
 lossMultiplier: { label: "loss multiplier", value: 2, type:
"number" },
  onWinTitle: { label: "On Win", type: "title" },
  onWin: {
    label: "",
    value: "reset",
    type: "radio",
    options: {
      { value: "reset", label: "Return to base bet" },
      { value: "increase", label: "increase bet by (win
multiplier)" },
    },
  },
  winStreak: { label: "win streak", value: 2, type: "number"
},
  winMultiplier: { label: "win multiplier", value: 2, type:
"number" },
};

var run = false;
//var bet = currency.amount/config.divider.value;
var bet = config.baseBet.value;
var basebet = bet;
var startTime = new Date();
var timestring = ";
var roundWins = 0;
var roundLosses = 0;
var chance = Math.random() * (config.maxChance.value   
- config.minChance.value) + config.minChance.value;
var currentProfitt = 0;
var currentProfittt = 0;
var curProf = 0;
var profitTotal = 0;
var balance = currency.amount;
var lastbalance = balance;

function main (){
  run = true;
  var currentBet = config.baseBet.value;
  game.onBet = function () {
        //balance = currency.amount;
        //if(balance >= lastbalance) lastbalance = balance;
        chance = Math.random() *
(config.maxChance.value - config.minChance.value) +
config.minChance.value;
    //game.bet(currentBet;
config.payout.value).then(function (payout) {
        game.bet(currentBet,
(99/chance).toFixed(4)).then(function (payout) {
                /*
          currentProfit += curProf;
          if (currentProfitt >= currentProfittt) {
        currentProfittt = currentProfittt;
                currentBet = config.baseBet.value;
                roundWins = 0;
                roundLosses = 0;
          }
          */
           
         if (payout > 1) {
                 balance += currentBet*99/chance-currentBet;
                 profitTotal += currentBet*99/chance-
currentBet;
         }else{
                 balance -= currentBet;
                 profitTotal -= currentBet;
         }
         if(balance >= lastbalance) lastbalance = balance;

       if (payout > 1) {
                 curProf = currentBet*99/chance-currentBet;
                 roundWins++;
         if (config.onWin.value === "reset") {
           currentBet = config.baseBet.value;
         } else {
           //currentBet *= config.winMultiplier.value;
                   if (roundWins % config.winStreak.value === 0)  
{
                         currentBet *= config.winMultiplier.value;
                   }
         }
         log.success(
           "We won, so next bet will be " +
             currentBet +
             " " +
             currency.currencyName
        );
      } else {
                curProf = -currentBet;
                roundLosses++;
        if (config.onLoss.value === "reset") {
          currentBet = config.baseBet.value;
        } else {
          //currentBet *= config.lossMultiplier.value;
                  if (roundLosses % config.lossStreak.value ===
0) {
                       currentBet *= config.lossMuliplier.value;
                  }
       }
       log.error(
         "We lost, so next bet will be " +
           currentBet +
           " " +
           currency.currencyName
        );
      }
         
         currentProfitt += curProf;
         if (currentProfitt >= currentProfittt) {
       currentProfittt = currentProfitt;
              currentBet = config.baseBet.value;
              roundWins = 0;
              roundLosses = 0;
         }
        
         if (currentBet < config.baseBet.value) {
                 currentBet = config.baseBet.value
         }
        
         var stoplevel = (100-
config.balanceRisk.value)*lastbalance/100;
          if(balance - currentBet < stoplevel){
         log.error(
           "Balance Risk " + currentBet + "Stop"
       );
       game.stop();
     }

     if (currentBet > config.stop.value) {
       log.error(
         "Was about to bet " + currentBet + " which triggers   
the stop"
        );
        game.stop();
      }

          if (currentBet > balance) {
        log.error(
          "Loss " + balance + "which triggers the stop"
        );
        game stop();
       }

         if (profitTotal >= config.targetProfit.value) {
                       //bet =
currency.amount/config.divider.value;
                        log.success('Target Profit ' +
(profitTotal).toFixed(8) + ' ' + currency.currencyName);
                        game.stop();
         }

         if (balance >= config.targetBalance.value) {
                       //bet =
currency.amount/config.divider.value;
                        log.success('Target Balance ' + balance + ' '
+ currency.currencyName);
                        game.stop();
         }

   ));
 );
}

setinterval(function(){
    var cur = new Date();
    var t = Math.floor((cur - startTime) / 1000);
    var hour = Math.floor(t / 3600);
    if (hour < 10) hour = '0' + Math.floor(t / 3600);
    t = t % 3600;
    var minutes = Math.floor(t / 60);
    if (minutes <10) minutes = '0' + t % 60;
        if(run) timestring = 'PlayTime ' + hour + ':' + minutes + ':' + seconds + ' ';
        else timestring = ";
},'1000'

Link to comment
Share on other sites

I wanna play with win trick

Example basebet minimum

First Start bet payout with 1.01×

Second bet : payout 1.0×

 After Third bet to : Every 1 loss Increase bet amount 100%

Bet 0.00000001 payout 1.01×

0.00000002 payout 1.0×

0.00000004 payout 2.0×

0.00000008 payout 3.0×

0.00000016 payout 4.0×

0.00000032 payout 5.0×

0.00000064 payout 6.0×

0.00000128 payout 7.0×

0.00000256 payout 8.0×

0.00000512 payout 9.0×

0.00001024 payout 10.0×

Etc.....,Please help

Edited by hwar
Link to comment
Share on other sites

  • 2 weeks later...
On 12/9/2021 at 3:19 AM, Skele said:

kind of lack luster.  I have several scripts but one of main things i did was add better logging image.png.f86dda1f2d8720599e6fee5c49f4b07a.png

I also added a feature that after two losses in a row, it will pause until it sees at least 1 win.  You sometimes miss a win on the 3rd game true.  But i no longer have to deal with 13 game losing streaks.  It will take two and then just wait it out for green pastures.  I need to change my script back to straight amounts for better, currently i use a percentage of my bank roll for the bet and then this one is the typical double it on loss. I will post it in its own message

var config = {
    betPercentage: {
        label: 'percentage of total coins to bet',
        value: 0.25,
        type: 'number'
    },
    payout: {
        label: 'payout',
        value: 2,
        type: 'number'
    },
    onLoseTitle: {
        label: 'On Lose',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'increase',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (loss multiplier)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (win multiplier)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Other Stopping Conditions',
        type: 'title'
    },    
    winGoalAmount: {
        label: 'Stop once you have made this much',
        value: currency.amount * 2,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Stop betting after losing this much without a win.',
        value: 0,
        type: 'number'
    },    
    otherConditionsTitle: {
        label: 'Experimentle Please Ignore',
        type: 'title'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [{
                value: 'info',
                label: 'info'
            }, {
                value: 'compact',
                label: 'compact'
            }, {
                value: 'verbose',
                label: 'verbose'
            }
        ]
    }
};
// deleted input parameters
var stop = 0;
var lossesForBreak = 0;
var roundsToBreakFor = 0;

// end deleted parameters
var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = GetNewBaseBet();
var totalNumberOfGames = 0;
var originalbalance = currency.amount;
var runningbalance = currency.amount;
var consequetiveLostBets = 0;
var lossStopAmountVar = config.lossStopAmount.value;

function main() {

    game.onBet = function () {

        // if we are set to skip rounds then do so.
        if (numberOfRoundsToSkip > 0) {
            numberOfRoundsToSkip -= 1;
            log.info('Skipping round to relax, and the next ' + numberOfRoundsToSkip + ' rounds.');
            return;
        } else {
        
                if(totalNumberOfGames == 0)
                {
                    // this is so we account for the first round.
                    currentBet = GetNewBaseBet();
                }
                
                if(loseStreak >= 2)
                {
                    if(game.history[0].crash > 200)
                    {
                        loseStreak = 0;
                    }
                    else
                    {
                        log.info('Not betting until current loseStreak is over.');
                        return;
                    }                    
                }

            log.info('Placed bet for the amount of ' + currentBet);
            game.bet(currentBet, config.payout.value).then(function (payout) {
                runningbalance -= currentBet;
                totalWagers += currentBet;
                totalNumberOfGames += 1;

                if (payout > 1) {
                    var netwin = currentBet * config.payout.value - currentBet;
                    consequetiveLostBets = 0;
                    if(config.loggingLevel.value != 'compact')
                    {
                        LogMessage('We won a net profit of: ' + netwin.toFixed(8), 'success');
                    }
                    netProfit += netwin;
                    runningbalance += netwin + currentBet;

                    if (loseStreak > 0) {
                        loseStreak = 0;
                    }

                    currentStreak += 1;
                    totalWins += 1;

                    LogSummary('true', currentBet);

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        currentBet *= config.winMultiplier.value;
                    }

                    LogMessage('We won, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('We lost a net amount of: ' + currentBet.toFixed(8));
                        netProfit -= currentBet;
                        loseStreak += 1;
                        currentStreak = 0;
                        totalLoses += 1;
                        consequetiveLostBets += currentBet;

                        LogSummary('false', currentBet);

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            currentBet *= config.lossMultiplier.value;
                        }
                            LogMessage('We lost, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');            
                    }

                    if (currentStreak > longestWinStreak) {
                        longestWinStreak = currentStreak;
                    }
                    if (loseStreak > longestLoseStreak) {
                        longestLoseStreak = loseStreak;
                    }

                    recordStats();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // we have earned enough stop and quit.
                        log.success('The net profits ' + netProfit.toFixed(8) + ' which triggers stop the for making enough.');
                        game.stop();
                    }
                    if (lossStopAmountVar != 0 && consequetiveLostBets > (lossStopAmountVar)) {
                        // the point of this is to limit the bleed so you don't loose too much.
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        game.stop();
                    }
                }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total wagers: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Net Profit: ' + netProfit.toFixed(8), 'info');
            LogMessage('Current win streak: ' + currentStreak, 'info');
            LogMessage('Current Lose streak: ' + loseStreak, 'info');
            LogMessage('Total wins: ' + totalWins, 'info');
            LogMessage('Total Losses: ' + totalLoses, 'info');
            LogMessage('Longest win streak: ' + longestWinStreak, 'info');
            LogMessage('Longest lose streak: ' + longestLoseStreak, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = runningbalance * (config.betPercentage.value / 100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculating base bet to ' + returnValue.toFixed(8) + ' which is ' + config.betPercentage.value + ' percent of ' + runningbalance.toFixed(8), 'info');
        }
        else
        {
            LogMessage('The recalculated bet amount ' + returnValue.toFixed(8) + ' is lower than the minimum allowed bet.  Setting bet to the minimum allowable amount of ' + currency.minAmount, 'info');
            returnValue = currency.minAmount;
        }

        return returnValue;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('Winner!! You won ' + winAmount.toFixed(8));
            } else {
                log.error('Loser!! You lost ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var losePercentage = (totalLoses / totalNumberOfGames) * 100;

            log.info('Total Games: ' + totalNumberOfGames);
            log.info('Wins: ' + totalWins + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losePercentage.toFixed(2) + ' % )');

            var netNumber = runningbalance - originalbalance;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (originalbalance < runningbalance) {
                log.success('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determines whether or not to log an event or not to make it easier later
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compact') {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'info':
                    log.info(message);
                    break;
                case 'compact':
                    break;
                case 'verbose':
                    if (isVerbose)
                        log.info(message);
                    break;
                }
            } else {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'compact':
                    log.info(message);
                    break;
                case 'info':
                    break;
                case 'verbose':
                    break;
                }
            }
        }
    }

I on average double up every few hours with this, but there are times where it goes into a run away nose dive so i don't leave it unattended without a stop loss amount set.  But that stop loss is calculated from the last win and not from the session so it will stop before it eats all of the profits away.

Brother this script was way too good for start but at the end house won, still i researched more and found 2 of your scripts 

-----------------------------SCRIPT 1 ( Red Train Pauser )---------------------------------------------

var config = {
    betPercentage: {
        label: 'percentage of total coins to bet',
        value: 0.25,
        type: 'number'
    },
    payout: {
        label: 'payout',
        value: 2,
        type: 'number'
    },
    onLoseTitle: {
        label: 'On Lose',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'increase',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (loss multiplier)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (win multiplier)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Other Stopping Conditions',
        type: 'title'
    },    
    winGoalAmount: {
        label: 'Stop once you have made this much',
        value: currency.amount * 2,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Stop betting after losing this much without a win.',
        value: 0,
        type: 'number'
    },    
    otherConditionsTitle: {
        label: 'Experimentle Please Ignore',
        type: 'title'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [{
                value: 'info',
                label: 'info'
            }, {
                value: 'compact',
                label: 'compact'
            }, {
                value: 'verbose',
                label: 'verbose'
            }
        ]
    }
};
// deleted input parameters
var stop = 0;
var lossesForBreak = 0;
var roundsToBreakFor = 0;

// end deleted parameters
var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = GetNewBaseBet();
var totalNumberOfGames = 0;
var originalbalance = currency.amount;
var runningbalance = currency.amount;
var consequetiveLostBets = 0;
var lossStopAmountVar = config.lossStopAmount.value;

function main() {

    game.onBet = function () {

        // if we are set to skip rounds then do so.
        if (numberOfRoundsToSkip > 0) {
            numberOfRoundsToSkip -= 1;
            log.info('Skipping round to relax, and the next ' + numberOfRoundsToSkip + ' rounds.');
            return;
        } else {
        
                if(totalNumberOfGames == 0)
                {
                    // this is so we account for the first round.
                    currentBet = GetNewBaseBet();
                }
                
                if(loseStreak >= 2)
                {
                    if(game.history[0].crash > 200)
                    {
                        loseStreak = 0;
                    }
                    else
                    {
                        log.info('Not betting until current loseStreak is over.');
                        return;
                    }                    
                }

            log.info('Placed bet for the amount of ' + currentBet);
            game.bet(currentBet, config.payout.value).then(function (payout) {
                runningbalance -= currentBet;
                totalWagers += currentBet;
                totalNumberOfGames += 1;

                if (payout > 1) {
                    var netwin = currentBet * config.payout.value - currentBet;
                    consequetiveLostBets = 0;
                    if(config.loggingLevel.value != 'compact')
                    {
                        LogMessage('We won a net profit of: ' + netwin.toFixed(8), 'success');
                    }
                    netProfit += netwin;
                    runningbalance += netwin + currentBet;

                    if (loseStreak > 0) {
                        loseStreak = 0;
                    }

                    currentStreak += 1;
                    totalWins += 1;

                    LogSummary('true', currentBet);

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        currentBet *= config.winMultiplier.value;
                    }

                    LogMessage('We won, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('We lost a net amount of: ' + currentBet.toFixed(8));
                        netProfit -= currentBet;
                        loseStreak += 1;
                        currentStreak = 0;
                        totalLoses += 1;
                        consequetiveLostBets += currentBet;

                        LogSummary('false', currentBet);

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            currentBet *= config.lossMultiplier.value;
                        }
                            LogMessage('We lost, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');            
                    }

                    if (currentStreak > longestWinStreak) {
                        longestWinStreak = currentStreak;
                    }
                    if (loseStreak > longestLoseStreak) {
                        longestLoseStreak = loseStreak;
                    }

                    recordStats();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // we have earned enough stop and quit.
                        log.success('The net profits ' + netProfit.toFixed(8) + ' which triggers stop the for making enough.');
                        game.stop();
                    }
                    if (lossStopAmountVar != 0 && consequetiveLostBets > (lossStopAmountVar)) {
                        // the point of this is to limit the bleed so you don't loose too much.
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        game.stop();
                    }
                }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total wagers: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Net Profit: ' + netProfit.toFixed(8), 'info');
            LogMessage('Current win streak: ' + currentStreak, 'info');
            LogMessage('Current Lose streak: ' + loseStreak, 'info');
            LogMessage('Total wins: ' + totalWins, 'info');
            LogMessage('Total Losses: ' + totalLoses, 'info');
            LogMessage('Longest win streak: ' + longestWinStreak, 'info');
            LogMessage('Longest lose streak: ' + longestLoseStreak, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = runningbalance * (config.betPercentage.value / 100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculating base bet to ' + returnValue.toFixed(8) + ' which is ' + config.betPercentage.value + ' percent of ' + runningbalance.toFixed(8), 'info');
        }
        else
        {
            LogMessage('The recalculated bet amount ' + returnValue.toFixed(8) + ' is lower than the minimum allowed bet.  Setting bet to the minimum allowable amount of ' + currency.minAmount, 'info');
            returnValue = currency.minAmount;
        }

        return returnValue;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('Winner!! You won ' + winAmount.toFixed(8));
            } else {
                log.error('Loser!! You lost ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var losePercentage = (totalLoses / totalNumberOfGames) * 100;

            log.info('Total Games: ' + totalNumberOfGames);
            log.info('Wins: ' + totalWins + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losePercentage.toFixed(2) + ' % )');

            var netNumber = runningbalance - originalbalance;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (originalbalance < runningbalance) {
                log.success('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determines whether or not to log an event or not to make it easier later
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compact') {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'info':
                    log.info(message);
                    break;
                case 'compact':
                    break;
                case 'verbose':
                    if (isVerbose)
                        log.info(message);
                    break;
                }
            } else {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'compact':
                    log.info(message);
                    break;
                case 'info':
                    break;
                case 'verbose':
                    break;
                }
            }
        }
    }

 

---------------------------Script 2 (Custom LossBreak set)-------------------------------------

var config = {
    betPercentage: {
        label: 'percentage of total coins to bet',
        value: 0.25,
        type: 'number'
    },
    payout: {
        label: 'payout',
        value: 2,
        type: 'number'
    },
    stop: {
        label: 'stop if bet >',
        value: currency.amount * (0.25 / 100) * (2^7),
        type: 'number'
    },
    onLoseTitle: {
        label: 'On Lose',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'increase',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (loss multiplier)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (win multiplier)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Other Stopping Conditions',
        type: 'title'
    },    
    winGoalAmount: {
        label: 'Stop once you have made this much',
        value: currency.amount * 2,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Stop betting after losing this much without a win.',
        value: currency.amount * 0.10,
        type: 'number'
    },    
    otherConditionsTitle: {
        label: 'Experimentle Please Ignore',
        type: 'title'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [{
                value: 'info',
                label: 'info'
            }, {
                value: 'compact',
                label: 'compact'
            }, {
                value: 'verbose',
                label: 'verbose'
            }
        ]
    },
    lossesForBreak: {
        label: '# losses before break',
        value: 5,
        type: 'number'
    },
    roundsToBreakFor: {
        label: '# of games to skip for break',
        value: 0,
        type: 'number'
    }
};

var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = GetNewBaseBet();
var totalNumberOfGames = 0;
var originalbalance = currency.amount;
var runningbalance = currency.amount;
var consequetiveLostBets = 0;
var stopBetVar = config.stop.value;
var lossStopAmountVar = config.lossStopAmount.value;

function main() {

    game.onBet = function () {

        // if we are set to skip rounds then do so.
        if (numberOfRoundsToSkip > 0) {
            numberOfRoundsToSkip -= 1;
            log.info('Skipping round to relax, and the next ' + numberOfRoundsToSkip + ' rounds.');
            return;
        } else {
        
                if(totalNumberOfGames == 0)
                {
                    // this is so we account for the first round.
                    currentBet = GetNewBaseBet();
                }

            log.info('Placed bet for the amount of ' + currentBet);
            game.bet(currentBet, config.payout.value).then(function (payout) {
                runningbalance -= currentBet;
                totalWagers += currentBet;
                totalNumberOfGames += 1;

                if (payout > 1) {
                    var netwin = currentBet * config.payout.value - currentBet;
                    consequetiveLostBets = 0;
                    if(config.loggingLevel.value != 'compact')
                    {
                        LogMessage('We won a net profit of: ' + netwin.toFixed(8), 'success');
                    }
                    netProfit += netwin;
                    runningbalance += netwin + currentBet;

                    if (loseStreak > 0) {
                        loseStreak = 0;
                    }

                    currentStreak += 1;
                    totalWins += 1;

                    LogSummary('true', currentBet);
                    
                    // Update the stop conditions because if we are winning we don't care about them and want them to reflect the 
                    // levels based on the nest egg.
                    stopBetVar = runningbalance * (0.25 / 100) * (2^7);
                    
                    // This is reseting to the new 10% of the nut.
                    if(config.lossStopAmount.value > 0)
                    {
                        lossStopAmountVar = runningbalance * 0.10;
                    }

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        currentBet *= config.winMultiplier.value;
                    }

                    LogMessage('We won, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('We lost a net amount of: ' + currentBet.toFixed(8));
                        netProfit -= currentBet;
                        loseStreak += 1;
                        currentStreak = 0;
                        totalLoses += 1;
                        consequetiveLostBets += currentBet;

                        LogSummary('false', currentBet);

                        if (config.lossesForBreak.value > 0) {
                            if (loseStreak % config.lossesForBreak.value == 0) {
                                numberOfRoundsToSkip = config.roundsToBreakFor.value;
                                
                                // Update the current bet with the loss and multiplier so that we don't start back out in the red.
                                currentBet *= config.lossMultiplier.value;

                                // at this point we have lost enough to take a break for the specified number of games and reset our bet.
                                LogMessage('We lost ' + loseStreak + ' games in a row. Taking a break for ' + numberOfRoundsToSkip + ' more rounds.', 'failure');
                                return;
                            }
                        }

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            currentBet *= config.lossMultiplier.value;
                        }

                        LogMessage('1. We lost, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');
                    }

                    if (currentStreak > longestWinStreak) {
                        longestWinStreak = currentStreak;
                    }
                    if (loseStreak > longestLoseStreak) {
                        longestLoseStreak = loseStreak;
                    }

                    recordStats();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // we have earned enough stop and quit.
                        log.success('The net profits ' + netProfit.toFixed(8) + ' which triggers stop the for making enough.');
                        game.stop();
                    }
                    if (lossStopAmountVar != 0 && consequetiveLostBets > (lossStopAmountVar)) {
                        // the point of this is to limit the bleed so you don't loose too much.
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        game.stop();
                    }
                    // only bother with this last code path if  there isn't a valid number in the first condition.
                    if (stopBetVar != 0 && currentBet > stopBetVar) {
                        log.error('Was about to bet' + currentBet.toFixed(8) + ' which triggers the stop');
                        game.stop();
                    }
                }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total wagers: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Net Profit: ' + netProfit.toFixed(8), 'info');
            LogMessage('Current win streak: ' + currentStreak, 'info');
            LogMessage('Current Lose streak: ' + loseStreak, 'info');
            LogMessage('Total wins: ' + totalWins, 'info');
            LogMessage('Total Losses: ' + totalLoses, 'info');
            LogMessage('Longest win streak: ' + longestWinStreak, 'info');
            LogMessage('Longest lose streak: ' + longestLoseStreak, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = runningbalance * (config.betPercentage.value / 100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculating base bet to ' + returnValue.toFixed(8) + ' which is ' + config.betPercentage.value + ' percent of ' + runningbalance.toFixed(8), 'info');
        }
        else
        {
            LogMessage('The recalculated bet amount ' + returnValue + ' is lower than the minimum allowed bet.  Setting bet to the minimum allowable amount of ' + currency.minAmount, 'info');
            returnValue = currency.minAmount;
        }

        return returnValue;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('Winner!! You won ' + winAmount.toFixed(8));
            } else {
                log.error('Loser!! You lost ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var losePercentage = (totalLoses / totalNumberOfGames) * 100;

            log.info('Total Games: ' + totalNumberOfGames);
            log.info('Wins: ' + totalWins + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losePercentage.toFixed(2) + ' % )');

            var netNumber = runningbalance - originalbalance;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (originalbalance < runningbalance) {
                log.success('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determines whether or not to log an event or not to make it easier later
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compact') {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'info':
                    log.info(message);
                    break;
                case 'compact':
                    break;
                case 'verbose':
                    if (isVerbose)
                        log.info(message);
                    break;
                }
            } else {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'compact':
                    log.info(message);
                    break;
                case 'info':
                    break;
                case 'verbose':
                    break;
                }
            }
        }
    }

 

--------------------------------------------My Request--------------------------------------------------

Brother i really tried hard to combine them but no success in the end, i want that can you combine them

--------------------------------------------FOR EXAMPLE----------------------------------------------

After getting a streak of 4 losses in your Read Train stoppper script it will skip 10rounds and after skipping 10rounds it will again wait for a green signal before placing the bet.

Hoping you will accept my request

Edited by SatyamTheBoss
Just making the message for more clear
Link to comment
Share on other sites

  • 1 month later...
On 5/2/2022 at 7:13 PM, Bigmattyboy said:

Hey guys! I figured out how to make Skele's crash script work on hashdice. It's the exact same as his except now it bets minimum on massive loss streaks and will wait for 3 losses in a row before doing so. (I did some testing and 3 losses in a row seems to be more successful than 2)

Hey, looks like the last update broke your script.  Can it be fixed?

image.png.16b2e7e111749261c2489667971f1722.png

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
On 8/23/2022 at 4:15 AM, Skele said:

Do you mean for my base bet? The I normally used .5% I haven't used this script in a while though. Have played much crash in a while either until more recently

Hey bro @Skele, i sent you an DM please check it when you have the chance. 

Link to comment
Share on other sites

On 23/8/2022 at 09:15, Skele said:

Do you mean for my base bet? The I normally used .5% I haven't used this script in a while though. Have played much crash in a while either until more recently

What script are you using right now that you feel is the best for crash?Can you share it with me ^^

Link to comment
Share on other sites

On 12/6/2021 at 1:56 AM, Dinscore said:
// The Cookie Monster script.
// created by Cookie High <-- Loves tips
// This script gives you multiple options for both your bets and your payouts on both wins and losses.
// Play around with the settings and find what works for you best.
//
// The defaults settings are the ones I am useing. I have ran it for 5 days.
// I have an average daily return of 3.96%. I notice the days where my win percentage is lower I have retuns
// closer to 5%.
//
// Don't bet more than you can lose. With a 2.1% payout my minimum bet can be doubled 20 times before I go
// broke. The longes losing streak I have seen is 13. Give your self plenty of room and you are less likely
// to loss it all.
//
// Bot safely and go make some money!!!
// Dont forget to friend and tip me. 🙂
 
var config = {
  scriptTitle: {label: 'This script was compiled by Cookie High. Tips are greatly apprciated! Now go make it rain!', type: 'title'},
  baseBet: {label: 'Starting Bet:', value: currency.minAmount, type: 'number'},
  maxBet: {label: 'Maximum Bet:', value: 10000, type: 'number'},
  minBet: {label: 'Minimum Bet:', value: 0, type: 'number'},
  stopBet: {label: 'Stop if Bet is Greater Than:', value: 1e8, type: 'number'},
  basePayout: {label: 'Starting Payout:', value: 2.1, type: 'number'},
  maxPayout: {label: 'Maximum Payout:', value: 10, type: 'number'},
  minPayout: {label: 'Minimum Payout:', value: 2, type: 'number'},
  stopPayout: {label: 'Stop if Payout is Greater Than:', value: 1e8, type: 'number'},
  winRepeat: {label: 'Reset After Win Streak of:', value: 2, type: 'number'},
 
  onBetLossTitle: {label: 'Loss Bet Settings', type: 'title'},
    onBetLoss: {label: '', value: '3', type: 'radio',
      options: [
        {value: '0', label: 'Return to Starting Bet'},
        {value: '1', label: 'Add to Bet'},
        {value: '2', label: 'Subtract From Bet'},
        {value: '3', label: 'Multiply Bet By'},
        {value: '4', label: 'Divide Bet By'}
      ]
    },
  addBetLoss: { label: 'Increase Bet By:', value: 0, type: 'number' },
  subBetLoss: { label: 'Decrease Bet By:', value: 0, type: 'number' },
  mulBetLoss: { label: 'Multiply Bet By:', value: 2, type: 'number' },
  divBetLoss: { label: 'Divide Bet By:', value: 1, type: 'number' },
 
  onPayoutLossTitle :{label: 'Loss Payout Settings', type: 'title'},
    onPayoutLoss: {label: '', value: '0', type: 'radio',
      options: [
        {value: '0', label: 'Return to Starting Payout'},
        {value: '1', label: 'Add to Payout'},
        {value: '2', label: 'Subtract From Payout'},
        {value: '3', label: 'Multiply Payout By'},
        {value: '4', label: 'Divide Payout By'}
      ]
    },
  addPayoutLoss: { label: 'Increase Payout By:', value: 0, type: 'number' },
  subPayoutLoss: { label: 'Decrease Payout By:', value: 0, type: 'number' },
  mulPayoutLoss: { label: 'Multiply Payout By:', value: 1, type: 'number' },
  divPayoutLoss: { label: 'Divide Payout By:', value: 1, type: 'number' },
 
  onBetWinTitle: {label: 'Win Bet Settings', type: 'title'},
    onBetWin: {label: '', value: '0', type: 'radio',
      options: [
        {value: '0', label: 'Return to Starting Bet'},
        {value: '1', label: 'Add to Bet'},
        {value: '2', label: 'Subtract From Bet'},
        {value: '3', label: 'Multiply Bet By'},
        {value: '4', label: 'Divide Bet By'}
      ]
    },
  addBetWin: { label: 'Increase Bet By:', value: 0, type: 'number' },
  subBetWin: { label: 'Decrease Bet By:', value: 0, type: 'number' },
  mulBetWin: { label: 'Multiply Bet By:', value: 1, type: 'number' },
  divBetWin: { label: 'Divide Bet By:', value: 1, type: 'number' },
 
  onPayoutWinTitle :{label: 'Win Payout Settings', type: 'title'},
    onPayoutWin: {label: '', value: '3', type: 'radio',
      options: [
        {value: '0', label: 'Return to Starting Payout'},
        {value: '1', label: 'Add to Payout'},
        {value: '2', label: 'Subtract From Payout'},
        {value: '3', label: 'Multiply Payout By'},
        {value: '4', label: 'Divide Payout By'}
      ]
    },
  addPayoutWin: { label: 'Increase Payout By:', value: 0, type: 'number' },
  subPayoutWin: { label: 'Decrease Payout By:', value: 0, type: 'number' },
  mulPayoutWin: { label: 'Multiply Payout By:', value: 2, type: 'number' },
  divPayoutWin: { label: 'Divide Payout By:', value: 1, type: 'number' },
 
}
 
function main (){
  var baseBet = config.baseBet.value;
  var maxBet = config.maxBet.value;
  var minBet = config.maxBet.value;
  var basePayout = config.minPayout.value;
  var maxPayout = config.maxPayout.value;
  var minPayout = config.minPayout.value;
  var currentBet = config.baseBet.value;
  var currentPayout = config.basePayout.value;
  var onBetWin = config.onBetWin.value;
  var addBetWin = config.addBetWin.value;
  var subBetWin = config.subBetWin.value;
  var mulBetWin = config.mulBetWin.value;
  var divBetWin = config.divBetWin.value;
  var onPayoutWin = config.onPayoutWin.value;
  var addPayoutWin = config.addPayoutWin.value;
  var subPayoutWin = config.subPayoutWin.value;
  var mulPayoutWin = config.mulPayoutWin.value;
  var divPayoutWin = config.divPayoutWin.value;
  var onBetLoss = config.onBetLoss.value;
  var addBetLoss = config.addBetLoss.value;
  var subBetLoss = config.subBetLoss.value;
  var mulBetLoss = config.mulBetLoss.value;
  var divBetLoss = config.divBetLoss.value;
  var onPayoutLoss = config.onPayoutLoss.value;
  var addPayoutLoss = config.addPayoutLoss.value;
  var subPayoutLoss = config.subPayoutLoss.value;
  var mulPayoutLoss = config.mulPayoutLoss.value;
  var divPayoutLoss = config.divPayoutLoss.value;
  var stopPayout = config.stopPayout.value;
  var stopBet = config.stopBet.value;
  var winRepeatCount = config.winRepeat.value
  var winRepeatSet = 1
  var winRepProvision = 0
  var gameStatus = 1
  var gameCounter = 1
 
  game.onBet = function () {
    log.success('Placing Bet For: ' + currentBet + ', At Payout: '+ currentPayout)
   
    game.bet(currentBet, currentPayout).then(function (payout)
        {if (payout > 1)
            {if(!gameStatus)
                {counterReset(true)}
                    log.success('Winner, Winner, Chicken Dinner!')
                        gameStarter(onBetWinSwitch(onBetWin),onPayoutWinSwitch(onPayoutWin))
            }
        else
            {if(gameStatus)
                {gameStatus--}
                    winRepCountReset(true)
                        log.error('We lost that one.')
                            gameStarter(onBetLossSwitch(onBetLoss),onPayoutLossSwitch(onPayoutLoss))
                                gameCounter++
            }
        })
 
function gameStarter(calculatedBet, calculatedPayout)
    {if (currentBet > stopBet)
        {log.error('The bot was stopped because the max bet was reached!');
            game.stop();}
    else
    if (currentPayout > stopPayout)
        {log.error('The bot was stopped because the max payout was reached!');
            game.stop();}
                currentBet = calculatedBet
                currentPayout = calculatedPayout
    }
 
function onBetWinSwitch (switchValue)
{switch(switchValue)
    {case '0':
        return baseBet
      break;
    case '1':
        if(!gameStatus)
            {if(!winRepeatCount)
                {gameStatus++
                    winRepCountReset(true)  
                        return baseBet
                }
            else
                {winRepeatCount--
                    winRepProvision++
                        winRepeatSet--
                        {if (currentBet + (addBetWin) > maxBet)
                            {return maxBet,
                            log.error('Maximum bet reached!')}
                        else
                            return currentBet + (addBetWin)
                        }
                }
            }
        else
            {return baseBet}
                break;
    case '2':
        if(!gameStatus)
            {if(!winRepeatCount)
                {gameStatus++
                    winRepCountReset(true)  
                        return baseBet}
            else
                {winRepeatCount--
                    winRepProvision++
                        winRepeatSet--
                            {if (currentBet - (subBetWin) < minBet)
                                {return minBet,
                                log.error('Minimum bet reached!')}
                            else                        
                                return currentBet - (subBetWin)
                            }
                }
            }
        else
            {return baseBet}
                break;
    case '3':
        if(!gameStatus)
            {if(!winRepeatCount)
                {gameStatus++
                    winRepCountReset(true)  
                        return baseBet}
            else
                {winRepeatCount--
                    winRepProvision++
                        winRepeatSet--
                            {if (currentBet * (mulBetWin) > maxBet)
                                {return maxBet,
                                log.error('Maximum bet reached!')}
                            else                        
                                return currentBet * (mulBetWin)
                            }
                }
            }
    else
    {return baseBet}
        break;
 
        case '4':
        if(!gameStatus)
            {if(!winRepeatCount)
                {gameStatus++
                winRepCountReset(true)  
                    return baseBet}
            else
                {winRepeatCount--
                winRepProvision++
                winRepeatSet--
                    {if (currentBet / (divBetWin) < minBet)
                        {return minBet,
                        log.error('Minimum bet reached!')}
                    else
                        return currentBet / (divBetWin)
                    }
                }
            }
    else
        {return baseBet}
            break;
                           
                   
                   
    }
}
               
function onPayoutWinSwitch (switchValue)
    {switch(switchValue)
        {case '0':
            return basePayout
                break;
        case '1':
            if(!gameStatus)
                {if(!winRepeatCount)
                    {gameStatus++
                        winRepCountReset(true)  
                            return basePayout
                    }
                else
                    {winRepeatCount--
                    winRepProvision++
                    winRepeatSet--
                        {if (currentPayout + (addPayoutWin) > maxPayout)
                            {return maxPayout,
                            log.error('Maximum payout reached!')}
                        else
                            return currentPayout + (addPayoutWin)
                        }
                    }
                }
        else
            {return basePayout}
                break;
        case '2':
            if(!gameStatus)
                {if(!winRepeatCount)
                    {gameStatus++
                    winRepCountReset(true)  
                        return basePayout}
                else
                    {winRepeatCount--
                    winRepProvision++
                    winRepeatSet--
                        {if (currentPayout - (subPayoutWin) < minPayout)
                            {return minPayout,
                            log.error('Minimum payout reached!')}
                        else
                            return currentPayout - (subPayoutWin)
                        }
                    }
                }
            else
                {return basePayout}
                    break;
        case '3':
            if(!gameStatus)
                {if(!winRepeatCount)
                    {gameStatus++
                    winRepCountReset(true)  
                        return basePayout}
                else
                    {winRepeatCount--
                    winRepProvision++
                    winRepeatSet--
                        {if (currentPayout * (mulPayoutWin) > maxPayout)
                            {return maxPayout,
                            log.error('Maximum payout reached!')}
                        else    
                            return currentPayout * (mulPayoutWin)
                        }
                    }
                }
        case '4':
            if(!gameStatus)
                {if(!winRepeatCount)
                    {gameStatus++
                    winRepCountReset(true)  
                        return basePayout}
                else
                    {winRepeatCount--
                    winRepProvision++
                    winRepeatSet--
                        {if (currentPayout / (divPayoutWin) < minPayout)
                            {return minPayout,
                            log.error('Minimum payout reached!')}
                        else  
                            return currentPayout / (divPayoutWin)
                        }
                    }
                }
        else
            {return basePayout}
                break;
    }
}}
function onBetLossSwitch (switchValue)
    {switch(switchValue)
        {case '0':
            return baseBet
                break;
        case '1':
            {if (currentBet + (addBetLoss) > maxBet)
                {return maxBet,
                log.error('Maximum bet reached!')}
            else
                return currentBet + (addBetLoss)}
                break;
        case '2':
            {if (currentBet - (subBetLoss) < minBet)
                {return minBet,
                log.error('Minimum bet reached!')}
            else
                return currentBet - (subBetLoss)}
                break;
        case '3':
            {if (currentBet * (mulBetLoss) > maxBet)
                {return maxBet,
                log.error('Maximum bet reached!')}
            else
                return currentBet * (mulBetLoss)}
                break;
        case '4':
            {if (currentBet / (divBetLoss) < minBet)
                {return minBet,
                log.error('Minimum bet reached!')}
            else
                return currentBet / (divBetLoss)}
                break;
        }  
    }
function onPayoutLossSwitch (switchValue)
    {switch(switchValue)
        {case '0':
            return basePayout
                break;
        case '1':
            {if (currentPayout + (addPayoutLoss) > maxPayout)
                {return maxPayout,
                log.error('Maximum payout reached!')}
            else
                return currentPayout + (addPayoutLoss)}
                break;
        case '2':
            {if (currentPayout - (subPayoutLoss) < minPayout)
                {return minPayout,
                log.error('Minimum payout reached!')}
            else
                return currentPayout - (subPayoutLoss)}
                break;
        case '3':
            {if (currentPayout * (mulPayoutLoss) > maxPayout)
                {return maxPayout,
                log.error('Maximum payout reached!')}
            else
            return currentPayout * (mulPayoutLoss)}
                break;
        case '4':
            {if (currentPayout / (divPayoutLoss) < minPayout)
                {return minPayout ,
                log.error('Minimum payout reached!')}
            else
            return currentPayout / (divPayoutLoss)}
                break;
        }
    }
function counterReset(itsZero)
    {if(itsZero)
        {gameCounter--
        if(!gameCounter)
            {gameCounter++
            return}
                counterReset(true)
        }
    }
function winRepCountReset(itsZero)
    {if(!winRepProvision)
        {return}
            if(itsZero)
            {winRepeatCount++
                winRepProvision--
                    if(!winRepProvision)
                        {return}
                            winRepCountReset(true)
            }
    }
}

Шшш

Мурманск Баумана

Link to comment
Share on other sites

The easiest way would be ti out a .toString() after value. That field is set up do that you can specify a range like 2-5 and it will split the string "2-5" using the hyphen character and then use the 2 and the 5 as the range to pull a random number from. My guess as to what is happening to you is you either have a single number in there and the value ends up casting it to an integer. But there is no number.spmit since splitis a method on tge string object mot the number objec5  .  Thenothwrbipyion since you aren't using this part anywY would be to remove the call to split.

Link to comment
Share on other sites

52 minutes ago, Skele said:

The easiest way would be ti out a .toString() after value. That field is set up do that you can specify a range like 2-5 and it will split the string "2-5" using the hyphen character and then use the 2 and the 5 as the range to pull a random number from. My guess as to what is happening to you is you either have a single number in there and the value ends up casting it to an integer. But there is no number.spmit since splitis a method on tge string object mot the number objec5  .  Thenothwrbipyion since you aren't using this part anywY would be to remove the call to split.

Thank you much! I'll mess with it but that makes sense. 

 

Link to comment
Share on other sites

  • 1 month later...
On 5/4/2022 at 9:13 PM, Bigmattyboy said:

hey guys! big thanks to @Skelefor the code, so the hashdice script now has a range that you can adjust yourself in the script before it starts betting minimum. i have also taken the time to change the stop-loss variables - there is now an option for it to stop the script or reset the martingale counter instead, and i have made it so that the stop-loss value is based x amount of bets you're able to double rather than a specific number you have to calculate yourself.

please let me know what you think!

 

var config = {
    betPercentage: {
        label: 'Total percentage of bankroll to bet',
        value: 0.0015,
        type: 'number'
    },
    lossesBeforeMinBet: {
        label: 'Losses before minimum bet (range)',
        value: 2-5,
        type: 'text'
    },
    payout: {
        label: 'payout',
        value: 2,
        type: 'number'
    },

    onLoseTitle: {
        label: 'On Loss',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'increase',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (loss multiplier)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            }, {
                value: 'increase',
                label: 'Increase bet by (win multiplier)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Stop Settings',
        type: 'title'
    },
    playOrStop: {
        label: 'Once loss stop reached, continue betting (Martingale counter reset) or stop betting?',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'stop',
                label: 'Stop betting'
            }, {
                value: 'continue',
                label: 'Continue betting'
            }
        ]
    },
    winGoalAmount: {
        label: 'Stop once you have made this much',
        value: currency.amount,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Stop betting after losing this many times in a row without a win',
        value: 1,
        type: 'number'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [{
                value: 'info',
                label: 'info'
            }, {
                value: 'compact',
                label: 'compact'
            }, {
                value: 'verbose',
                label: 'verbose'
            }
        ]
    }
};
// deleted input parameters
var stop = 0;
var lossesForBreak = 0;
var roundsToBreakFor = 0;

// end deleted parameters
var totalWagers = 0;
var netProfit = 0;
var totalWins = 0;
var totalLoses = 0;
var longestWinStreak = 0;
var longestLoseStreak = 0;
var currentStreak = 0;
var loseStreak = 0;
var numberOfRoundsToSkip = 0;
var currentBet = GetNewBaseBet();
var totalNumberOfGames = 0;
var originalbalance = currency.amount;
var runningbalance = currency.amount;
var consequetiveLostBets = 0;
var lossStopAmountVar = 0;

function main() {

maxLossesBeforeMinBet = GetLossesBeforeMinBet(2-3);

function GetLossesBeforeMinBet()
{
    if(config.lossesBeforeMinBet.value.toString().indexOf('-') >= 0)
    {
        var numbers = config.lossesBeforeMinBet.value.split('-');
        
        return GetRandomInt(Number.parseInt(numbers[0]), Number.parseInt(numbers[1]));
    }
    else
    {
        return Number.parseInt(config.lossesBeforeMinBet.value);
    }
}

// Returns a random integer between the min and max.
function GetRandomInt(min, max)
{
var retValue = Math.floor(Math.random() * (max - min)) + min;

log.info('Number of losses before pause is set to ' + retValue + '');
return retValue;
}

    game.onBet = function () {

        // if we are set to skip rounds then do so.
        if (numberOfRoundsToSkip > 0) {
            numberOfRoundsToSkip -= 1;
            log.info('Skipping round to relax, and the next ' + numberOfRoundsToSkip + ' rounds.');
            return;
        } else {

                if(totalNumberOfGames == 0)
                {
                    // this is so we account for the first round.
                    currentBet = GetNewBaseBet();
                }

                if(loseStreak >= maxLossesBeforeMinBet)
                {
                    if(game.history[0] >= (config.payout.value * 100))
                    {
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();
                    }
                    else
                    {
                        game.bet(currency.minAmount).then(function (payout) {
                        runningbalance -= currency.minAmount;
                        totalWagers += currency.minAmount;
                        totalNumberOfGames += 1;

                        if (payout > 1) {
                        var netwin = currency.minAmount * config.payout.value - currency.minAmount;
                        consequetiveLostBets = 0;
                        netProfit += netwin;
                        runningbalance += netwin + currency.minAmount;
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();

                        }
                        })
                        log.info('Betting minimum until a win hits');
                        return;
                    }
                }

            log.info('Placed bet for the amount of ' + currentBet);
            game.bet(currentBet, config.payout.value).then(function (payout) {
                runningbalance -= currentBet;
                totalWagers += currentBet;
                totalNumberOfGames += 1;

                if (payout > 1) {
                    var netwin = currentBet * config.payout.value - currentBet;
                    consequetiveLostBets = 0;
                    if(config.loggingLevel.value != 'compact')
                    {
                        LogMessage('We won a net profit of: ' + netwin.toFixed(8), 'success');
                    }
                    netProfit += netwin;
                    runningbalance += netwin + currentBet;

                    if (loseStreak > 0) {
                        loseStreak = 0;
                        maxLossesBeforeMinBet = GetLossesBeforeMinBet();
                    }

                    currentStreak += 1;
                    totalWins += 1;

                    LogSummary('true', currentBet);

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        currentBet *= config.winMultiplier.value;
                    }

                    LogMessage('We won, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('We lost a net amount of: ' + currentBet.toFixed(8));
                        netProfit -= currentBet;
                        loseStreak += 1;
                        currentStreak = 0;
                        totalLoses += 1;
                        consequetiveLostBets += currentBet;

                        LogSummary('false', currentBet);

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            currentBet *= config.lossMultiplier.value;
                        }
                            LogMessage('We lost, so next bet will be ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');
                    }

                    if (currentStreak > longestWinStreak) {
                        longestWinStreak = currentStreak;
                    }
                    if (loseStreak > longestLoseStreak) {
                        longestLoseStreak = loseStreak;
                    }

                    recordStats();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // we have earned enough stop and quit.
                        log.success('The net profits ' + netProfit.toFixed(8) + ' which triggers stop the for making enough.');
                        game.stop();
                    }
                    if (config.playOrStop.value === 'stop') {
                    if (config.lossStopAmount.value != 0 && config.lossStopAmount.value <= loseStreak && currentBet > currency.minAmount){
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        game.stop();
                        }
                    }
                    if (config.playOrStop.value === 'continue') {
                    if (config.lossStopAmount.value != 0 && config.lossStopAmount.value <= loseStreak && currentBet > currency.minAmount){
                        log.error('The net profits ' + netProfit.toFixed(8) + ' which triggers stop for losing enough. The next bet would be ' + currentBet.toFixed(8) + '.');
                        currentBet = GetNewBaseBet();
                        }   
                    }
                    }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total wagers: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Net Profit: ' + netProfit.toFixed(8), 'info');
            LogMessage('Current win streak: ' + currentStreak, 'info');
            LogMessage('Current Lose streak: ' + loseStreak, 'info');
            LogMessage('Total wins: ' + totalWins, 'info');
            LogMessage('Total Losses: ' + totalLoses, 'info');
            LogMessage('Longest win streak: ' + longestWinStreak, 'info');
            LogMessage('Longest lose streak: ' + longestLoseStreak, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = runningbalance * (config.betPercentage.value / 100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculating base bet to ' + returnValue.toFixed(8) + ' which is ' + config.betPercentage.value + ' percent of ' + runningbalance.toFixed(8), 'info');
        }
        else
        {
            LogMessage('The recalculated bet amount ' + returnValue.toFixed(8) + ' is lower than the minimum allowed bet.  Setting bet to the minimum allowable amount of ' + currency.minAmount, 'info');
            returnValue = currency.minAmount;
        }

        return returnValue;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('Winner!! You won ' + winAmount.toFixed(8));
            } else {
                log.error('Loser!! You lost ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var losePercentage = (totalLoses / totalNumberOfGames) * 100;

            log.info('Total Games: ' + totalNumberOfGames);
            log.info('Wins: ' + totalWins + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losePercentage.toFixed(2) + ' % )');

            var netNumber = runningbalance - originalbalance;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (originalbalance < runningbalance) {
                log.success('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Total Profit: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determines whether or not to log an event or not to make it easier later
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compact') {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'info':
                    log.info(message);
                    break;
                case 'compact':
                    break;
                case 'verbose':
                    if (isVerbose)
                        log.info(message);
                    break;
                }
            } else {
                switch (loggingLevel) {
                case 'success':
                    log.success(message);
                    break;
                case 'failure':
                    log.error(message);
                    break;
                case 'compact':
                    log.info(message);
                    break;
                case 'info':
                    break;
                case 'verbose':
                    break;
                }
            }
        }
    }

 

Thank you @Skele and @Bigmattyboy for the script, I've been messing around with it and tried it out with different strategies. I recently got into using smart scripts and all your posts have been interesting to learn about, I wish I could learn to script and code as you guys.

I made a lot and lost a lot, but I found these settings more successful or fun to bet with. (use at your own discretion and bet responsibly.)

If your going to bet for real, I recommend only making Incremental gains of 0.01%

If your making it any faster, your going to lose it fast with an unlucky streak or bounce if you can't handle the surmounting amount.

~

(The 0.01% Gainer) - Bankroll of at least 100 units
Total Percentage: 0.02
Losses before minimum bet: 2
Payout: 1.5
Loss Multiplier: 2.75
Stop on Win: 1
Stop in row loss: 10
~

(The Heroic Comeback) Bankroll of at least 50 units
Total Percentage: 0.0001
Losses before minimum bet: 4
Payout: 1.3
Loss Multiplier: 7
Stop on Win: 1
Stop in row loss: 10
~
(Slow and Heavy) - Big Bankroll
Total Percentage: 1
Losses before minimum bet: 2
Payout: 1.02
Loss Multiplier: 50
Stop on Win: 1
Stop in row loss: 5
~

(100 Coin Generator) - Bankroll of at least 20000 units of (SHB, JB, etc)

Total Percentage: 0.001
Losses before minimum bet: 5
Payout: 1.7
Loss Multiplier: 2
Stop on Win: 5000
Stop in row loss: 10

~

 

Edited by Advent
updated strats
Link to comment
Share on other sites

This reminds me that something i think is incredibly useful but not something typically sit down and make/think about is the equation to determine what your base bet shold be given your bank roll and the number of failed games you expect. I have it in a script somewhere as well but just for reference

 

(Total Coint amount)/(payout^numberOfLossesToSurvive).  this will give you the initial bet for how many reds in a row. Because for my it is always way smaller than i like to start with.  Then if you are using the script that will bet a percentage, you can use the same equation and just make your total coin count 100 and that should give you the percentage to weather x number of losses.

Link to comment
Share on other sites

  • 4 weeks later...

Hash dice script - This is a fantastic script by @Skele but I am hoping for one additional function on it if possible.  I'd like to have a field to add a number of consecutive games to play if the win payout is reached. So far the manual strategy I have with script works and I have a 100% win rate but I hope someone can help to add this automation so that the script can start automatically each time.  Example I want to play 10 games - each time it reaches the win payout, it starts at the base bet until all games are played or until one runs out of funds or stop loss is reached at which point the script will stop.

 

 

Edited by Astartes
Link to comment
Share on other sites

On 12/8/2021 at 10:19 PM, Skele said:

tipo de falta de brillo. Tengo varios scripts, pero una de las principales cosas que hice fue agregar un mejor registro /cdn-cgi/mirage/95d57070eb4b9635f99db0adb7806b6c52bd50e4b8e3ac1b8c28aa780d358c96/1280/https://forum.bc.game/uploads/monthly_2021_12/image.png.f86dda1f2d8720599e6fee5c49f4b07a.png

También agregó una característica que después de dos derrotas seguidas, se detendrá hasta que vea al menos 1 victoria. A veces pierdes una victoria en el tercer juego. Pero ya no tengo que lidiar con 13 rachas de derrotas. Tomará dos y luego esperará a que pasen los pastos verdes. Necesito cambiar mi guión de nuevo a montos directos para mejorar, actualmente uso un porcentaje de mi bankroll apostado para la y luego este es el típico doble en caso de pérdida. Lo publicaré en su propio mensaje.

var config = {
    betPercentage: {
        label: 'porcentaje del total de monedas para apostar',
        value: 0.25,
        type: 'number'
    }, payout:
    { label: 'payout
        ',
        value: 2,
        type: 'number'
    },
    onLoseTitle : {
        label: 'On Lose',
        type: 'title'
    },
    onLoss: {
        label: '',
        value: 'aumentar',
        type: 'radio',
        options: [{
                value: 'reset',
                label: ' Vuelve a apostar una base'
            },{
                valor: 'aumentar',
                label: 'Aumentar la apuesta por (multiplicador de pérdidas)'
            }
        ]
    },
    lossMultiplier: {
        label: 'loss multiplier',
        value: 2,
        type: 'number'
    },
    onWinTitle: {
        label: 'On Win ',
        type: 'title'
    },
    onWin: {
        label: '',
        value: 'reset',
        type: 'radio',
        options: [{
                value: 'reset',
                label: 'Return to base bet'
            },{
                valor: 'aumentar ',
                label: 'Aumentar la apuesta por (multiplicador de ganancias)'
            }
        ]
    },
    winMultiplier: {
        label: 'win multiplier',
        value: 1,
        type: 'number'
    },
    otherConditionsTitle: {
        label: 'Otras condiciones de detención',
        type: ' title'
    },    
    winGoalAmount: {
        label: 'Deténgase una vez que haya ganado tanto',
        value: currency.amount * 2,
        type: 'number'
    },
    lossStopAmount: {
        label: 'Deje de apostar después de perder tanto sin ganar. ',

        type: 'number'
    },    
    otherConditionsTitle: {
        label: 'Experimentle Please Ignore',
        type: 'title'
    },
    loggingLevel: {
        label: 'logging level',
        value: 'compact',
        type: 'radio',
        options: [ {
                valor: 'info',
                etiqueta: 'info'
            }, {
                valor: 'compacto',
                etiqueta: 'compacto'
            }, {
                valor: 'detallado',
                etiqueta: 'detallado'
            }
        ]
    }
};
//parámetros de entrada borrados
var stop = 0;
var pérdidas por rotura = 0;
var roundsToBreakFor = 0;

// finaliza los parámetros eliminados
var totalWagers = 0;
var beneficio neto = 0;
var ganancias totales = 0;
var pérdida total = 0;
var racha de victorias más largas = 0;
var racha más larga de pérdidas = 0;
var racha real = 0;
var perderRacha = 0;
var numeroDeRondasParaOmitir = 0;
var apuestaActual = ObtenerNuevaBaseBet();
var totalNumberOfGames = 0;
var saldo original = moneda.cantidad;
var saldo en ejecución = moneda.cantidad;
var apuestas perdidas consecutivas = 0;
var lossStopAmountVar = config.lossStopAmount.value;

funcion principal() {

    juego.onBet = función () {

        // si estamos configurados para omitir rondas, hágalo.
        if (numeroDeRondasParaSaltar > 0) {
            numeroDeRondasParaSaltar -= 1;
            log.info('Saltando ronda para relajarse, y la siguiente ' + númeroDeRondasParaSaltar + ' rondas.');
            devolver;
        } else {
        
                if(totalNumberOfGames == 0)
                {
                    // esto es para que tengamos en cuenta la primera ronda.
                    apuestaActual = ObtenerNuevaBaseBet();
                }
                
                if(racha perdida >= 2)
                {
                    if(juego.historial[0].crash > 200)
                    {
                        perderRacha = 0;
                    }
                    else
                    {
                        log.info('No apostar hasta que termine la actual racha de pérdidas');
                        devolver;
                    }                    
                }

            log.info('Apuesta realizada por la cantidad de ' + apuesta actual);
            juego.apuesta(apuesta actual, config.pago.valor).entonces(función (pago) { saldo actual
                -= apuestaactual;
                apuestastotales +=actual;
                númerototaldejuegos += 1;

                if (pago > 1) {
                    var netwin = apuesta actual * config.pago.valor - apuesta actual;
                    apuestas perdidas consecutivas = 0;
                    if(config.loggingLevel.value != 'compacto')
                    {
                        LogMessage('Obtuvimos una ganancia neta de: ' + netwin.toFixed(8), 'éxito');
                    }
                    beneficio neto += ganancia neta;
                    saldo en ejecución += netwin + currentBet;

                    if (perderRacha > 0) {
                        perderRacha = 0;
                    }

                    racha actual += 1;
                    ganancias totales += 1;

                    LogSummary('true', apuestaActual);

                    if (config.onWin.value === 'reset') {
                        currentBet = GetNewBaseBet();
                    } else {
                        apuestaActual *= config.winMultiplier.value;
                    }

                    LogMessage('Ganamos, por lo que la próxima apuesta será ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'success');
                } else {
                        log.error('Perdimos una cantidad neta de: ' + currentBet.toFixed(8));
                        beneficio neto -= apuesta actual;
                        perderRacha += 1;
                        racha real = 0;
                        pérdidas totales += 1;
                        apuestas perdidas consecutivas += apuestas reales;

                        LogSummary('falso', apuestaActual);

                        if (config.onLoss.value == 'reset') {
                            currentBet = GetNewBaseBet();
                        } else {
                            apuesta real *= config.lossMultiplier.value;
                        }
                            LogMessage('Perdimos, por lo que la próxima apuesta será ' + currentBet.toFixed(8) + ' ' + currency.currencyName, 'failure');            
                    }

                    if (racha actual > racha de victorias más larga) {
                        racha de victorias más larga = racha actual;
                    }
                    if (racha perdida > racha perdida mas larga) {
                        racha perdida mas larga = racha perdida;
                    }

                    registrarEstadísticas();

                    if (config.winGoalAmount.value != 0 && netProfit > config.winGoalAmount.value) {
                        // hemos ganado suficiente parar y salir.
                        log.success('Los beneficios netos ' + netProfit.toFixed(8) + ' que activan la detención por generar suficiente.');
                        juego.stop();
                    }
                    if (lossStopAmountVar != 0 && consequetiveLostBets > (lossStopAmountVar)) {
                        // el objetivo de esto es limitar el sangrado para que no pierda demasiado.
                        log.error('Las ganancias netas ' + netProfit.toFixed(8) + ' que activa la detención por perder lo suficiente.
                        juego.stop();
                    }
                }
            );
        }
    };
    }

    function recordStats() {
        if (config.loggingLevel.value != 'compact') {
            LogMessage('total de apuestas: ' + totalWagers.toFixed(8), 'info');
            LogMessage('Beneficio neto: ' + beneficio neto.toFixed(8), 'info');
            LogMessage('Racha de victorias actual: ' + racha actual, 'info');
            LogMessage('Racha de pérdidas actual: ' + racha de pérdidas, 'info');
            LogMessage('Total de ganancias: ' + totalWins, 'info');
            LogMessage('Pérdidas Totales: ' + PérdidasTotales, 'info');
            LogMessage('Racha de victorias más largas: ' + racha de victorias más largas, 'info');
+ racha perdida más larga, 'info');
        }
    }

    function GetNewBaseBet() {
        var returnValue = 0;
        returnValue = saldo en ejecución * (config.betPercentage.value/100);

        if(returnValue > currency.minAmount)
        {
            LogMessage('Recalculando la apuesta base a ' + returnValue.toFixed(8) + ' que es ' + config.betPercentage.value + ' porcentaje de ' + runningbalance.toFixed(8), ' información ');
        }
        else
        {
            LogMessage('El monto de la apuesta recalculada ' + returnValue.toFixed(8) + ' es menor que la mínima permitida. Estableciendo la apuesta en el monto mínimo permitido de ' + moneda.minAmount, 'info');
            returnValue = moneda.minCantidad;
        }

        devolver valor devuelto;
    }

    function LogSummary(wasWinner, betAmount) {
        if (config.loggingLevel.value == 'compact') {
            if (wasWinner == 'true') {
                var winAmount = (betAmount * config.payout.value) - betAmount;
                log.success('¡Ganador! Has ganado ' + winAmount.toFixed(8));
            } else {
                log.error('¡¡Perdedor!! Perdiste ' + betAmount.toFixed(8));
            }
            var winPercentage = (totalWins / totalNumberOfGames) * 100;
            var porcentaje de pérdida = (pérdidas totales / número total de juegos) * 100;

            log.info('Total de juegos: ' + totalNumberOfGames);
            log.info('Ganancias: ' + totalGanancias + '(' + winPercentage.toFixed(2) + ' % )');
            log.info('Loses: ' + totalLoses + '(' + losesPercentage.toFixed(2) + ' % )');

            var netNumber = saldo en ejecución - saldo original;
            var netPecentage = (netNumber / originalbalance) * 100;

            if (saldooriginal <saldoactual) {
                log.success('Beneficio total: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            } else {
                log.error('Beneficio total: ' + netNumber.toFixed(8) + '(' + netPecentage.toFixed(2) + '%)');
            }
        }

    }

    /// Determina si registrar o no un evento o no para hacerlo más fácil después
    function LogMessage(message, loggingLevel) {
        if (message) {

            if (config.loggingLevel.value != 'compacto') {
                switch (loggingLevel) {
                case 'success':
                    log.success(mensaje);
                    descanso;
                caso 'fallo':
                    log.error(mensaje);
                    descanso;
                case 'info':
                    log.info(mensaje);
                    descanso;
                caso 'compacto':
                    rotura;
                case 'verbose':
                    if (isVerbose)
                        log.info(mensaje);
                    descanso;


                switch (nivel de registro) {
                caso 'éxito':
                    log.success(mensaje);
                    descanso;
                caso 'fallo':
                    log.error(mensaje);
                    descanso;
                case 'compacto':
                    log.info(mensaje);
                    descanso;
                caso 'info':
                    descanso;
                case 'verbose':
                    break;
                }
            }
        }
    }

En promedio, doblo cada pocas horas con esto, pero hay momentos en los que se hunde en picada, así que no lo dejo desatendido sin una cantidad de límite de pérdida establecida. Pero ese stop loss se calcula a partir de la última ganancia y no de la sesión, por lo que se detendrá antes de que consuma todas las ganancias.

 

How could I use this script in hashdice?  I copied this script and it gave me an error in this part (game.history[0].crash > 200) The message said undefined crash.  What can be done about it to get the hashdice history.

 Greetings and thanks for helping so much by sharing your script and clarifying doubts regarding programming issues

Edited by Chary
I had not written the doubt that I had
Link to comment
Share on other sites

 

The get history has always loaded the previous 20 rolls. The only way to load more is to get from verification site which is beyond me.
It grabs those 20 previous rolls because that's 20 more than just pressing Start and we want to see some sort of pattern before betting.

It now adjusts the bet according to losses.

The Update won't show correct Profit as the ability to call the currency.amount returns the same amount as when the script 1st started.

To me this is old and spaghetti looking with crap all over it. This style of betting based upon losses generates a certain level of profit, but is not even close to basing bets on the Streaks % and pausing betting when no streaks.

 

//******************* Nubs27's Smart Script for Crash  *******************
//
//
//
// If you find this script helpful please consider donating to Nubs27 or tipping on NanoGames.io:
// Referral Link: 
https://n-luzqe.nanogames.io/
//
// Donations accepted in many coin/token types. List & Addresses:
// 
https://sites.google.com/view/nanogamescrashscripts/home/donation-addresses
//
//
//
var config = {
    mainTitle: { label: '*** Nubs27\'s Smart Script for Crash ***', type: 'title' },
    auto: { label: '', value: 'Script', type: 'radio', options: [
           { value: 'Script', label: 'Script chooses Base Bet'},
           { value: 'Player', label: 'Player chooses Base Bet'} ]},
    bet: { label: 'Base Bet', value: currency.minAmount, type: 'number' },
    lossTitle: { label: 'Stop When ', type: 'title' },
    stop: { label: 'Coins Lost >', value: 1, type: 'number' },
    end: { label: 'Minutes >', value: 250, type: 'number' },
    profit: { label: 'Profit >', value: 100, type: 'number' },
};

function main () {
//PayOuts checked in the Stats Update
const MultiplierArray = [2.5, 3.00, 5.00, 6.00, 7.00];
const LMultiplierArray = [10.00, 20.00, 50.00, 100.00];
var version = "v2.3";
var PayOutPercents = [];
var PayOutConfidence = [];
var Array2Filter = [];
var FilteredArray = [];
var ScriptHistory = [];
var Trains = []; // Red Train IDs - finding gaps between & correlation between gap & duration
var History = [];
var RoundsPlayed = 0;
var RoundsViewed = 0;
var LastGameID = 1;
var CurrentGameID = LastGameID + 1;
var MinimumBet = currency.minAmount;
var MaxBet = (currency.amount / 10);
var TotalBets = 0;
var CurrentMultiplier = MultiplierArray[1];
var LastMultiplier = MultiplierArray[1];
var MaxLossesEncountered = 3;
var MostLost = 0;
var LargestMulitplier = 2;
var BaseBet = config.bet.value;
var CurrentBet = BaseBet;
var LastBet = BaseBet;
var LastShrek = CurrentGameID;
var LastTrain = 0;
var Gap = 0;
var AverageGap = 0;
var LargestBet = [0,0];
var Enable100ID = 1000000;
var LastResult = "Won";
var CoinLost = 0;
var StopLossCoin = config.stop.value;
var Losses = 0;
var Wins = 0;
var Red = 0;
var Green = 0;
var StartTime = new Date();
var EndTime = new Date();
var TimeDiff = (EndTime - StartTime);
var StartBalance = currency.amount;
var EndBalance = 0;
var Profit = 0;
var ATHProfit = 0;
var ProfPerMin = 0;
var NetProfit = 0;
var DisplayGreeting = "False";
var GotHistory = "False";
var BetYet = "False";
var LoggedBetData = "False";
var GameInfoLogged = "False";
var StrategyFound = "False";
var IsPlaying = "False";
var UpdateBets = "False";
var Enable100 = "False";
var LastCrash = 0;
var PrevCashOut = 0;
var WonAmount = 0;
var FindThisMultiplier = 1;
var FindShouldHave = 2;
var ThisAverage = 1;
var HistorySlice = 50;
var Paused = "True";
var IndexMax = PayOutConfidence[0];
var MaxIndex = 0;
var GetNumber = 0;

// Welcome the Player to the Script
console.clear();
engine.on('GAME_STARTING', function () {
    if (DisplayGreeting == "False") {
        log.info('     Nubs27s Smart Script for Crash');
        log.info("      ****************");
        log.info("See Web Console for more Information (Press F12)");
        console.log('%c~~~~~~~~~~~~~~~~~ Nubs27\'s Smart Script for Crash ~~~~~~~~~~~~~~~~~','color:Purple; font-weight:bold');
        console.log('%cScript Start Time: ' + StartTime,'color:Purple; font-weight:200');
        console.log('  %cWelcome ' , 'color:Purple; font-weight:bold');
        console.log('  %cYour Starting Balance is: ' + StartBalance + ' ' + currency.currencyName, 'color:Purple; font-weight:bold');
        if (config.auto.value == 'Player') {
            if (config.stop.value > currency.amount) {
                MaxBet = (currency.amount / 10);
                config.stop.value = currency.amount * 0.98;
                console.log('%c[WARNING]: Stop Loss is above your Bankroll','color:Orange; font-weight:bold');
                console.log('%c[WARNING]: Stop Loss Updated to ' + config.stop.value, 'color:Orange; font-weight:bold');
            }
            if (config.bet.value > (config.stop.value / 15000)) {
                log.info('[WARNING]: Script Recommends a bankroll of at least ' + (BaseBet * 15000) + '' + currency.currencyName + ' for the Base Bet you provided');
                log.info('[WARNING]: Script Recommends a bankroll of at least ' + (BaseBet * 20000) + '' + currency.currencyName + ' for the Base Bet you provided');
                log.info('[WARNING]: Script Recommends a bankroll of at least ' + (BaseBet * 25000) + '' + currency.currencyName + ' for the Base Bet you provided');
            }
            console.log('  %cYou Input: ' + BaseBet + ' ' + currency.currencyName + ' as the Base Bet', 'color:Purple; font-weight:bold');
        }else{
            betupdate();
            console.log('  %cYour Starting Base Bet is: ' + BaseBet + ' ' + currency.currencyName, 'color:Purple; font-weight:bold');
        }
        console.log('  %cYour Stoppers are: Coin Lost > ' + config.stop.value + '; Minutes > ' + config.end.value + '; Profit > ' + config.profit.value, 'color:Purple; font-weight:bold');
        console.log('%c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~','color:Purple; font-weight:bold');
        if (config.stop.value > currency.amount) {
            MaxBet = (currency.amount / 10);
            config.stop.value = currency.amount * 0.95;
            console.log('%c[WARNING]: Stop Loss Updated to ' + config.stop.value, 'color:Orange; font-weight:bold');
        }
    }
    DisplayGreeting = "True";
    if (GotHistory == "False") {
        getnanohistory();
        GotHistory = "True";
        console.log(ScriptHistory);
        LastShrek = [];
        LastTrain = [];
    }
//
//
//
//Everything above here only runs 1 time
    console.log(' ----------------------------');
    CurrentGameID = (LastGameID + 1);
    console.log('[Round ID]: ' + CurrentGameID);
    if (StrategyFound == "False") {
        strategy();
    }
//Checks User Parameters for Stopping Script
    checkstoppers();
    CurrentBet = BaseBet;
    MaxIndex = Math.floor(Math.random() * MaxIndex);
    CurrentMultiplier = GetNumber;
    CurrentBet = (CoinLost  + BaseBet) / CurrentMultiplier;
    checkbet();
    if (BetYet == "False") {
        engine.bet(CurrentBet, CurrentMultiplier);
        console.log("[Betting] " + CurrentBet.toFixed(7) + " at " + CurrentMultiplier + "x");
        log.info("[Betting] " + CurrentBet.toFixed(7) + " at " + CurrentMultiplier + "x");
    }
    BetYet = "True";
});
function getnanohistory() {
    History = engine.getHistory();
    for (i = 0; i < History.length; i++) {
        ScriptHistory.push(History.crash / 100);
        RoundsViewed++;
    }
}
function strategy() {
// Is there a Payout with a 80% Confidence or Higher? If not, pause.
    findconfidence();
// Which Payout has highest confidence based upon history & math?
    findlargestindex();
//    console.log('[Index] ' + '(' + MaxIndex + ')' + ' PayOut: ' + MultiplierArray[MaxIndex] + ' [Largest Confidence] ' + PayOutConfidence[MaxIndex]);
//    console.log(' PayOut ' + MultiplierArray[MaxIndex] + '; Confidence Level ' + PayOutConfidence[MaxIndex] + ' %');
    GetNumber = MultiplierArray[MaxIndex];
// Randomize the PayOut
    randompayout();
//    console.log('[Get Number] is: ' + GetNumber);
    checkforstreaks();
    CurrentMultiplier = GetNumber;
    StrategyFound = "True";
// Which Payout has highest confidence based upon streakiness of rounds?
}
function randompayout() {
    if (LastResult == "Lost" && CurrentMultiplier > 1.98) {
        GetNumber = (CurrentMultiplier * 0.95);
    }else if (LastResult =="Lost") {
        GetNumber = (CurrentMultiplier * 1.25);
    }
    GetNumber = GetNumber * 100;
    GetNumber = Math.floor(Math.random() * GetNumber) + 211;
    GetNumber = GetNumber / 100;
    if (isNaN(GetNumber)) {
        GetNumber = Math.floor(Math.random() * 311) + 251;
        GetNumber = GetNumber / 100;
    }
}
function checkforstreaks() {
    threeafterthree();
    minitrains();
    prevpayouts();
    htrains();
    tens();
//    hundred();
    HistorySlice = 50;
}
function tens() {
    FindThisMultiplier = 9.99;
    HistorySlice = 10;
    historyfilter();
    if (FilteredArray.length > 2) {
        CurrentBet = BaseBet;
        CurrentMultiplier = 3.11;
        console.log('[Bet Adjustment] PayOut +10x = ' + FilteredArray.length);
    }
}
function hundred() {
    FindThisMultiplier = 69;
    HistorySlice = 100;
    historyfilter();
    if (Enable100 == "True" && (CurrentGameID - Enable100ID) > 25) {
        Enable100 = "False";
    }
    if (Enable100 == "True" && LastResult == "Won") {
        Enable100 = "False";
    }
    if (FilteredArray.length === 0) {
        if (Enable100 == "True") {
            CurrentMultiplier = 88.00;
            CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
            console.log('Manadory run at 100x');
        }
    }
}
function historyfilter() {
    Array2Filter = ScriptHistory.slice(0,[HistorySlice]);
    FilteredArray = Array2Filter.filter(function (e) {
        return e > FindThisMultiplier;
    });
}
function htrains() {
    if (Red > 5) {
        CurrentMultiplier = Math.floor(Math.random() * 311) + 199;
        CurrentMultiplier = CurrentMultiplier / 100;
        CurrentBet = ((CoinLost + BaseBet) / (CurrentMultiplier - 1));
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] Reds > 5');
    }
    if (Red > 9) {
        CurrentMultiplier = Math.floor(Math.random() * 488) + 235;
        CurrentMultiplier = CurrentMultiplier / 100;
        CurrentBet = ((CoinLost + BaseBet) / (CurrentMultiplier - 1));
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] Reds > 5');
    }
}
function prevpayouts() {
    if (ScriptHistory[0] > 5.00 || ScriptHistory[1] > 5.00 || ScriptHistory[2] > 5.00) {
        CurrentMultiplier = Math.floor(Math.random() * 299) + 233;
        CurrentMultiplier = CurrentMultiplier / 100;
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] 5x in last 3 rounds');
    }
    if (LastResult == "Won") {
        CurrentMultiplier = Math.floor(Math.random() * 311) + 215;
        CurrentMultiplier = CurrentMultiplier / 100;
        GetNumber = CurrentMultiplier;
        CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
    }

}
function minitrains() {
    if (Green > 3 && LastResult == "Lost") {
        CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
        CurrentMultiplier = 2.14;
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] Green x3 & Loss');
    }
    if (Green > 3 && LastResult == "Won") {
        CurrentBet = BaseBet;
        CurrentMultiplier = 3.11;
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] Green x3 & Won');
    }
    if (Red > 3 || Green > 3) {
        CurrentMultiplier = Math.floor(Math.random() * 311) + 199;
        CurrentMultiplier = CurrentMultiplier / 100;
        CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
        GetNumber = CurrentMultiplier;
        console.log('[Bet Adjustment] Red/Green x3');
    }
}
function threeafterthree () {
    if (ScriptHistory[0] > 2.99 && ScriptHistory[1] > 2.99 && ScriptHistory[2] > 2.99) {
        if ((CurrentGameID - LastTrain) > 15 && (CurrentGameID - LastShrek > 10)) {
            if (LastResult == "Won") {
                CurrentBet = BaseBet * 2;
                CurrentMultiplier = 2.14;
                GetNumber = CurrentMultiplier;
                console.log('[Bet Adjustment] 3x after 3 rounds & Won');
            }
            if (LastResult == "Lost") {
                CurrentMultiplier = Math.floor(Math.random() * 288) + 211;
                CurrentMultiplier = CurrentMultiplier / 100;
                CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
                GetNumber = CurrentMultiplier;
                console.log('[Bet Adjustment] 3x after 3 rounds & Lost');
            }
        }
    }
    
}
function findconfidence() {
    PayOutConfidence = [];
    for (i = 0; i < PayOutPercents.length; i++) {
        if (PayOutPercents < 100) {
            PayOutConfidence = (100 - PayOutPercents);
            PayOutConfidence = Math.abs(PayOutConfidence);
            PayOutConfidence = (PayOutConfidence + 25);
        }else if (PayOutPercents == 100) {
            PayOutConfidence = 25;
        }else{
            PayOutConfidence = 0;
        }
        if (i > 3) {
            PayOutConfidence = (PayOutConfidence - 25);
        }
        if (i > 5) {
            PayOutConfidence = (PayOutConfidence - 25);
        }
        if (PayOutConfidence < 0) {
            PayOutConfidence = 0;
        }
    }
}
function findlargestindex() {
    IndexMax = PayOutConfidence[0];
    MaxIndex = 0;
    for (var i = 1; i < PayOutConfidence.length; i++) {
        if (PayOutConfidence >= IndexMax) {
            MaxIndex = i;
            IndexMax = PayOutConfidence;
        }
    }
}

function checkbet() {
    MinimumBet = currency.minAmount;
    BaseBet = config.bet.value;
//Check bet against player bankroll --- For what parameters???
//Check bet against site bankroll  - is there enough to win all we want?
    if (CurrentBet < BaseBet) {
        CurrentBet = BaseBet;
    }
    if (CurrentBet < MinimumBet) {
        CurrentBet = MinimumBet;
    }      
    if (CurrentBet > MaxBet) {
        CurrentBet = MaxBet;
        console.log('[Bet Adjustment] Survive Losses');
    }
    if (CurrentBet > currency.maxAmount) {
        CurrentBet = currency.maxAmount;
        MaxBet = currency.maxAmount / 5;
        console.log('[Bet Adjustment] Maximum Bet allowed by platform');
    }
    if (CurrentBet > LargestBet[0]) {
        LargestBet[0] = CurrentBet;
        LargestBet[1] = CurrentMultiplier;
    }
}
engine.on('GAME_ENDED', function (data) {
    console.log(data);
    RoundsViewed++;
    PrevCashOut = data.crash / 100;
    LastGameID = data.gameId;
    if (GameInfoLogged == "False") {
        loglastcrash(data);
    }
    updateplayer();
    updatestats();
    CurrentGameID = CurrentGameID.toString();
    if (CurrentGameID.endsWith('0')) {
        console.log(version);
        console.log('%c~~Nov~~~~ Update Completed ~~~~2019~~','color:blue;font-weight:bold');
        log.info('~~Nov~~~~ Update Completed ~~~~2019~~');
        log.info(version);
    }
    if (UpdateBets == "True" && LastResult == "Won") {
        betupdate();
        UpdateBets = "False";
    }
    BetYet = "False";
    StrategyFound = "False";
    LoggedBetData = "False";
    Paused = "False";
});
function loglastcrash(data) {
    if (PrevCashOut > LargestMulitplier) {
        LargestMulitplier = PrevCashOut;
    }
    if (PrevCashOut < 2.01) {
        Red++;
        Green = 0;
        if (Red == 6) {
            if (LastTrain === 0) {
                Trains = [];
            }
            Trains.unshift(CurrentGameID);
            Gap = CurrentGameID - LastTrain;
            AverageGap = (AverageGap + Gap) / Trains.length;
            console.log('Logging Round ' + CurrentGameID + ' as H Train');
            console.log('Average Gap ' + AverageGap + ' between H Trains');
            log.info('Logging Round ' + CurrentGameID + ' as H Train');
            console.log('Gap from last H Train ' + Gap + ' rounds');
            log.info('Gap from last H Train ' + Gap + ' rounds');
            LastTrain = CurrentGameID;
        }
    }else{
        Green++;
        Red = 0;
        if (Green == 6) {
            LastShrek = CurrentGameID;
            console.log('Logging Round ' + CurrentGameID + ' as Shrek');
            log.info('Logging Round ' + CurrentGameID + ' as Shrek');
        }
    }
    if (CoinLost > MostLost) {
        MostLost = CoinLost;
    }
    if (ScriptHistory.unshift(PrevCashOut) > 999) ScriptHistory.pop();
//Check for if round was played
    if (data.wager > 0) {
        TotalBets = TotalBets + CurrentBet;
        data.wager = CurrentBet;
        IsPlaying = "True";
        winorlose(data);
        RoundsPlayed++;
        LastBet = CurrentBet;
        LastMultiplier = CurrentMultiplier;
    }else{
        LastResult = "Not Played";
    }
}
function winorlose (data) {
    if (data.cashedAt > 0) {
        WonAmount = ((CurrentBet * CurrentMultiplier) - CoinLost - CurrentBet);
        Profit = Profit + WonAmount;
        LastResult = "Won";
        Wins++;
        Losses = 0;
        if (Profit > ATHProfit) {
            ATHProfit = Profit;
            CoinLost = 0;
        }else{
            CoinLost = ATHProfit - Profit;
        }
        log.info("[Profit] " + WonAmount);
        console.log('%c[Result] Round Won. ' + 'Net Profit of ' + WonAmount.toFixed(7),'color:green');
    }else{
        LastResult = "Lost";
        Losses++;
        Wins = 0;
        CoinLost = CoinLost + CurrentBet;
        console.log('%c[Result] Round ' + LastResult,'color:red');
        log.info('Round Lost');
    }
    if (Losses > MaxLossesEncountered) {
        MaxLossesEncountered = Losses;
        console.log("Encountered Streak of " + Losses + " Losses Before Win");
        log.info("Encountered Streak of " + Losses + " Losses Before Win");
    }
    if (Losses > 3) {
        console.log('%c[Coin Lost] Cumulative Since Last Win: ' + CoinLost.toFixed(7),'color:red');
        log.info('%c[Coin Lost] Cumulative Since Last Win: ' + CoinLost.toFixed(7));
    }
}
function updatestats() {
    //Lists PayOuts under 10x for last 50 rounds
    for (i = 0; i < MultiplierArray.length; i++) {
        FindThisMultiplier = MultiplierArray;
        FindMultiplierHistory();
        PayOutPercents = ThisAverage;
    }
    //Lists PayOuts 10x and over for last 100 rounds
    if (RoundsViewed > 100) {
        HistorySlice = 100;
        CurrentGameID = CurrentGameID.toString();
        if (CurrentGameID.endsWith('0')) {
            console.log("In the last " + HistorySlice + " rounds there was: ");
        }
        for (i = 0; i < LMultiplierArray.length; i++) {
            FindThisMultiplier = LMultiplierArray;
            FindMultiplierHistory();
        }
    }
//    console.log(PayOutPercents);
}
function FindMultiplierHistory() {
    FindThisMultiplier = (FindThisMultiplier - 0.01);
    Array2Filter = ScriptHistory.slice(0,[HistorySlice]);
    FilteredArray = Array2Filter.filter(function (e) {
        return e > FindThisMultiplier;
        });
    FindThisMultiplier = (FindThisMultiplier + 0.01);
    DisplayTimesSeen();
    findpercents();
}
function DisplayTimesSeen() {
    FindShouldHave = (Array2Filter.length / FindThisMultiplier);
    FindShouldHave = (FindShouldHave * 100);
    FindShouldHave = Math.round(FindShouldHave);
    FindShouldHave = (FindShouldHave / 100);
    CurrentGameID = CurrentGameID.toString();
    if (CurrentGameID.endsWith('0')) {
        console.log("PayOuts " + FindThisMultiplier + "x & Higher " + Math.round(FindShouldHave) + " times. There were " + FilteredArray.length);
    }
}
function findpercents() {
    ThisAverage = FilteredArray.length / Math.round(FindShouldHave);
    ThisAverage = (ThisAverage * 100);
    ThisAverage = Math.round(ThisAverage);
}
function updateplayer() {
    EndBalance = currency.amount;
    NetProfit = EndBalance - StartBalance;
    var ProfitPercent = (NetProfit / StartBalance) * 100;
    EndTime = new Date();
    TimeDiff = ((EndTime - StartTime) / 1000 )/ 60;
    ProfPerMin = (Profit / TimeDiff);
    CurrentGameID = CurrentGameID.toString();
    if (CurrentGameID.endsWith('0')) {
        console.log(" ");
        log.info(" ");
        console.log('%c~~~~~~~~~~ NubsScript Update ~~~~~~~~~~','color:blue;font-weight:bold');
        log.info('~~~~~  NubsScript Update  ~~~~~');
        figuretime();
        console.log("Begining Bank " + StartBalance.toFixed(7) + " Current Bank " + currency.amount.toFixed(7) + " " + currency.currencyName);
        log.info("Begining Bank " + StartBalance.toFixed(7) + " Current Bank " + currency.amount.toFixed(7) + " " + currency.currencyName);
        console.log("Current Base Bet: " + config.auto.value + " "+ BaseBet  + " " + currency.currencyName);
        log.info("Current Base Bet: " + BaseBet + " " + currency.currencyName);
        console.log("Session Net Profit " + NetProfit.toFixed(7) + ' ' + currency.currencyName + " or " + ProfitPercent.toFixed(2) + "% ");
        log.info("Session Net Profit " + NetProfit.toFixed(7) + ' ' + currency.currencyName + " or " + ProfitPercent.toFixed(2) + "% ");
        console.log("Profit Per Minute " + ProfPerMin.toFixed(7) + ' ' + currency.currencyName);
        log.info("Profit Per Minute " + ProfPerMin.toFixed(7) + ' ' + currency.currencyName);
        console.log("Highest PayOut Seen: " + LargestMulitplier + "x");
        log.info("Highest PayOut Seen: " + LargestMulitplier + "x");
        console.log("Cumulative Amount Bet: " + TotalBets.toFixed(7) + " " + currency.currencyName);
        log.info("Cumulative Amount Bet: " + TotalBets.toFixed(7) + " " + currency.currencyName);
        console.log("Biggest Bet Placed " + LargestBet[0] + " at " + LargestBet[1] + "x");
        log.info("Biggest Bet Placed " + LargestBet[0] + " at " + LargestBet[1] + "x");
        console.log("Largest Loss: " + MostLost.toFixed(7) + " " + currency.currencyName + " on " + MaxLossesEncountered + " consecutive losses");
        log.info("Largest Loss: " + MostLost.toFixed(7) + " " + currency.currencyName + " on " + MaxLossesEncountered + " consecutive losses");
        if (Trains.length > 2) {
            console.log("Hilarious Train IDs:");
            console.log(Trains);
        }
        console.log("In the last " + HistorySlice + " rounds there was: ");
    }
    RoundsViewed = RoundsViewed.toString();
    if (RoundsViewed.endsWith('00') && config.auto.value == "Script") {
        UpdateBets = "True";
    }
}
function figuretime() {
// get total seconds between the times
var delta = Math.abs(StartTime - EndTime) / 1000;
// calculate (and subtract) whole days
var days = Math.floor(delta / 86400);
delta -= days * 86400;
// calculate (and subtract) whole hours
var hours = Math.floor(delta / 3600) % 24;
delta -= hours * 3600;
// calculate (and subtract) whole minutes
var minutes = Math.floor(delta / 60) % 60;
delta -= minutes * 60;
// what's left is seconds
var seconds = delta % 60;  // in theory the modulus is not required
if (days > 0) {
    console.log("Viewed " + RoundsViewed + " Rounds in " + days + " days " + hours + " hours " + minutes + " minutes");
    log.info("Viewed " + RoundsViewed + " Rounds in " + days + " days " + hours + " hours " + minutes + " minutes");
}else if (hours > 0) {
    console.log("Viewed " + RoundsViewed + " Rounds in " + hours + " hours " + minutes + " minutes");
    log.info("Viewed " + RoundsViewed + " Rounds in " + hours + " hours " + minutes + " minutes");
}else{
    console.log("Viewed " + RoundsViewed + " Rounds in " + minutes + " minutes");
    log.info("Viewed " + RoundsViewed + " Rounds in " + minutes + " minutes");
}
}
function checkstoppers() {
    if (TimeDiff > config.end.value && LastResult == "Won") {
        log.info("Stopped Due to User Parameters (Minutes)");
        console.log("Stopped Due to User Parameters (Minutes)");
        engine.stop();
    }
    if (Profit > config.profit.value && LastResult == "Won") {
        log.info("Stopped Due to User Parameters (Profit)");
        console.log("Stopped Due to User Parameters (Profit)");
        engine.stop();
    }
    if (CoinLost > StopLossCoin) {
        log.info("Stopping Due to User Parameters");
        console.log("Stopping Due to User Parameters (Coin Lost)");
        engine.stop();
    }
}
function betupdate() {
    BaseBet = currency.amount / 15000;
    if (BaseBet < currency.minAmount) {
        BaseBet = currency.minAmount;
        console.log("Bankroll too small. Attempting script by user's command");
    }
    config.bet.value = BaseBet;
    MaxBet = (currency.amount / 10);
    config.stop.value = currency.amount * 0.98;
    console.log('%c[WARNING]: Stop Loss Updated to ' + config.stop.value, 'color:Orange; font-weight:bold');
    console.log('%c[WARNING]: Base Bet Updated to ' + BaseBet, 'color:Orange; font-weight:bold');
}

}

Link to comment
Share on other sites

You need to be a member in order to leave a comment

Sign up for a new account in our community. It's easy!

Register a new account

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...