Jump to content
McKay Development

Vanilla

Member
  • Posts

    73
  • Joined

  • Last visited

Posts posted by Vanilla

  1. So sometimes my bot is disconnected from steam, it reconnects and is shown as online and everything and then when a trade offer is sent to it, it outputs an error something along the lines "Error: Not Logged In". Unfortunately, I didn't save the error output. Hopefully, someone will know what I'm talking about, but I'll update this post when it happens again. My guess is that it has something to do with either steamcommunity or tradeoffermanager, probably the former.

     

    How can I prevent it?

     

    That means, tradeoffer-manager have invalid cookies, and you need to refresh cookies if that happened.

     

    Use steamcommunity "sessionExpired" event to refresh tradeoffer-manager cookies

    When you get "Error: Not Logged In", steamcommunity "sessionExpired" event will fired.

    community.on("sessionExpired", function(err) {
       client.webLogOn(); //relogin to Steam or refresh tradeoffer-manager cookies
       //add your handling code here, for example: if (sendofferError == true){ //do stuff }
    }
    

    Edit: If you want to kill cookies for testing purposes, you can add this in your code:

    setTimeout(function(){
    	//for debugging purposes, kill cookies after 10 second
    	console.log("rip cookies :(");
    	community.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]);
    	manager.setCookies(["steamLogin=1||invalid", "steamLoginSecure=1||invalid"]);
    }, 10000);
    
  2. This the code i used on my bot, feel free to edit

     

     

    If you use steam-user, those code should be works.

    Don't forget that you need to logged in to chat so bot will listen to chat command.

    client.setPersona(5); //put this on: client.on('loggedOn', function (details) {
    
  3. Hello, it's happening again:

     

    http://i.imgur.com/QGThmOj.png

    21/05/17 - 14:10:52 - Rejecting Trade Offer from 76561198367819501 - Reason: Cross-Set
    21/05/17 - 14:10:52 - [INFO] givenlength: (2) receivelength: (2) tagged: (0) nonmarketable1: (2) nonmarketable2: (0)
    

    The offer object is in attachment.

    Looks like both cards in "itemsToGive" is marketable false. But the item is actually marketable

     

    http://steamcommunity.com/market/listings/753/639900-Mysterious%20Card%203

    http://steamcommunity.com/market/listings/753/639900-Mysterious%20Card%2010

    offer.txt

  4. Hello there, I found a weird problem when checking if an item is marketable or not
    I'm running 1:1 Card Trade (same-set) bot, and additionaly also accept 1:1 from non-marketable cards.
     
    The code I use to check if an item is marketable or not is something like this

    offer.itemsToReceive.forEach(function(item) {
    	if ((item.type.includes("Trading Card") == true) && (item.marketable == false)){
    		itemBotReceive.push("Non-Marketable Trading Cards"); //Non-marketable cards will be pushed to new array
    	}
    });
    

    The problem is, when using above code, sometimes marketable cards will goes to non-marketable cards
    This screenshot is perfect example for what I mean:
     
    T5rDAiD.png
     
    As you can see above, one of them is accepted, while the other one is rejected. Both trades come from same person
    When I check the log it say:

    21/05/17 - 05:18:07 - Accepting (1:1) Trade Offer #2227108866 : (SteamID)
    21/05/17 - 05:18:15 - Confirmed Trade Offer #2227108866
    21/05/17 - 05:22:28 - Rejecting Trade Offer from (SteamID) - Reason: Cross-Set
    21/05/17 - 05:22:28 - [INFO] givenlength: (1) receivelength: (1) tagged: (0) nonmarketable1: (0) nonmarketable2: (1)
    

    Mysterious card "3" for some reason will got tagged as "Non-Marketable Cards", but it's clearly that the cards is marketable
     
    ---
     
    Is this a bug or something? I can't reproduce this issue
    It's been going on for pretty long time, but pretty rare (about 5% Trades will get rejected for same reason)
     
    Thanks

  5. I currently don't have this event because I tough that steam-community event "sessionExpired" would be enough. When this event fires, I call steam-user client.webLogOn(), but this night I've noticed that when "sessionExpired" event gets called, it starts reconnecting, but doesn't fully reconnect: http://prntscr.com/fktl8y In this case my bot turns offline again and I have to restart it. I will try to add "disconnected" event, but what function exactly should I write there? Delete and re-create the session (client.webLogOn()) or totally log off from steam user and login again?

     

    Something like this:

    community.on("sessionExpired", function(err) {
    	//client.webLogOn and stuff
    });
    
    client.on('disconnected', function (eresult) {
    	console.log("Disconnected from Steam. Reason '"+SteamUser.EResult[eresult]+" ["+eresult+"]'");
            //do your magic
    });
    

    node-steamcommunity 'sessionExpired' event will fires if your cookies is dead (but still connected to Steam)

    node-steam-user 'disconnected' event will fires if your bot for some reason can't connect to Steam server.

     

    For example, try log in your bot using your code with 'disconnected' event code above, and after that turn off your internet connection.

    The log will say something like: "Disconnected from Steam. Reason 'NoConnection [3]'"

  6. Hello, I own a trade bot. This evening I have noticed that my bot began to behave strangely. It starts disconnecting from Steam and changes its status to offline. Logs are totally clean. No errors. Also, I am using a function "webLogOn" to destroy expired session and re-create it. Do you have any suggestions?

    Do you have 'disconnected' event (from steam-user)?

    It should show the reason why you get disconnected

  7. do u have an auto invite all friends to a pecifik group? that i can add to my bot

    Use 'inviteToGroup(userSteamID, groupSteamID)'

     

    It's possible to send a lot people to spesific group, but just like the wiki said: "sending automated group invites is a violation of the Steam Subscriber Agreement and can get you banned."

  8. Hey may i have the full code fixed plzzz i really need this for my bot an ive searched everywhere

    This will accept ALL incoming group invite

     

    client.on('groupRelationship', function (steamID, relationship) {
    	if (relationship == SteamUser.Steam.EClanRelationship.Invited){
    	client.respondToGroupInvite(steamID, true);
    	}
    });
  9. if(steamID == '76561197.....' || steamID == '76561.....'){

     

     

    In case if you want the bot accept user command and admin command, you can try this example, or using switch-case:

    var admin = "76561..."; //this is admin Steam ID
    
    client.on('friendMessage', function (steamID, message) {
    	if((steamID == admin) && (message== "!command1")){
    		client.chatMessage(steamID, 'admin command 1');
    	}
            else if((steamID == admin) && (message== "!command2")){
    		client.chatMessage(steamID, 'admin command 2');
    	}
            else if(message== "!user1"){
    		client.chatMessage(steamID, 'user command 1');
    	}
            else if(message== "!help"){
    		client.chatMessage(steamID, '!help command');
    	}
            else {
    		client.chatMessage(steamID, 'command not found, use !help');
    	}
    });
    
  10. Hello there, I managed to make my bot edit their "Real Name' using editProfile node-steamcommunity, and I found a problem

     

    Everytime I'm using "community.editProfile", it always removing one of my bot Profile Showcase.

    The original is "Items Up For Trade" and Custom Info Box, but after calling editProfile, "Items Up For Trade"  always gone and only leaving Custom Info Box.

     

    Is this a bug or am I missing something? Because I can't find anything in wiki about Profile Showcase.

    Thanks

     

     

    Not sure if it's help, but here's part of code

    community.editProfile({
    	"realName": "Bot Version: " +version,
    	"background" : 4149974111,
    }, function(err) {
    	if (err) {
    		var log = (currentdate() + " - Failed to update RealName");
    		fs.appendFile("log.txt", log+ "\n",  {flag: 'a'}, function(err) {});
    		console.log(log);
    	}
    	else {
    		var log = (currentdate() + " - RealName updated: "+version);
    		fs.appendFile("log.txt", log+ "\n",  {flag: 'a'}, function(err) {});
    		console.log(log);
    	}
    });
    

     

×
×
  • Create New...