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

✨ option to filter buy order that the bot can't afford to buy #332

Merged
merged 3 commits into from
Feb 12, 2021

Conversation

idinium96
Copy link
Member

@idinium96 idinium96 commented Feb 12, 2021

To enable this feature, pricelist.filterCantAfford.enable must be set to true (it's false by default).
Note that, this feature will only do its job every 30 minutes IF the missing OR re-adding items is less than 1000 items, otherwise, it will do this job again after 60 minutes.

How does this feature work?

Let's say your bot currently has 6 keys, 150 ref in their inventory on start. If you have this feature enabled, then your bot will NOT create buy orders for items with buying prices of more than 6 keys AND more than 150 ref.

Let say you have these in your pricelist (item - buying price):

  • Strange Splendid Screen - 7 keys, 19.77 ref
  • Genuine Maul - 6 keys, 19.77 ref
  • Strange Loose Cannon - 5 keys, 24.22 ref
  • Strange Ullapool Caber - 5 keys, 12.22 ref
  • Strange Festive Flare Gun - 4 keys, 26.55 ref
  • Genuine Sharp Dresser - 4 keys, 20.77 ref

At first, your bot will only NOT list Strange Splendid Screen because the buying price for keys is more than what currently your bot has.

Then let say your bot made some valid trades and suddenly your bot's pure is now 5 keys 20 ref. Now you'll see that all these buy orders are all hidden in backpack.tf (once backpack.tf fully load your bot inventory data):

  • Strange Splendid Screen [(5 >= 7 - false) AND (20 >= 19.77 - true) = false];
  • Genuine Maul [(5 >= 6 - false) AND (20 >= 19.77 - true) = false];
  • Strange Loose Cannon [(5 >= 5 - true) AND (20 >= 24.22 - false) = false];
  • Strange Festive Flare Gun [(5 >= 4 - true) AND (20 >= 26.55 ref - false) = false]; and
  • Genuine Sharp Dresser [(5 >= 4 - true) AND (20 >= 20.77 ref - false) = false]

All of these hidden buy orders (can't afford) will be removed once the automatic check for missing listings OR auto-relist is executed. The bot will NOT update it immediately.

Then let say your bot is back to have enough pure to buy those items, then it will be added on the next automatic check for missing listings OR auto-relist. If the items that are missing OR need to be re-add are more than 1000 items, the next automatic check for missing listings will be executed in 1 hour, else, it will be executed in 30 minutes.

If you're using this feature, please expect your bot buy orders will never get fully listed UNLESS your bot has enough keys and pure metals to buy it.

Some screenshots

image
image

@idinium96 idinium96 merged commit 15a4a8e into development Feb 12, 2021
@idinium96 idinium96 mentioned this pull request Feb 12, 2021
idinium96 added a commit that referenced this pull request Feb 14, 2021
#336 for v3.3.0

## Added
- ✨ option to filter buy order that the bot can't afford to buy. Read: #332 - @idinium96
- ✨🎨 An option to replace keys & pure metals with emoji (Discord Webhook) - @idinium96
    - added `showPureInEmoji` under `tradeSummary` option parent property.
    - this option is `false` by default. Set it to `true` (by sending `!config tradeSummary.showPureInEmoji=true` to your bot) if you want to enable this feature.
    - screenshot: 
![image](https://user-images.githubusercontent.com/47635037/107742639-6554dd00-6d4a-11eb-8a64-fa9d81b2d8cc.png)
![image](https://user-images.githubusercontent.com/47635037/107866197-0063c900-6ea9-11eb-8996-42ea98142637.png)

- ✨ add missing `isFull` attribute (for duel/noise) - @idinium96
- ✨🔨 add missing highValue meta, only define if true, and 🎨🔨 simplified - @idinium96
- ✨ add `!offerinfo` command - @idinium96

## Changed/Updated
- 💡 refactor: always show `group` on item add/update (#324) - @Bonfire
- 🔨 refactor: Commands, from functions to sub-classes - @idinium96
- 🔨 refactor: take out `meta` from `action` - @idinium96
    - 🔥 remove `notify` & `meta` from polldata on successful accepted, declined, cancelled, and invalidItems trades (reduce polldata file size)
- ⬆ increase setTimeout retry time from 3 seconds to 30 seconds - @idinium96
- ⬆ increase pollInterval from 1 second to 30 seconds (use less CPU) - @idinium96
- 🎨 bring back square bracket if `showChanges` is enabled - @idinium96
- ⭕ ignore trades from admins to count in profit (#299) - @idinium96
- 🔔 notify the owner if there's an error while trying to accept mobile confirmation (will not perform automatic retry here) - @idinium96
    - if the error is `HTTP error 502`, there is a high chance that the offer is still active, otherwise, it's most likely canceled (idk how to make it not to cancel the trade).
- 🔄 update `options` schema - @idinium96
    - get rid of `allOf` - prevent the owner from putting invalid option property.
    - **those that might already add some foreign properties (such as `enabled` for an actual `enable` key), your bot might not be able to start if you update to this version. Be sure to check your bot logs.**

## Fixed
- 🔄 update `bptf-listings-2` library
    - 🐛 fix not detect Festivized items ([`bptf-listings-2: cc136f0`](idinium96/node-bptf-listings-2@cc136f0)) - @idinium96
    - 🐛 fix and convert stock weapon defindex into upgradeable weapon defindex (`bptf-listings-2:` [`387e0a3`](idinium96/node-bptf-listings-2@387e0a3), [`b029d59`](idinium96/node-bptf-listings-2@b029d59)) - @idinium96
    - 🐛 fix defindex for Killstreak (Basic) Kit ([`bptf-listings-2: e2f0152`](idinium96/node-bptf-listings-2@e2f0152)) - @idinium96
    - 🐛 fix exclusive promo items defindex ([`bptf-listings-2: 3076fa4`](idinium96/node-bptf-listings-2@3076fa4))  - @idinium96
    - 🐛 fix wrong wear value ([`bptf-listings-2: 953f6c3`](idinium96/node-bptf-listings-2@953f6c3)) - @idinium96
- 🐛 fix `!check` command always getting error - @idinium96
@idinium96 idinium96 deleted the filter-cant-afford branch February 15, 2021 08:42
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.

1 participant