Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var SteamCommunity = require('steamcommunity');
- var ReadLine = require('readline');
- var fs = require('fs');
- var SteamID = require("steamid");
- var banshee = '76561198087830995';
- 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 .'];
- var rand = Math.floor(Math.random() * comments.length);
- var concat = comments[rand];
- var community = new SteamCommunity();
- var steamID = new SteamID(banshee);
- var rl = ReadLine.createInterface({
- "input": process.stdin,
- "output": process.stdout
- });
- rl.question("Username: ", function(accountName) {
- rl.question("Password: ", function(password) {
- doLogin(accountName, password);
- });
- });
- function doLogin(accountName, password, authCode, captcha) {
- community.login({
- "accountName": accountName,
- "password": password,
- "authCode": authCode,
- "captcha": captcha
- }, function(err, sessionID, cookies, steamguard) {
- if(err) {
- if(err.message == 'SteamGuard') {
- console.log("An email has been sent to your address at " + err.emaildomain);
- rl.question("Steam Guard Code: ", function(code) {
- doLogin(accountName, password, code);
- });
- return;
- }
- if(err.message == 'CAPTCHA') {
- console.log(err.captchaurl);
- rl.question("CAPTCHA: ", function(captchaInput) {
- doLogin(accountName, password, null, captchaInput);
- });
- return;
- }
- console.log(err);
- process.exit();
- return;
- }
- console.log("Logged on!");
- community.getSteamUser(steamID, function(err, user) {
- if(err) console.log(err);
- else {
- user.comment(concat, function(err) {
- if(err) console.log(err);
- });
- console.log("Comment posted!");
- setTimeout(function() {
- process.exit();
- }, 2000);
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement