-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add option toggle autoAddInvalidUnusual = false #412
Conversation
If the bot accepts an Unusual item that is not on the price list it will not put it back up for sale unless autoAddInvalidUnusual is set to true. The option is set to false by default to protect users who use the generic price SKU and unaware that autoAddInvalidItems would sell off anything purchased via that generic sku. Based off conversation in #400
@@ -44,6 +44,9 @@ export default function updateListings( | |||
const isDisabledHV = highValue.isDisableSKU.includes(sku); | |||
const isAdmin = bot.isAdmin(offer.partner); | |||
const isNotSkinsOrWarPaint = SKU.fromString(sku).wear === null; | |||
// if item is unusual and autoAddInvalidUnusual is set to true then we allow addInvalidUnusual. | |||
// If the item is not an unusual sku, we "allow" still (no-op) | |||
const addInvalidUnusual = SKU.fromString(sku).quality === 5 ? opt.pricelist.autoAddInvalidUnusual : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mainly for the Generic Unusual feature right?
So I guess it's much better to do it like this (together with some small refactorization):
const item = SKU.fromString(sku);
const isNotSkinsOrWarPaint = item.wear === null;
const addInvalidUnusual = item.quality === 5 && item.effect === null ? opt.pricelist.autoAddInvalidUnusual : true;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, wait. I don't think item.effect === null
is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, scratch that. My bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was about to say. I think in this case the SKU detected would be the SKU of the actual item at this point, so it would have an effect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep correct. It's not like when receiving the painted item (with normalize.painted.their
set to true
) or sold painted item to the trade partner (with normalize.painted.our
set to false
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is somewhat a strange statement but it really should be "true" if either:
the item is unsual and we autoAddInvalidUnusual or,
if the item isn't an unusual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is somewhat a strange statement but it really should be "true" if either:
- the item is unsual and we autoAddInvalidUnusual or,
- if the item isn't an unusual.
very true. but will the bot notify the owner about this?
Not at the moment. That could be considered a secondary part to this safety net. An option like notifyAcceptedInvalidUnusual or something? |
yeah, something like that. I might add that while you're focusing on your medical work. |
The latest commit should do the notifying job. |
this looks good now I guess. merging... |
#411 ## Added - Mainly if you're using generic Unusual buy order feature: - ✨option to not automatically add bought Unusual item to the pricelist (usual because buying with Generic Unusual buy order - #412, [Wiki](https://github.com/TF2Autobot/tf2autobot/wiki/Configure-your-options.json-file#--automatic-add-invalid-unusual--)) - @joekiller - new options added: - `pricelist.autoAddInvalidUnusual.enable` (default is `false`) - `sendAlert.receivedUnusualNotInPricelist` (default if `true`) - ✨HTTP API health check (and others in the future - #413, [Wiki](https://github.com/TF2Autobot/tf2autobot/wiki/Configuring-the-bot#api)) - @rennokki - new env variables: - `ENABLE_HTTP_API` (default is `false`) - `HTTP_API_PORT` (default is `3001`) - ✨option to show proper item name in trade/offer summary (with "The", no short - #415, [Wiki](https://github.com/TF2Autobot/tf2autobot/wiki/Configure-your-options.json-file#-trade-summary-settings-)) - @idinium96 - new options added: - `tradeSummary.showProperName` (default is `false`) ## Updates - Partial price update feature (updated #337): - ⛔ do not partial price Mann Co. Supply Crate Key (#407) - @idinium96 - ✅ add an option to exclude items for partial price update (#408, [Wiki](https://github.com/TF2Autobot/tf2autobot/wiki/Configure-your-options.json-file#--partial-price-update--)) - @idinium96 - new options.json property: `pricelist.partialPriceUpdate.excludeSKU` (default is `[]`) - 💅 include name in partial price update summary (#409) - @idinium96 - ⛔ do not perform usual update if grouped (#410) - @idinium96 - 🔨 refactor Bot.ts (#399) - @arik123 - 🔎🔑 keyPrices verification (2) and 🔨 small refactor on Pricelist.ts (#416) - @idinium96 - 🔕 ignore some error on fail action or to accept mobile confirmation (#419) - @idinium96 - 🔨 refactor: use Map and Set (#420) - @idinium96 - 🎨 show amount offering/offered/taking/taken in overstocked/understocked review/trade summary (#421) - @idinium96
If the bot accepts an Unusual item that is not on the price list it will not put it back up for sale unless autoAddInvalidUnusual is set to true. The option is set to false by default to protect users who use the generic price SKU and unaware that autoAddInvalidItems would sell off anything purchased via that generic sku.
Based off conversation in #400