daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Jan 20th, 2017 182 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var username;
  2. var password;
  3. var steamCode;
  4.  
  5. var Steam = require("steam");
  6. var fs = require("fs");
  7. var readline = require("readline");
  8.  
  9. var steam = new Steam.SteamClient();
  10.  
  11. var rl = readline.createInterface({
  12.   input: process.stdin,
  13.   output: process.stdout
  14. });
  15.  
  16. rl.question("Username: ", function(answer) {
  17.     username = answer;
  18.     rl.question("Password: ", function(answer2) {
  19.         password = answer2;
  20.         rl.pause();
  21.         steam.logOn({
  22.             accountName: username,
  23.             password: password
  24.         });
  25.     });
  26. });
  27.  
  28. steam.on("loggedOn", function(result) {
  29.     console.log("Logged in");
  30.     steam.setPersonaState(Steam.EPersonaState.Online);
  31.     setTimeout (function() {
  32.         process.exit();
  33.     }, 10000);
  34. });
  35.  
  36. steam.on("error", function(error) {
  37.     if (error.cause == "logonFail") {
  38.         if (error.eresult == 63) {
  39.             rl.resume();
  40.             rl.question("Steam guard code: ", function(answer) {
  41.                 steamCode = answer;
  42.                 rl.close();
  43.                 steam.logOn({
  44.                     accountName: username,
  45.                     password: password,
  46.                     authCode: steamCode
  47.                 });
  48.             });
  49.         } else {
  50.             console.log("Logon fail: " + error.eresult);
  51.         };
  52.     };
  53. });
  54.  
  55. steam.on('sentry', function(data) {
  56.     var format = username + "sentry ";
  57.     fs.writeFileSync(format, data);
  58.     console.log("Sentry file successfully saved!");
  59. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand