Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. var SteamCommunity = require('steamcommunity');
  2. var ReadLine = require('readline');
  3. var fs = require('fs');
  4. var SteamID = require("steamid");
  5.  
  6. var banshee = '76561198087830995';
  7.  
  8. var comments = ['+rep nice trade', '+rep nice spray', 'Amazing player +rep!', '+rep well played', '+rep real GE', '+rep skilled player', 'nice player +rep', '+rep still no esl player!', '+rep thx for game', '+rep :steamhappy:', '+rep nice friend +skill', '+rep !!!', '+rep good player and friend !', '+rep well play', '+rep best aimer', '+rep #?-?# ', '+rep, great, highly recommended .'];
  9. var rand = Math.floor(Math.random() * comments.length);
  10. var concat = comments[rand];
  11.  
  12. var community = new SteamCommunity();
  13. var steamID = new SteamID(banshee);
  14. var rl = ReadLine.createInterface({
  15. "input": process.stdin,
  16. "output": process.stdout
  17. });
  18.  
  19. rl.question("Username: ", function(accountName) {
  20. rl.question("Password: ", function(password) {
  21. doLogin(accountName, password);
  22. });
  23. });
  24.  
  25. function doLogin(accountName, password, authCode, captcha) {
  26. community.login({
  27. "accountName": accountName,
  28. "password": password,
  29. "authCode": authCode,
  30. "captcha": captcha
  31. }, function(err, sessionID, cookies, steamguard) {
  32. if(err) {
  33. if(err.message == 'SteamGuard') {
  34. console.log("An email has been sent to your address at " + err.emaildomain);
  35. rl.question("Steam Guard Code: ", function(code) {
  36. doLogin(accountName, password, code);
  37. });
  38.  
  39. return;
  40. }
  41. if(err.message == 'CAPTCHA') {
  42. console.log(err.captchaurl);
  43. rl.question("CAPTCHA: ", function(captchaInput) {
  44. doLogin(accountName, password, null, captchaInput);
  45. });
  46.  
  47. return;
  48. }
  49.  
  50. console.log(err);
  51. process.exit();
  52. return;
  53. }
  54.  
  55. console.log("Logged on!");
  56.  
  57. community.getSteamUser(steamID, function(err, user) {
  58. if(err) console.log(err);
  59. else {
  60. user.comment(concat, function(err) {
  61. if(err) console.log(err);
  62. });
  63. console.log("Comment posted!");
  64.  
  65. setTimeout(function() {
  66. process.exit();
  67. }, 2000);
  68. }
  69. });
  70. });
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement