Jump to content

Crash - var currency.amount


Arsouille

Recommended Posts

What errors are you seeing?  In any case, I would try:

var Balance = currency.amount;

 log.success('Balance : ' + Balance);

Link to comment
Share on other sites

can you post your whole script from start to finish and I will take a look?

Link to comment
Share on other sites

Of course.

This is certainly not the cleanest code, I am an amateur 🙂

Very thanks for your help

 

var config = {
    mainTitle: { label: ' Custom Script Title ', type: 'title' },
    bet: { label: 'Base Bet', value: currency.minAmount, type: 'number' },
};

function main () {

var Nbr_Pause = 0;
var Multiple = 1;
var Base_MiseBet = config.bet.value;

var Balance = currency.amount;

var Cashout = 2;
var Multiplication_MiseBet = 2;
var Division_MiseBet = 2;

var Soustraction_MiseBet = 0;
var MiseBet = Base_MiseBet;
var Nbr_Crash_Pause = 0;

var History = [];
var LastGame = History[0];
var LastCrash = 2;


engine.on('GAME_STARTING', function ()
        {
        if (Nbr_Crash_Pause >= Nbr_Pause)
            {
            engine.bet((Multiple * MiseBet), Cashout);
            }
        }
    );


engine.on('GAME_ENDED', function (data)

    {
// Should be changed to:
    History = engine.getHistory();
    LastGame = History[0];
    LastCrash = (LastGame.crash / 100);
    
    if (LastGame.cashedAt)
        {
    if ((MiseBet - Soustraction_MiseBet) > Base_MiseBet)
         {
             MiseBet = MiseBet - Soustraction_MiseBet;
         Soustraction_MiseBet = MiseBet / Division_MiseBet;
             }    
    else
        {
            MiseBet = Base_MiseBet;
            }
       
        }

    else
        {
        MiseBet = MiseBet * Multiplication_MiseBet;
        Soustraction_MiseBet = MiseBet / Division_MiseBet;
        }

    if (LastCrash < Cashout)
        {
        Nbr_Crash_Pause = Nbr_Crash_Pause + 1;
        }

    else if (LastCrash >= Cashout)
        {
        Nbr_Crash_Pause = 0;
        }

console.log('MiseBet : ' + MiseBet);
console.log('Soustraction_MiseBet : ' + Soustraction_MiseBet);
log.success('Balance : ' + Balance);


    }
    );
}

Link to comment
Share on other sites

Interesting.  When I put your code into Crash it runs.  I removed the semi colon highlighted below as I don't think you need it but it was running either way.

 

var config = {
    mainTitle: { label: ' Custom Script Title ', type: 'title' },
    bet: { label: 'Base Bet', value: currency.minAmount, type: 'number' },
}

function main () {

var Nbr_Pause = 0;
var Multiple = 1;
var Base_MiseBet = config.bet.value;

var Balance = currency.amount;

var Cashout = 2;
var Multiplication_MiseBet = 2;
var Division_MiseBet = 2;

var Soustraction_MiseBet = 0;
var MiseBet = Base_MiseBet;
var Nbr_Crash_Pause = 0;

var History = [];
var LastGame = History[0];
var LastCrash = 2;


engine.on('GAME_STARTING', function ()
        {
        if (Nbr_Crash_Pause >= Nbr_Pause)
            {
            engine.bet((Multiple * MiseBet), Cashout);
            }
        }
    );


engine.on('GAME_ENDED', function (data)

    {
// Should be changed to:
    History = engine.getHistory();
    LastGame = History[0];
    LastCrash = (LastGame.crash / 100);
    
    if (LastGame.cashedAt)
        {
    if ((MiseBet - Soustraction_MiseBet) > Base_MiseBet)
         {
             MiseBet = MiseBet - Soustraction_MiseBet;
         Soustraction_MiseBet = MiseBet / Division_MiseBet;
             }    
    else
        {
            MiseBet = Base_MiseBet;
            }
       
        }

    else
        {
        MiseBet = MiseBet * Multiplication_MiseBet;
        Soustraction_MiseBet = MiseBet / Division_MiseBet;
        }

    if (LastCrash < Cashout)
        {
        Nbr_Crash_Pause = Nbr_Crash_Pause + 1;
        }

    else if (LastCrash >= Cashout)
        {
        Nbr_Crash_Pause = 0;
        }

console.log('MiseBet : ' + MiseBet);
console.log('Soustraction_MiseBet : ' + Soustraction_MiseBet);
log.success('Balance : ' + Balance);


    }
    );
}

Link to comment
Share on other sites

Big Thanks.

Miracles have to happen to believe in them a little longer 🙂

I copied my/our code and past it back, and it also work for me ....

I was able to finish my tought with this : if (((MiseBet - Soustraction_MiseBet) > Base_MiseBet) && (currency.amount < Balance))

Thanks again

Link to comment
Share on other sites

one extra thought for you.

You will notice once you start using it that the balance it displays is always what you started the game with after initially running the script.  you will have to create custome logic to come up with a actively monitored balance.

Link to comment
Share on other sites

  • 1 month later...

I don't know what semi colon you were talking about as i don't see one highlighted.  But i do see a closing curly brace highlighted that that one should be closing out the closing out the config variable 

var config = {some dictionary type declaration }

without it the main function becomes a method on the config object. which is clearly not right.

 

var config = {

                             some dictionary stuff

                             function main(){}

                     }

Link to comment
Share on other sites

On 2/11/2021 at 7:11 PM, Arsouille said:

Exact

It's the reason why just after GAME_ENDED I receive my new Balance

if (currency.amount > Balance)
    {
    Balance = currency.amount;
    }

 

We can close the Topip. thanks

This not work

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...