✨ option to filter buy order that the bot can't afford to buy #332
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To enable this feature,
pricelist.filterCantAfford.enable
must be set totrue
(it'sfalse
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):
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):
AND
(20 >= 19.77 - true) =false
];AND
(20 >= 19.77 - true) =false
];AND
(20 >= 24.22 - false) =false
];AND
(20 >= 26.55 ref - false) =false
]; andAND
(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