Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. var SteamUser = require('steam-user');
  2. var SteamStore = require('steamstore');
  3. var readlineSync = require('readline-sync');
  4. var fs = require('fs');
  5.  
  6. var client = new SteamUser();
  7. var user = new SteamUser();
  8.  
  9. var username, password;
  10.  
  11. var cookieArray = {};
  12.  
  13. client.logOn();
  14.  
  15. client.on('loggedOn', function(details) {
  16. console.log('>> Successfully logged onto Steam anonmyously.');
  17. console.log('>> Beginning process of account creation:');
  18. createAccount();
  19. });
  20.  
  21. user.on('loggedOn', function(details) {
  22. console.log('>> Logged onto new account.');
  23. user.webLogOn();
  24. verifyEmail();
  25. });
  26.  
  27. user.on('webSession', function(sessionID, cookies) {
  28. cookieArray = cookies;
  29. });
  30.  
  31. function createAccount() {
  32. username = readlineSync.question('Username: ');
  33. password = readlineSync.question('Password: ');
  34. var email = readlineSync.question('Email: ');
  35. client.createAccount(username, password, email, function (result) {
  36. if (result == SteamUser.Steam.EResult.OK) {
  37. console.log('>> Account created successfully.');
  38. createAccount();
  39. } else if (result == SteamUser.Steam.EResult.DuplicateName) {
  40. console.log('>> There is already an account with the username ' + username + '. Please reload the application.');
  41. process.exit(1);
  42. } else if (result == SteamUser.Steam.EResult.IllegalPassword) {
  43. console.log('>> Problem with password (greater than 8 chars, too common, etc). Please reload the application.');
  44. process.exit(1);
  45. } else {
  46. console.log('Error while creating the account. Error code: ' + result);
  47. process.exit(1);
  48. }
  49. });
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement