Jump to content
McKay Development

rycao18

Member
  • Posts

    5
  • Joined

  • Last visited

Posts posted by rycao18

  1. 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();
    
  2. 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? 

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

  4. I'm using the Doctor McKay library for login and trade starting, but I am then using seishun's steam-trade to automate trading. Here's my current code. 

    client.on("tradeRequest", function(steamID, respond) {
    	logger.info("Incoming Trade Request from " + steamID.getSteam3RenderedID());
    	respond(true);
    })
    
    client.on("tradeStarted", function(steamID) {
    	steamTrade.open(JSON.stringify(steamID));
    })
    
    steamTrade.on('offerChanged', function(added, item) {
        console.log('they ' + (added ? 'added ' : 'removed '));
        console.log(item);
        for(var i = 0; i < steamTrade.themAssets.length; i++) {
            console.log(steamTrade.themAssets[i]);
        }
    });
    

    When I log the item , the console prints out undefined and returns an error. (I assume this means the item is undefined?) Seishun told me that the reason this happens is because the tradeStarted event returns steamID as an object, not a string? I thought the JSON.stringify would convert this object to a string, but obviously I am mistaken? 

    C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:208
          return self._themInventories[item.appid][item.contextid][item.assetid];
                                                  ^
    
    TypeError: Cannot read property '2' of undefined
        at C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:208:47
        at Array.map (native)
        at SteamTrade._onTradeStatusUpdate (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:206:72)
        at Request._callback (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\index.js:244:10)
        at Request.self.callback (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\node_modules\request\request.js:187:22)
        at emitTwo (events.js:87:13)
        at Request.emit (events.js:172:7)
        at Request.<anonymous> (C:\Users\Richard\Desktop\Steam\NodeJS\GlitchedTurtleBot\node_modules\steam-trade\node_modules\request\request.js:1044:10)
        at emitOne (events.js:77:13)
        at Request.emit (events.js:169:7)
    
×
×
  • Create New...