Arsouille Posted February 10, 2021 Posted February 10, 2021 Hi, For my crash script, I try to create a var who contain my balance I try this but I obtain errors var Balance = currency.amount; and console.log('Balance : ' + currency.amount); Where is my mistakes ? Thanks
kenn3676 Posted February 10, 2021 Posted February 10, 2021 What errors are you seeing? In any case, I would try: var Balance = currency.amount; log.success('Balance : ' + Balance);
Arsouille Posted February 11, 2021 Author Posted February 11, 2021 Thanks for our help SyntaxError: Invalid or unexpected token I try to only integrate the var and only the log.success, same error
Farisei Posted February 11, 2021 Posted February 11, 2021 12 hours ago, Arsouille said: Hi, For my crash script, I try to create a var who contain my balance I try this but I obtain errors var Balance = currency.amount; and console.log('Balance : ' + currency.amount); Where is my mistakes ? Thanks
kenn3676 Posted February 11, 2021 Posted February 11, 2021 can you post your whole script from start to finish and I will take a look?
Arsouille Posted February 11, 2021 Author Posted February 11, 2021 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); } ); }
kenn3676 Posted February 11, 2021 Posted February 11, 2021 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); } ); }
Arsouille Posted February 11, 2021 Author Posted February 11, 2021 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
kenn3676 Posted February 11, 2021 Posted February 11, 2021 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.
Arsouille Posted February 11, 2021 Author Posted February 11, 2021 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
Farisei Posted February 11, 2021 Posted February 11, 2021 1 hour ago, 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
Skele Posted April 8, 2021 Posted April 8, 2021 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(){} }
Geka041 Posted April 11, 2021 Posted April 11, 2021 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.