Advertisement
Almatrass

nodeJS Steam Tutorial 1

Apr 9th, 2018
2,944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // index.js
  2. const SteamUser = require('steam-user');
  3. const SteamTotp = require('steam-totp');
  4. const config = require('./config');
  5.  
  6. const client = new SteamUser();
  7.  
  8. const logInOptions = {
  9.     accountName: config.accountName,
  10.     password: config.password,
  11.     twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret)
  12. };
  13.  
  14. client.logOn(logInOptions);
  15.  
  16. client.on('loggedOn', () => {
  17.     console.log('logged on');
  18.    
  19.     client.setPersona(SteamUser.Steam.EPersonaState.Online);
  20.     client.gamesPlayed(440);
  21. });
  22.  
  23. // config.js
  24. module.exports = {
  25.     accountName: 'your username',
  26.     password: 'your password',
  27.     sharedSecret: 'your shared secret'
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement