feroff Posted July 18, 2023 Report Posted July 18, 2023 Hello. I want to make a script that keeps track of the balance on the account and the number of items in the inventory. If the balance has changed, I want to know how many items I currently have in my inventory. balance tracking works. Tracking items in the inventory no client.on('loggedOn', function() { client.gamesPlayed([730]); }); client.on('wallet', function(hasWallet, currency, balance) { csgo.on('connectedToGC', () => { let items = csgo.inventory.length - 2; console.log(items); }); console.log(username + ' | ' + SteamUser.formatCurrency(balance, currency) + ' | ' + new Date().toLocaleString()); let money = SteamUser.formatCurrency(balance, currency); }); I haven't done programming before, maybe the answer to my question is very easy Quote
Dr. McKay Posted July 18, 2023 Report Posted July 18, 2023 You're adding a new connectedToGC handler every time you get the wallet event emitted, which isn't what you want to do. 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.