Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var SteamUser = require('steam-user');
- var SteamStore = require('steamstore');
- var readlineSync = require('readline-sync');
- var fs = require('fs');
- var client = new SteamUser();
- var user = new SteamUser();
- var username, password;
- var cookieArray = {};
- client.logOn();
- client.on('loggedOn', function(details) {
- console.log('>> Successfully logged onto Steam anonmyously.');
- console.log('>> Beginning process of account creation:');
- createAccount();
- });
- user.on('loggedOn', function(details) {
- console.log('>> Logged onto new account.');
- user.webLogOn();
- verifyEmail();
- });
- user.on('webSession', function(sessionID, cookies) {
- cookieArray = cookies;
- });
- function createAccount() {
- username = readlineSync.question('Username: ');
- password = readlineSync.question('Password: ');
- var email = readlineSync.question('Email: ');
- client.createAccount(username, password, email, function (result) {
- if (result == SteamUser.Steam.EResult.OK) {
- console.log('>> Account created successfully.');
- createAccount();
- } else if (result == SteamUser.Steam.EResult.DuplicateName) {
- console.log('>> There is already an account with the username ' + username + '. Please reload the application.');
- process.exit(1);
- } else if (result == SteamUser.Steam.EResult.IllegalPassword) {
- console.log('>> Problem with password (greater than 8 chars, too common, etc). Please reload the application.');
- process.exit(1);
- } else {
- console.log('Error while creating the account. Error code: ' + result);
- process.exit(1);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement