Advertisement
Guest User

Untitled

a guest
Apr 14th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. /*
  2. * IMPORTS: Libraries that steam-yellow uses.
  3. */
  4. const SteamUser = require('steam-user');
  5. const readline = require('readline');
  6. const client = new SteamUser();
  7.  
  8. // NodeJS Readline
  9. const rl = readline.createInterface({
  10. input: process.stdin,
  11. output: process.stdout
  12. });
  13.  
  14. // Overwrite the SteamUser library's persona flags to make it yellow
  15. SteamUser.prototype.setPersona = function (state, name) {
  16. this._send(SteamUser.EMsg.ClientChangeStatus, {
  17. "persona_state": state,
  18. "persona_state_flags": 3847, // This makes it yellow
  19. "player_name": name
  20. });
  21. };
  22. // Verbosing info to user
  23. console.log("Welcome to yellow-steam!");
  24. console.log("Join our discord and steam group!");
  25. console.log("WEBSITE: https://drakewitt.github.io/steam-yellow/");
  26.  
  27. // Prompt for username
  28. rl.question('Username? ', (answer) => {
  29.  
  30. let username = answer;
  31. rl.question('Password? ', (answer) => {
  32. let password = answer;
  33. const logOnOptions = {
  34. accountName: username,
  35. password: password
  36. };
  37.  
  38. client.logOn(logOnOptions);
  39.  
  40. rl.close();
  41. });
  42. });
  43.  
  44. client.on('loggedOn', () => {
  45. client.setPersona(SteamUser.Steam.EPersonaState.Online);
  46. console.log("Logged In! Press CTRL and C to stop.");
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement