Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const SteamUser = require('steam-user');
  2. const client = new SteamUser();
  3. const Steam = require("steam");
  4.  
  5. const logOnOptions = {
  6.     accountName: 'username',
  7.     password: 'password'
  8. };
  9.  
  10. client.logOn(logOnOptions);
  11.  
  12. client.on('loggedOn', () => {
  13.     console.log('Logged into Steam');
  14.  
  15.     client.setPersona(SteamUser.Steam.EPersonaState.Online, 'GNDGD');
  16.     client.gamesPlayed(440);
  17.     console.log('Playing game with index 440!');
  18.  
  19. });
  20.  
  21. client.on("error", function (error) {
  22.     console.log(error);
  23. });
  24.  
  25. client.on('friendMessage', function (steamID, msg) {
  26.     console.log('Recieved a message: ' + msg + ' from user '+steamID.getSteam3RenderedID())
  27.     if(msg == 'ping'){
  28.         client.chatMessage(steamID, 'pong');
  29.         console.log('Message "pong" sent to '+steamID);
  30.     }
  31.        
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement