Package privbot.restock
@PublicApi
package privbot.restock
Restock and loot helpers shared by plugins:
RestockRunner with its
RestockRoute, RestockCycle and RestockHost,
plus GroundLoot and LootNames. ctx.restock routes to these
on servers that support them.-
ClassDescriptionPicks up ground items by name fragment and proves each pickup: Take, then wait for the inventory count of that id to rise.Detached ground item facts (read on the client thread, used on the worker).A loot setting as name fragments: "drygore, soul, contract" wants any ground item whose name contains one of them, case-insensitively.One restock trip as a stage machine: IDLE --begin--> HOME -> POOL -> BANK -> RETURNING -> IDLE.What a plugin tells
RestockRunnerandGroundLootabout itself: when to give up, where the player is, what counts as "back at the activity", and where capture rows go.What a restock trip clicks and how long each step may take: the home spell and where it lands, the restoring object, the bank and its preset action, and the teleport widget's way back.Runs aRestockCycleone confirmed step per call, on the script worker (it waits for each confirmation): Home: the home spell, after closing an open bank; confirmed by landing in the route's home area. Pool: the restoring object; confirmed byRestockHost.restored(); skipped when already full. Bank: the preset action on the nearest bank object, else a banker; confirmed by the worn and carried items changing.Whether the carried supplies call for a restock trip: how much food (items with an Eat action) and how many potions (items whose name contains one of the configured names; a flask or a vial counts once whatever its doses) are left, against the plugin's minimums.