feat(seller): restock sold out items in batches instead of one stack per cycle - #33
Merged
Merged
Conversation
…per cycle GetItemsToSell() put every price override item that was absent from the auction house into the priority block exactly once, so a sold out item came back at one stack per cycle at best, and only if it won the shuffle against every other missing item within that cycle's ItemsPerCycle budget. The priority block now queues an item as many times as it is short of its target count - the per-item mod_auctionhousebot_countOverride value, else the global DuplicatesCount, else one stack, matching the cap Sell() already enforces per listing. Items still partially stocked are topped up too, after the sold out ones. AuctionHouseBot.RestockBatchSize (default 5) bounds how many stacks of a single item one cycle may queue; 1 keeps the old behaviour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When an item sells out (Thick Leather was the reported case) it takes a long time to come back, and then only one stack at a time.
GetItemsToSell()builds its priority block by walkingitemPriceOverridesand pushing each item that is not currently in the auction house once. With ~11.5k price override rows, a specific missing item has to win a shuffle against every other missing item to land inside that cycle'sItemsPerCycle(200) budget — hence the wait. And becauseitemsInAHis snapshotted at cycle start and the item appears once, it can only ever be relisted as a single stack per cycle.Change
The priority block now queues an item as many times as it is short of its target count:
mod_auctionhousebot_countOverride.targetCount, else the globalAuctionHouseBot.DuplicatesCount, else 1 — the same precedence the per-listing cap inSell()already applies, so the batch can never overshoot (botItemCountsis incremented per listing).New setting
AuctionHouseBot.RestockBatchSize(default 5) bounds how many stacks of one item a single cycle may queue, so one item with a target of 50 cannot eat the wholeItemsPerCyclebudget. Set it to1for the previous one-stack-per-cycle behaviour.TraceSellernow logs how many items were sold out vs understocked per cycle.Behaviour notes
countOverriderows loaded, the priority block is now larger and blocks 2–4 (random duplicates / non-override bins) are reached even less often than before. That is intended: restocking is now targeted instead of random.countOverriderows andDuplicatesCount = 0see no change (target falls back to 1 stack).Verification
missingStacks()(sold out / partial / at target / no override / batch size 1 / batch size 0) — all assertions pass.core-buildworkflow on this PR.Files
src/AuctionHouseBot.cpp— batching logic inGetItemsToSell(),botItemCountspassed insrc/AuctionHouseBot.h— signaturesrc/AuctionHouseBotConfig.{h,cpp}—RestockBatchSizeconf/mod_ahbot.conf.dist— setting + docs