Jump to content
McKay Development

Recommended Posts

Posted (edited)

hello, i wanted to make my bot so that anyone can login to it and use it, including people who need to authenticate using the email code, the bot is to block groups automaticaally, especially csgo scam groups, but i cant get my code to work, i have tried to put null in quotations, but it seems that it does not get triggered, i have made an account that has email code to login and i use my main which has steamguard mobile code to login, but when i login the mobile authenticator account works but the email one doesnt it skips login and goes straight for the web session, the first time logging in with the email auth account it logged in twice according to the client.logged on event, then after that it skips the logOn event and goes straight for the websession.

client.logOn(logOnOptions);
	
	client.setOption("promptSteamGuardCode", false);
	
var mobile = {
    properties: {
      Steam: {
          description: 'Steam Mobile Code: '
      },
    }
  };

  var email = {
    properties: {
      SteamE: {
          description: 'Steam Email Code: '
      },
    }
  };

client.on('steamGuard', function(domain, callback) {
        if(domain == null){
            //console.log('You Are Using Phone!');
            prompt.start();
            prompt.get(mobile, function (err, result) {
            var code = result.Steam;
            callback(code);
            prompt.stop();
            });

        }else{
            console.log('You Are Using Email!');
            prompt.start();
            prompt.get(email, function (err, result) {
            var code = result.SteamE;
            callback(code);
            prompt.stop();
        });


};

and here is my full code, please help me: 

const TradeOfferManager = require('steam-tradeoffer-manager');
const SteamCommunity = require('steamcommunity');
const SteamUser = require('steam-user');
var prompt = require('prompt');

require('console-stamp')(console, '[HH:MM:ss]');

const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager ({
	steam: client,
	community: community,
	language: 'en'
});

var schema = {
    properties: {
      Account_Name: {

      },
      Password: {
        hidden: true,
        replace: '*'
      },
    }
  };

  prompt.start();

  prompt.get(schema, function (err, result) {

    const logOnOptions = {
	accountName: result.Account_Name,
	password: result.Password,
	rememberPassword: false,
};

	client.logOn(logOnOptions);
	
	client.setOption("promptSteamGuardCode", false);
	
var mobile = {
    properties: {
      Steam: {
          description: 'Steam Mobile Code: '
      },
    }
  };

  var email = {
    properties: {
      SteamE: {
          description: 'Steam Email Code: '
      },
    }
  };

client.on('steamGuard', function(domain, callback) {
        if(domain == null){
            //console.log('You Are Using Phone!');
            prompt.start();
            prompt.get(mobile, function (err, result) {
            var code = result.Steam;
            callback(code);
            prompt.stop();
            });

        }else{
            console.log('You Are Using Email!');
            prompt.start();
            prompt.get(email, function (err, result) {
            var code = result.SteamE;
            callback(code);
            prompt.stop();
        });


};

	client.on('loggedOn', () => {
		client.on("accountInfo", function(name, country) {
	         console.log(' ');
      		console.log('-----------------------------------');
		console.log('Group Invite Blocker 3000');
		console.log('-----------------------------------');
		console.log('Succesfully logged in as: ' + result.Account_Name);
		console.log("Your Online Name: " + name);
		console.log("Your Country: " + country);
		console.log('-----------------------------------');
		console.log(' ');
		client.setPersona(SteamUser.Steam.EPersonaState.Online);
		//client.gamesPlayed(["BOT TESTING",271590]);
		// client.gamesPlayed(271590); //Playing GTA 5		
});		
});
});

             client.on('webSession', function(sessionID, cookies) {
                console.log("Got Web Session! (this is good)");
                manager.setCookies(cookies, family view pin);
                community.setCookies(cookies, family view pin);
});

client.on('groupRelationship', function (steamID, relationship) {
	if (relationship == SteamUser.Steam.EClanRelationship.Invited){
	//console.log("Succesfully Decline Group Invite From" + " " + steamID);
	client.respondToGroupInvite(steamID, false);
	console.log("Declined Steam Group Invite");
	}
});
});
Edited by Mr_wall1122
Posted

If you're saying that your problem is that it isn't prompting for an email code and is instead logging directly in, that's on purpose. It saves the sentry file (which, if provided in logon [which it does automatically], you don't need an email code). If you need to prompt an email code request, you can delete the sentry file under %localappdata%\doctormckay\node-steamuser (on Windows).

Posted (edited)

yeah i firgured that one out  :), but when i login for the first time using email authenticator it calls my "loggedOn" event twice but i dont know why, as you can see im using the exact same details....

 

post-1414-0-93712900-1501317445_thumb.png

post-1414-0-86733500-1501317446_thumb.png

 

my current code is: 

const TradeOfferManager = require('steam-tradeoffer-manager');
const SteamCommunity = require('steamcommunity');
const SteamUser = require('steam-user');
var colors = require('colors/safe');
let date = require('date-and-time');
var prompt = require('prompt');
const chalk = require('chalk');
var sleep = require('sleep');


require('console-stamp')(console, '[HH:MM:ss]');

const RedStyle = chalk.red;
const YellowStyle = chalk.yellow;
const GreenStyle = chalk.green;

const client = new SteamUser();
const community = new SteamCommunity();
const manager = new TradeOfferManager ({
	steam: client,
	community: community,
	language: 'en'
});

//Welcome MESSAGE!
console.log(GreenStyle('-------------------------------------------'));
console.log(GreenStyle('      Welcome To My Group Invite Blocker   '));
console.log(GreenStyle('-------------------------------------------'));
console.log(GreenStyle('                                           '));
console.log(YellowStyle('-------------------------------------------'));
console.log(YellowStyle('             Made By Ben Wall              '));
console.log(YellowStyle('-------------------------------------------'));
console.log(YellowStyle(' '));
console.log(RedStyle('-------------------------------------------'));
console.log(RedStyle('NOTE: IF YOU LOGIN USING STEAM EMAIL       '));
console.log(RedStyle('AUTHENTICATOR ENTER THE CODE AND THEN      '));
console.log(RedStyle('SIMPLY RESTART AND RE-LOGIN TO THE BOT     '));
console.log(RedStyle('DUE TO A UNKNOWN PROBLEM THAT IM WORKING   '));
console.log(RedStyle('ON, NOW YOU WONT NEED THE CODE AS IT ONLY  '));
console.log(RedStyle('REQUIRES CODE UPON FIRST LOGIN, IF YOU USE '));
console.log(RedStyle('MOBILE TO AUTHENTICATE THEN YOU ARE FINE TO'));
console.log(RedStyle('USE IT AS INTENDED, JUST MORE STEPS FOR THE'));
console.log(RedStyle('EMAIL AUTHENTICATOR GUYS                   '));
console.log(RedStyle('-------------------------------------------'));



var schema = {
    properties: {
      Account_Name: {
        description: colors.green('Account Name'),
      },
      Password: {
        description: GreenStyle('Password'),
        hidden: true,
        replace: '*'
      },
    }
  };

  prompt.start();

  prompt.get(schema, function (err, result) {

    const logOnOptions = {
	accountName: result.Account_Name,
	password: result.Password
};
         //logon using credentials that you typed in
	client.logOn(logOnOptions);
	
	client.setOption("promptSteamGuardCode", false);
	client.setOption("autoRelogin", true);
	
var mobile = {
    properties: {
      Steam: {
          description: GreenStyle('Steam Mobile Code')
      },
    }
  };

  var email = {
    properties: {
      SteamE: {
          description: GreenStyle('Steam Email Code (PLEASE RESTART BOT AFTER)')
      },
    }
  };

//Checks if you are using Mobile authenticator or email Code
client.on('steamGuard', function(domain, callback) {
        if(domain == null){
            prompt.start();
            prompt.get(mobile, function (err, result) {
            var code = result.Steam;
            callback(code);
            });
        }else{
            prompt.start();
            prompt.get(email, function (err, result) {
            var code = result.SteamE;
            callback(code);
        });

}
});
});

let now = new Date();

         //this is what happens when succesfully logged on
	client.on('loggedOn', () => {
		client.on("accountInfo", function(name, country) {
	        console.log(GreenStyle(' '));
      		console.log(GreenStyle('-------------------------------------------'));
		console.log(GreenStyle('Group Invite Blocker 3000                  '));
		console.log(GreenStyle('-------------------------------------------'));
                console.log(GreenStyle("Your Country: " + country));
      		console.log(GreenStyle('The Time Upon Logon: ' + date.format(now, 'HH:mm:ss')));
		console.log(GreenStyle('Succesfully logged in as: ' + name));
		console.log(GreenStyle('-------------------------------------------'));
		console.log(GreenStyle(' '));
		client.setPersona(SteamUser.Steam.EPersonaState.Online);		
});		
});
                //READ THIS: IMPORTANT
                //IF YOU DO NOT HAVE FAMILY PIN ENABLED DELETE THE NUMBERS
                //EXAMPLE:

                //WITHOUT FAMILY VIEW PIN:
                //manager.setCookies(cookies);
                //community.setCookies(cookies);

                //WITH FAMILY VIEW PIN:
                //manager.setCookies(cookies, 1234);
                //community.setCookies(cookies, 1234);

             client.on('webSession', function(sessionID, cookies) {
                console.log(GreenStyle("Got Web Session! (this is good)"));
                manager.setCookies(cookies, 4265);
                community.setCookies(cookies, 4265);
});

//This is the code which blocks group invites automatically
client.on('groupRelationship', function (steamID, relationship) {
	if (relationship == SteamUser.Steam.EClanRelationship.Invited){
	client.respondToGroupInvite(steamID, false);
	console.log("Declined Steam Group Invite");
	}
});
Edited by Mr_wall1122

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...