Jump to content

Crash game script function list


Tayuh

Recommended Posts

Hey, 

I was wondering if there's any kind of documentation for crash script or even a list of function ? Or maybe a way to find them ? 
Because the "help?" section of the game doesn't says much about it and the scripts doesn't seems to show everything. 

For example, I've seen some people are using "game.history[0].crash" function, not sure what it means exactly yet, but I suppose there are other hidden function such as this one.
Also wondering is there's any way to catch error such as "network error" or other kind of system error like theses ? Something like a try catch ?

Thanks ! 
Good luck & Have fun. 

 

Link to comment
Share on other sites

so the object you meantioned "game.history[0].crash"  is actually an object "game" which is the gameengine object, history is a property of game and is an array of previous games. They used to limit tis to 20 but now i believe they bumped it up to 50. crash is a property of a individual game result and refers to the value at which the game crashed at.  Other propertie on that would be like gameId... I don't know if they include all of the properties that you can get client side from the same object crash.history, but they should be similar and that one contains

  1. cashedAt: 0
  2. crash: 100
  3. gameId: 5459538
  4. hash: "61f6ea951fa2474ca9334780a12a50dc27a938e1f039866ddcabb32f03b25fbf"
  5. odds: 1
  6. wager: 0

You asked about actual methods and I am pretty sure everything you could want is already in the examples. The only thing not rerally in there because there are better ways to do it is subscribing to the different game events.

game.bet(betAmount, payoutAmount)
game.stop()

 

To write to the logout put window there for the game you have 
log.info
log.error
log.success
Which the only difference is the color in which they write to that log window.

currency.amount (the amount in your wallet when the script starts it will not update)

currency.minAmount (the min bet amount for the selected currency)

currency.maxAmount (the max bet amount for the selected currency)

currency.currencyName (the name of the coin that is selected)

 

For error handling its javascript so you can use the same try catch pattern as any other javascript just like is done in c# or java or most other languages.  I don't know what network error your getting, but you can also write a client script to restart your script if it is stopped there is a forum post with the code to do that 3 or 4 different ways in here.  If you are writing the whole script client says there is an error handler that can be used with the promisses to automatically retry promises that return errors.  Other than that google is your friend.

Link to comment
Share on other sites

Thank you for answering Skele, your explanation are very clear, my questions are answered. 


About handling errors, I suppose restarting the script would do the trick. So I'll just stick to your solution from another post :

Quote from Skele :  

setInterval(function(){
     if(!crash.script.isRunning)
     {
           crash.script.start()
     }
},
1000)

for hash dice you will likely have to change the "crash" to be "hdg" but after that it should work.


Few details about this in case people wonder : 
-Launch your ingame script.
-Write this in the F12 console, press enter
--> This will automatically press "Run script" every 1000 miliseconds, if your script is not currently running. 
--> You may close the F12 console, it'll continue running the script automatically.
--> To stop, refresh or close the webbrowser page. 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...