Jump to content
McKay Development

Recommended Posts

Posted

Hello! I am having an error with my bot about login. I currently have this error. 

error:  Error: RateLimitExceeded
    at SteamUser._handlers.(anonymous function) (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\logon.js:320:16)
    at SteamUser._handleMessage (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\messages.js:198:29)
    at emitThree (events.js:102:20)
    at CMClient.emit (events.js:175:7)
    at CMClient._netMsgReceived (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:278:8)
    at CMClient.handlers.(anonymous function) (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:386:8)
    at CMClient._netMsgReceived (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\cm_client.js:260:24)
    at emitOne (events.js:77:13)
    at TCPConnection.emit (events.js:169:7)
    at TCPConnection._readPacket (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\node_modules\steam-client\lib\tcp_connection.js:73:7)

Can anyone tell me what Rate Limit is ? And also, how can I avoid exceeding it in the future? Steam is not letting me login to that account from my ip, i've waited about an hour since last attempt and still got disconnected. 

 

 

Also, my code here could help. 

function LogOn() {

	client.setOption("promptSteamGuardCode", false);

	client.logOn({
		"accountName": secondconfig.username,
		"password": secondconfig.password
	});

	client.on("error", function(error){
		logger.error(error);
	});


	client.on("webSession", function(steamID, cookies) {
		community.setCookies(cookies);
		steamTrade.sessionID = cookies[0].split("=")[1];
		cookies.forEach(function(cookie) {
	    	steamTrade.setCookie(cookie);
	    })
	  	SteamTotp.steamID = steamID;
	  	community.startConfirmationChecker(2500, secondconfig.identitysecret);
	})

	client.on("steamGuard", function(domain, callback, lastCodeWrong) {
	  	if(lastCodeWrong) {
	    	logger.warn("Last Code was Wrong... trying again!");
	  	}

	  	var shared_secret = secondconfig.sharedsecret;

	  	callback(SteamTotp.generateAuthCode(shared_secret));

	});

	// Bot started, set up trade offer with steam api key
	client.on("loggedOn", function(details){
		logger.info("Logged onto Steam! With the SteamID of " + client.steamID.getSteam3RenderedID());
		client.setPersona(Steam.EPersonaState.Online);
		client.gamesPlayed(440);
		//webLogOn();
	});
}
LogOn();

I made LogOn(); into a method, because I want to be able to restart the bot via a message from a user like !restart. You can see that code here

steamFriends.on('friendMsg', function(id, msg, type) {
	if(type == Steam.EChatEntryType.ChatMsg){
		switch(msg) {
			case "!help":
				steamFriends.sendMessage(id, "Hello! I'm an bot that buys Mann Co. Audition Reels and Mann Co. Directors Cut Reels!");
				break;
			case "!restart":
				logger.info('Restarting Bot!');
				steamFriends.sendMessage(id, "Restarting in 3 seconds...");
				client.logOff();
				setTimeout(LogOn, 3000);
		}
	}
});

When I called the !restart command, the bot stopped, then attempted to login, and I got my Last Code Wrong warning about 10-15 times before the bot got the rate limit error. What can I do ? 

Posted

You should add a delay before you attempt to relog if your code was wrong. A wrong code will continue to be wrong for up to 30 seconds.

 

What happened there was that your code was already used when you tried to login, so Steam failed your login and told you that your last code was wrong. Then you tried to login 15 more times with the same incorrect code. For obvious reasons, Steam blacklisted your IP for a short time.

Posted

You should add a delay before you attempt to relog if your code was wrong. A wrong code will continue to be wrong for up to 30 seconds.

 

What happened there was that your code was already used when you tried to login, so Steam failed your login and told you that your last code was wrong. Then you tried to login 15 more times with the same incorrect code. For obvious reasons, Steam blacklisted your IP for a short time.

 

How would I get this code ? I have promptSteamGuardcode set to false I thought, so why would I need a code? 

Posted (edited)

So bot logged in, i sent it the message ! restart, and then it got a bit screwed up. I modified my code a bit. Here's the error I got. I think I am getting the steam guard code wrong? 

 

If I am not getting the steam guard code corretcly, how would I go about doing that? I currently have my identitysecret and shared secret, which i'm using with SteamTotp to accept confirmations

C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot>node index
info: Logged onto Steam! With the SteamID of [U:1:193233186]
info: [76561198109516277] Un-friended
info: [76561198109516277] Accepted friend request
info: Restarting Bot!
info: Logged onto Steam! With the SteamID of [U:1:193233186]
info: Logged onto Steam! With the SteamID of [U:1:193233186]
warn: Last Code was Wrong... trying again!
crypto.js:87
  this._handle.init(hmac, toBuf(key));
               ^

TypeError: Not a buffer
    at TypeError (native)
    at new Hmac (crypto.js:87:16)
    at Object.Hmac (crypto.js:85:12)
    at Object.exports.generateAuthCode.exports.getAuthCode (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-totp\index.js:41:20)
    at SteamUser.<anonymous> (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\index.js:114:23)
    at emitThree (events.js:102:20)
    at SteamUser.emit (events.js:175:7)
    at SteamUser._steamGuardPrompt (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\logon.js:411:8)
    at SteamUser._handlers.(anonymous function) (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\logon.js:292:9)
    at SteamUser._handleMessage (C:\Users\Richard\Desktop\Steam\NodeJS\CombinedBot\node_modules\steam-user\components\messages.js:198:29)

Here's my code

function LogOn() {

	client.setOption("promptSteamGuardCode", false);

	client.logOn({
		"accountName": secondconfig.username,
		"password": secondconfig.password
	});

	client.on("error", function(error){
		logger.error(error);
	});


	client.on("webSession", function(steamID, cookies) {
		community.setCookies(cookies);
		steamTrade.sessionID = cookies[0].split("=")[1];
		cookies.forEach(function(cookie) {
	    	steamTrade.setCookie(cookie);
	    })
	  	SteamTotp.steamID = steamID;
	  	community.startConfirmationChecker(2500, secondconfig.identitysecret);
	})

	client.on("steamGuard", function(domain, callback, lastCodeWrong) {
	  	if(lastCodeWrong) {
	    	logger.warn("Last Code was Wrong... trying again!");
	    	var shared_secret = config.sharedsecret;

			callback(SteamTotp.generateAuthCode(shared_secret));
	    	setTimeout(LogOn, 45000);
	  	}

	  	var shared_secret = secondconfig.sharedsecret;

	  	callback(SteamTotp.generateAuthCode(shared_secret));

	});

	// Bot started, set up trade offer with steam api key
	client.on("loggedOn", function(details){
		logger.info("Logged onto Steam! With the SteamID of " + client.steamID.getSteam3RenderedID());
		client.setPersona(Steam.EPersonaState.Online);
		client.gamesPlayed(440);
		//webLogOn();
	});
}
LogOn();
Edited by rycao18

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...