Jump to content
McKay Development

Vanilla

Member
  • Posts

    73
  • Joined

  • Last visited

Everything posted by Vanilla

  1. Get some cheap VPS, use Raspberry pi, or create yourown server.
  2. Yep.. "somehow" you need to know the id.. That's why you need to cache it when using getUserInventory
  3. It's possible without getUserInventory, but somehow you need to put appid, contextid, and assetid correctly.
  4. 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); } });
  5. You might need a database for that (like Oracle, MySQL, MonggoDB). I'm not sure how to do that though
  6. Like I said above, variable "name" is now availabe to use in above code Just add this code above console.log client.chatMessage(steamid, 'Hello ' +name+ ', thanks for add me, if you need help write !help');
  7. 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)
  8. Use "sessionExpired" event from node-steamcommunity, then relogin using node-steam-user "webLogon()". edit: this might help https://dev.doctormckay.com/topic/1134-not-able-to-respond-to-offers-because-not-online/?p=3786
  9. client.on('friendRelationship', (steamid, relationship) => { if (relationship === 2) { client.addFriend(steamid); client.chatMessage(steamid, 'Hello! Thanks for add me, if you need help write !help'); //getting name using getPersonas client.getPersonas([steamid], function(personas) { var persona = personas[steamid.getSteamID64()]; var name = persona ? persona.player_name : ("[" + steamid.getSteamID64() + "]"); //You can use 'name' to show their name console.log("You add: " + name + " - " +steamid); }); } }); Pretty much like this
  10. Use getPersonas https://github.com/DoctorMcKay/node-steam-user#getpersonassteamids-callback https://dev.doctormckay.com/topic/660-how-to-go-from-steam64-to-steam-username-the-name-currently-used-on-steam/?p=2080 Using steamcommunity getSteamUser also works https://github.com/DoctorMcKay/node-steamcommunity/wiki/SteamCommunity#getsteamuserid-callback
  11. Have you tried using EResult instead? user.on('disconnected', function (eresult) { console.log("Disconnected from Steam. '"+SteamUser.EResult[eresult]+" ["+eresult+"]'"); });
  12. Vanilla

    Error 429

    You're making too many request, slow down. https://dev.doctormckay.com/topic/455-429-error/
  13. https://github.com/DoctorMcKay/node-steam-user#friendrelationship client.on('friendRelationship', function(steamID, relationship) { if (relationship == SteamUser.Steam.EFriendRelationship.Friend) { //this user became our friend on Steam //do something } }); Check enum here: https://github.com/DoctorMcKay/node-steam-user/blob/master/enums/EFriendRelationship.js Just a heads up, if someone send you friend request, event will be called and "relationship" is: 2 (RequestRecipient). And if you accepted the friend request, the "friendrelationship" event will be called again and "relationship" is: 3 (Friend).
  14. OP asking how to GET comment, not to posting comment. I dont think it's possible for now, you can check Dr.McKay answer here: https://dev.doctormckay.com/topic/1181-getting-all-commentsactivity-from-a-group/?p=3947
  15. This might help: https://dev.doctormckay.com/topic/455-429-error/
  16. 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 } }
  17. Thanks, just successfully make a counter offer. I only need to add "counter()" everytime I want to counter an offer. This is the working counter offer code (for those who got same problem) manager.on('newOffer', function(offer) { if (offer.partner.getSteamID64() == admin){ //Counter an offer offer.counter().addMyItem({"appid": 753, "contextid": 6, "assetid": "5222324266"}); offer.counter().send(function(err, status){ if (err){ console.log("Error: "+err); } console.log("Status: "+status) }); //confirmation } }
  18. So, I need to use offer.counter() to get tradeoffer object, make change on that, and send new trade offer?
  19. Hello, how did I counter an incoming trade offer? I know that I need to use "offer.counter()", but I don't know how to use it. I got this following code to counter an offer, but it will show an error "Cannot add item to an already-sent offer". manager.on('newOffer', function(offer) { if (offer.partner.getSteamID64() == admin){ //Counter an offer by adding new item offer.counter(); offer.addMyItem({"appid": 753, "contextid": 6, "assetid": "5222324266"}); //error here offer.send(function(err, status){ if (err){ console.log("Error: "+err); } console.log("Status: "+status) }); } } Can anyone show the correct code please? I would really appreciate it. Thanks
  20. Nope, you will show up as "Offline" and still idling the game.If you decided to do that, you can't use chat messages. There's other way. You can 'Offline' in client, but Online chat via web browser, it will show up as 'Online via web browser' and still idling the game Use steamcommunity 'chatLogon();' https://github.com/DoctorMcKay/node-steamcommunity/wiki/Steam-Chat#chatlogoninterval-uimode
  21. Put your "client.setPersona" as offline (0), and play whatever game you're idling client.setPersona(0); //"0": "Offline", "1": "Online", "2": "Busy", "3": "Away", "4": "Snooze", "5": "LookingToTrade", "6": "LookingToPlay" client.gamesPlayed(753); //playing app 753
  22. Are you sure it's not this for the last line? if (mkable === false && ts === false && cable === false) { // && means [AND], || means [OR] return false } return true PS: I'm sorry if I got this wrong, I don't play TF2
  23. Those function should works This is how you call function craftable(item) offer.itemsToReceive.forEach(function(item) { if (craftable(item) == false){ //item is Not Usable in Crafting } else { //item is Usable in Crafting } }); //do same with itemToGive
  24. If you're talking about steam-user 'inviteToGroup', you can pass the SteamID there https://github.com/DoctorMcKay/node-steam-user/blob/master/README.md#invitetogroupusersteamid-groupsteamid > inviteToGroup(userSteamID, groupSteamID)
×
×
  • Create New...