Jump to content
McKay Development

Vanilla

Member
  • Posts

    73
  • Joined

  • Last visited

Posts posted by Vanilla


  1. client.on("friendMessage", (steamid, message) => {
    if (message === "test") {
    client.getSteamLevels([steamid], function(results) {
    if (results[steamid] > 5) {
    client.chatMessage(steamid, "u have +5 lvl.");
    console.log("done");
    }
    });
    }
    });
  2. Thanks for the answer!

     

    Can you provide an example for clarification?

    client.on('webSession', function(sessionID, cookies) {
        steamcommunity.setCookies(cookies);
    });
    
    steamcommunity.on("sessionExpired", function(err) {
    	if (err) {
    		client.webLogOn();
    	}
    });
    
  3. Has this error happened to you before? I mean, get null info of your offers.

     

    Nope, never happened to me.

    If incoming trade offer didn't match with my "rules", my bot successfully counter the trade.

    The code above is pretty much how I counter the incoming trade offer.

     

    Oh by the way, I'm using newOffer event to get incomming trade offer.

  4. Not really an answer, but here's a small code I use on my bot to prevent chat spam.

    It will block a person who send same messages every 2 second.

    var antispam;
    var markedSteamID;
    
    function spamtimer() { //when called, it will reset
    	antispam = 0;
    	markedSteamID = 0;
    }
    
    setInterval(spamtimer, 2000); //call spamtimer function every 2 sec
    
    //.. your code here
    
    client.on("friendMessage", function(senderID, message) {
            //anti spam
            if (senderID == admin){
                  //Ignore if chat from admin
            }
            else if ((antispam == message) && (markedSteamID == senderID.getSteamID64())) {
    
                               client.chatMessage(senderID, "I caught you spamming");
    
                               //do something, like block that person or something
    
                     }
    
                    
    
                     //.. your code here.. to respond chat
    
                 
    
                     antispam = message; //bot will record the message, will reset every 2 sec
    
                     markedSteamID = senderID.getSteamID64(); //bot will record SteamID of sender, will reset every 2 sec
    
    });
    
    
    
    
  5.  

    I check if steamUser is still connected and calling webLogOn.. I just don't get a Session after that...

        if (this._client.steamID !== null) {
          console.log('STEAMBOT calling webLogOn - ' + this._steamid + ' - ' + this._user + ' isLoggedIn=' + this._isLoggedIn);
          this._client.webLogOn();
        }
    

     

    use this?

    if (err) {
       console.log('STEAMBOT calling webLogOn - ' + this._steamid + ' - ' + this._user + ' isLoggedIn=' + this._isLoggedIn);
       this._client.webLogOn();
    }
    
×
×
  • Create New...