luftwaffe Posted February 10, 2017 Report Posted February 10, 2017 I have x accounts for which I need to create a SteamUser client. I did some quick testing and found that the following code is not working. Any suggestions on why? var initializeClients = function(data) { var steamuser = require('steam-user'); var steamtotp = require('steam-totp'); var steamtrader = require('steam-tradeoffer-manager'); var client = []; var manager = []; for (var index in data) { var account = data[index]; client[index] = new steamuser(); manager[index] = new TradeOfferManager({ "steam": client[index], "domain": "example.com", "language": "en" }); client[index].logOn({ 'accountName': account.username, 'password': account.password, 'twoFactorCode': totp.generateAuthCode(account.shasec) }); }; }; //x minutes/hours later this function gets called var clientLogOff = function(index) { client[index].logOff(); } Thanks in advance for any input on this. Quote
Dr. McKay Posted February 11, 2017 Report Posted February 11, 2017 Doesn't look like TradeOfferManager is defined. In the future, please include any error messages and stack traces. Quote
luftwaffe Posted February 11, 2017 Author Report Posted February 11, 2017 (edited) Doesn't look like TradeOfferManager is defined. In the future, please include any error messages and stack traces.The code I posted was just to help explain what I wanted to do, it was a quick copy and paste from my working code which while not having the intended effect (read: doing anything) did not throw any errors - sorry for the lack of clarification. I have by now figured out the problem, I completely forgot that SteamUser does not automatically set the EPersonaState to online upon loggingOn which is why the client[index].gamesPlayed('test') I used to test my code also didn't work. This code now works shame on me for overseeing something obvious like that. Edited February 11, 2017 by luftwaffe 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.