node-steam-guide icon indicating copy to clipboard operation
node-steam-guide copied to clipboard

Issue with node project.js

Open maxol2 opened this issue 6 years ago • 2 comments

This is the code i have in the project1.js file. (mine is named bot.js):

const SteamUser = require('steam-user');
const SteamTotp = require('steam-totp');

const client = new SteamUser();

const logOnOptions = {
  accountName: 'my username',
  password: 'my password',
  twoFactorCode: SteamTotp.generateAuthCode('your_steam_shared_secret')
};

client.logOn(logOnOptions);

client.on('loggedOn', () => {
  console.log('Logged into Steam');

  client.setPersona(SteamUser.Steam.EPersonaState.Online);
  client.gamesPlayed(440);
});

code in the config.json file:

{
	"username":"my username",
	"password":"my password"
}

Everytime i use cmd (which i assume is the right thing to use) to run "node bot.js (project1.js)", nothing happens.

I'm very new to programming so this might be a stupid question :)

maxol2 avatar Aug 03 '19 09:08 maxol2

I'm also having this issue.

Pokepunch avatar Aug 19 '19 17:08 Pokepunch

remove "Steam." on the line " client.setPersona(SteamUser.Steam.EPersonaState.Online);"

2cab avatar Feb 24 '20 23:02 2cab