Hi guys i also got a code question , this is my first post on this forum. I play bustabit sometimes and i wanted to make a script which get the bonuses.
What i'am trying to do at the moment is to show in the console who cashouts, when he cashouts and the cashout amount.
In the API i see this :
/**
* 'cashed_out': Event called every time the server cash out a user
* if we call cash out the server is going to call this event
* with our name.
* @param {object} resp - JSON payload
* @param {string} resp.username - The player username
* @param {number} resp.amount - The amount the user cashed out
* @param {number} resp.stopped_at -The percentage at which the user cashed out
*/
So i wrote this
engine.on('cashed_out', function(resp) {
console.log('The player ', resp.username, 'cashed out at ', resp.stopped_at/100, '. The cashed out amount is', resp.amount);
});
Result in the console :
The player ghounit cashed out at 9 . The cashed out amount is undefined
So my question is :
I dont know why resp.amount is "undefined"
since it works for resp.username and resp.stopped_at
I need something to show the cashout amounts since i would like to make a script based on this.
Thanks!