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

Add option toggle autoAddInvalidUnusual = false #412

Merged
merged 3 commits into from
Mar 4, 2021

Conversation

joekiller
Copy link
Collaborator

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

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;
Copy link
Member

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;

Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

@joekiller joekiller Mar 4, 2021

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

Copy link
Member

@idinium96 idinium96 Mar 4, 2021

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)

Copy link
Collaborator Author

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.

src/classes/Options.ts Outdated Show resolved Hide resolved
@joekiller joekiller requested a review from idinium96 March 4, 2021 14:40
Copy link
Member

@idinium96 idinium96 left a 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?

@joekiller
Copy link
Collaborator Author

Not at the moment. That could be considered a secondary part to this safety net. An option like notifyAcceptedInvalidUnusual or something?

@idinium96
Copy link
Member

yeah, something like that. I might add that while you're focusing on your medical work.

@idinium96
Copy link
Member

The latest commit should do the notifying job.

@idinium96
Copy link
Member

this looks good now I guess. merging...

@idinium96 idinium96 merged commit 068fec9 into development Mar 4, 2021
@idinium96 idinium96 mentioned this pull request Mar 4, 2021
@idinium96 idinium96 deleted the add-invalid-unusual-option branch March 5, 2021 01:14
idinium96 added a commit that referenced this pull request Mar 6, 2021
#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants