Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect items already in offers (inOffer property) #186

Open
demipixel opened this issue Nov 28, 2016 · 7 comments
Open

Detect items already in offers (inOffer property) #186

demipixel opened this issue Nov 28, 2016 · 7 comments

Comments

@demipixel
Copy link

I'd like to know which items are already in offers when loading my inventory. It's possible to do manually (either by loading all offers when attempting to load your inventory or loading once at the beginning and keeping track via events which items are in offers and which are no longer in any offers).

So the suggestion is:

  1. Load all offers on startup, save each item from the user in a dictionary
  2. Offer changed events detects if an offer was changed (remove items from dictionary whether accepted or declined—not in an offer anymore)
  3. When loading the user's inventory, modify the EconItem to include an inOffer boolean

Yes, it's possible to do yourself by watching newOffer, sentOfferChanged, and receivedOfferChanged, but I would imagine almost any bot (except receive-only bots) want to ensure users get different instances of the same item so trade offers for the same type of item don't clash.

@andrewda
Copy link
Contributor

Good idea, but might be very inefficient to load all offers on startup. This should probably be an optional feature.

@vankxr
Copy link

vankxr commented Nov 28, 2016

How does steam handle this? Like when you open your inventory you have the in trade flag. How does steam flag this to the user ?

@demipixel
Copy link
Author

@vankxr Is there an in-trade flag? Is that new? I think (thought) Steam doesn't support this, it's just especially useful for bots.

@andrewda
Copy link
Contributor

andrewda commented Nov 29, 2016

Nope, no official Steam in-trade flag AFAIK, though I think 3rd party extensions such as Steam Inventory Helper provide one.

@DoctorMcKay
Copy link
Owner

Steam doesn't do anything special to prevent you from putting the same item in multiple trades.

@vankxr
Copy link

vankxr commented Nov 29, 2016

Oh, stupid me. I forgot i was using steam inventory helper :(

Anyways I still agree majority of users of this module will need it.

@ciwox
Copy link

ciwox commented Jun 20, 2017

Just make yourself an array, and push the assetid whenever you put an item up for trade.
If you get an error while the trade is being sent, just remove the assetid from the array. That's how I did it. Works pretty well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants