TextDynasty Posted January 26, 2019 Report Share Posted January 26, 2019 So I planned to write a script for the bot to have a background check. const SteamUser = require('steam-user'); var client = new SteamUser(); var steamid = '76561198302774496'; client.getSteamLevels([steamid], function(results){ console.log(results); }) However, it didn't show the results to the console. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted January 26, 2019 Report Share Posted January 26, 2019 It doesn't look like you ever logged on. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted January 27, 2019 Author Report Share Posted January 27, 2019 It doesn't look like you ever logged on.Oh yeah I forgot to log in. But after login, there's still nothing in the console. const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const config = require('./config'); var client = new SteamUser(); const logOnOptions = { accountName: config.accountName, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.shared_secret) }; client.logOn(logOnOptions); client.getSteamLevels(['76561198302774496'], function(results){ console.log(results); }) Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted January 27, 2019 Report Share Posted January 27, 2019 You seem to not have an understanding of how async JavaScript code works. Just because logOn was called doesn't mean you're actually logged on. You need to wait for the loggedOn event. Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted January 27, 2019 Author Report Share Posted January 27, 2019 You seem to not have an understanding of how async JavaScript code works. Just because logOn was called doesn't mean you're actually logged on. You need to wait for the loggedOn event.I edited it a bit const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const config = require('./config'); var client = new SteamUser(); const logOnOptions = { accountName: config.accountName, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', () => { var steamid = '76561198302774496'; client.setPersona(1); console.log('LogOn'); client.getSteamLevels([steamid], function(requests){ var level = requests.steamid; console.log(level); //console.log(requests); works fine but I want it to show the level of the steamid only }) }); Quote Link to comment Share on other sites More sharing options...
TextDynasty Posted January 28, 2019 Author Report Share Posted January 28, 2019 I edited it a bit const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const config = require('./config'); var client = new SteamUser(); const logOnOptions = { accountName: config.accountName, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', () => { var steamid = '76561198302774496'; client.setPersona(1); console.log('LogOn'); client.getSteamLevels([steamid], function(requests){ var level = requests.steamid; console.log(level); //console.log(requests); works fine but I want it to show the level of the steamid only }) }); Solved const SteamUser = require('steam-user'); const SteamTotp = require('steam-totp'); const config = require('./config'); var client = new SteamUser(); var steamid = ''; //SteamID64 you want to check const logOnOptions = { accountName: config.accountName, password: config.password, twoFactorCode: SteamTotp.generateAuthCode(config.shared_secret) }; client.logOn(logOnOptions); client.on('loggedOn', () => { client.setPersona(1); console.log('LogOn'); client.getSteamLevels([steamid], function(requests){ var level = requests[steamid]; console.log(level); }) }); Quote Link to comment Share on other sites More sharing options...
PonyExpress Posted March 5, 2019 Report Share Posted March 5, 2019 How many users can I check at once? Can I, for example, get the levels of all users on my friends list or it is not recommended? Quote Link to comment Share on other sites More sharing options...
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.