Jump to content
McKay Development

Only add item to trade if item is not in anohter trade already

Recommended Posts

Is there a parameter for this? I'm specifically talking about TF2 keys but should be the same for everything

I currently have this:

const offer = manager.createOffer(partner_steam_id);
const keys = inventory.filter(item => item.market_hash_name === 'Mann Co. Supply Crate Key');

for (let i = 0; i < keyQuantity; i++) {

Problem is, running this twice will add the same exact keys to the second trade, instead of keys not currently being used in a trade. Is there a function/parameter for this?

I've found a workaround that is, by printing the key object you get can see that each CEconItem has a different assetid and I can just make a list of all that are currently being used in a trade and comparing them in order to not add but said function/parameter would be ideal and I'd like to know if it exists or if there is a better way to approach this

Link to comment
Share on other sites

steam-tradeoffer-manager doesn't have anything native to avoid putting the same item into two trades. You're responsible for tracking which items you've already offered by assetid, and avoiding those items for future trades.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...