-
Posts
3575 -
Joined
-
Last visited
Everything posted by Dr. McKay
-
That code is full of syntax errors, so I suspect you didn't copy and paste the code that's actually running. client.chat.on('friendMessage', (msg) => { if (!msg.message_bbcode_parsed) { return; } let element = msg.message_bbcode_parsed[0]; if (typeof element == 'object' && element.tag == 'tradeoffer') { client.chat.sendFriendMessage(msg.steamid_friend, `You sent me trade offer #${element.attrs.id}.`); } });
-
Sorry, that's probably not going to be implemented.
-
Have you read the docs on the new chat? You get a friendMessage event when a new message comes in, which contains an Incoming Friend Message object. For an incoming trade offer, the message is something like: [tradeoffer sender=46143802 id=4087685841][/tradeoffer] But you can see the parsed BBCode in a more convenient format with message_bbcode_parsed, which looks like: [ TagNode { tag: 'tradeoffer', attrs: { sender: '46143802', id: '4087685841' }, content: [] } ]
-
You can either listen for the tradeOffers event, or listen for chat messages and check for one that contains a [tradeoffer] BBCode.
-
GC sessions are weird and sometimes they go away without wanting to reconnect. That said, some changes have been made somewhat recently, so make sure you're up to date. If you are, then I suggest detecting when that happens, and using gamesPlayed([]) then waiting a minute or two and launching CS:GO again.
-
It couldn't be, that error is coming from somewhere else. But that error is definitely indicating that you're trying to reference eresult on something that's null.
-
Glad you got that sorted!
-
This means that err is null, meaning there was no error.
-
err.eresult is just the number, yes.
-
Is your inventory full, or would accepting the offer put your inventory over the limit?
-
Node.js actually performs better if you split as much as you can into separate processes, since Node is single-threaded.
-
getPersonas is a method, not a property.
-
You don't need to load someone's inventory if you know the asset ID you plan on putting in the trade offer already. Can you determine which line you're receiving the error on? That error could be coming from either manager.loadInventory or manager.loadUserInventory.
-
You need to wait for the loggedOn event, and you also need to call getPersonas to actually get user persona data.
-
What's the purpose of loading the user's inventory if you aren't doing anything with the response? Also, I'd like to know what your partner variable actually looks like.
-
I really wouldn't recommend that you try parsing item attributes and using them to determine what various items actually are. CS:GO is a complete mess and that's a really good way to go insane. You're far better off keeping track of which items are which IDs before you put them in your storage unit. I'm not aware of any storage unit rate-limits, but I do recommend that you wait for an add/remove request to complete before you issue the next one.
-
There shouldn't be any problems.
-
That sounds an awful lot like spam.
-
Take a look at the examples in the steam-tradeoffer-manager repository. It should be fairly trivial to modify the example to accept all incoming offers into one that declines all incoming offers.
-
acceptConfirmationForObject Sometimes Doesn't Response
Dr. McKay replied to sergun's topic in node-steam-tradeoffer-manager
Yes, receivedOfferChanged should be your primary way to see if a trade was completed. -
acceptConfirmationForObject Sometimes Doesn't Response
Dr. McKay replied to sergun's topic in node-steam-tradeoffer-manager
This is just how Steam works, sadly. When you confirm an incoming trade offer, the confirmation request doesn't respond until all items have been exchanged. If a trade offer contains many items, it's very possible that the request will time out (30 seconds) before all items have been exchanged. In this situation, the trade will still complete in the background. -
Is there any risk of ban for using this package?
Dr. McKay replied to Akaz's topic in node-steam-tradeoffer-manager
I'm not aware of anyone having been banned merely for using this package. This interacts with Steam primarily using WebAPIs exposed by Valve themselves; it would be pretty weird for Valve to create and expose an API and then ban people for using it. -
Fixed in v3.41.4, thanks for the info.
-
You can use steamstore to add phone numbers.
-
You can use getUserDetails to check whether the trade URL is valid and if the user can trade.