Raminos Posted December 4, 2019 Report Posted December 4, 2019 (edited) Hello world :3. I'm trying to catch any posible error output when i login. First i tried with try catch, but it didn't work in any way i tried, then investigating i got to know that it needed to be done by adding an event listener to the error event, but when i try to implement the event listener, i get the error that evenlistener is not a function: client.logOn.addEventListener("error", function(err) { if ( err ) { console.log('Critical error!!!!! '+ err + ' Check data of:'+client.steamID) } }, true); Since i already did this post, i'll add one more question; How can i call the value from a diferent place, for example if i want to show the value of "limited" from client.on('accountLimitations'), and call it in a fs.writefile that i have inside client.on('loggedOn', i have to do it by making a global.limited, or how can i?, the other way i tried was client.accountLimitations.limited, but it always gets a undefined or null result. Sorry for the bother and noob questions :v Thanks for taking the time to read my problem. Have a great day. Edited December 4, 2019 by Raminos Quote
Dr. McKay Posted December 5, 2019 Report Posted December 5, 2019 To handle errors: client.on('error', function(err) { // do something with err (which will never be null or undefined in this event) }); You aren't going to be able to do anything with limited inside of the loggedOn event. The data isn't going to be available yet. loggedOn gets emitted when Steam sends us back the logon response saying that your logon was successful, but Steam doesn't send us our account limitations for another second or so, which is why the data is undefined/null inside of the loggedOn event. Raminos 1 Quote
Raminos Posted December 6, 2019 Author Report Posted December 6, 2019 Tnks a lot doc!, very appreciated for the patience answering, Have a great week! Rami~ Dr. McKay 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.