Jump to content
McKay Development

Vanilla

Member
  • Posts

    73
  • Joined

  • Last visited

Community Answers

  1. Vanilla's post in Answer by level was marked as the answer   
    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. Vanilla's post in Cookies was marked as the answer   
    client.on('webSession', function(sessionID, cookies) { steamcommunity.setCookies(cookies); }); steamcommunity.on("sessionExpired", function(err) { if (err) { client.webLogOn(); } });
  3. Vanilla's post in Chat Anti Spam Help was marked as the answer   
    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 });
  4. Vanilla's post in Need Help was marked as the answer   
    Add amount property when adding item
     
    https://dev.doctormckay.com/topic/1034-adding-gems-and-gem-sacks-to-trade/?hl=gems
    https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/wiki/TradeOffer#addmyitemitem
  5. Vanilla's post in Summary was marked as the answer   
    var id = ""; //either SteamID Object or customURL after /id/ community.getSteamUser(id, function (err, user){ if (err){ console.log(err); //some error } else { console.log(user.summary); } });
  6. Vanilla's post in Error: "Not Logged In" was marked as the answer   
    Well, I didn't use "pollFailure" on my bot, and I use this solution for my bot
    (trying to send offer -> error not logged in -> steam-community "sessionExpired" called -> relogin using client.webLogOn(); -> use if/else and re-send trade offer)
  7. Vanilla's post in How to counter incoming trade offer? was marked as the answer   
    Lol, so that's why I'm unable to add new item. 
     
    Now works like a charm, thanks.
     

    manager.on('newOffer', function(offer) {    if (offer.partner.getSteamID64() == admin){       //Counter an offer by adding new item var counteroffer = offer.counter();       counteroffer.addMyItem({"appid": 753, "contextid": 6, "assetid": "5222324266"});        counteroffer.send(function(err, status){          if (err){             console.log("Error: "+err);          }          console.log("Status: "+status)       });       //confirmation    } }
  8. Vanilla's post in AppID of a offer was marked as the answer   
    using 'item.appid' 
    https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#appid
  9. Vanilla's post in Edit Steam Profile Summary was marked as the answer   
    Using steamcommunity editProfile.https://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#editprofilesettings-callback
  10. Vanilla's post in Not able to respond to offers because "not online" was marked as the answer   
    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);
  11. Vanilla's post in How to get the item tags ? was marked as the answer   
    https://github.com/DoctorMcKay/node-steamcommunity/wiki/CEconItem#tags
     
     
    You need to get individual item from offer, and after that just call "item.tags".
    Since tags is an array, you might want to use loop to check if an item contain "Craft Item"
×
×
  • Create New...