diff --git a/inventoryManager.lua b/inventoryManager.lua index 2a0bd52..51aafe0 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -426,6 +426,23 @@ local function main() end end, + -- Task 5b: Auto-discard excess stock + function() + if #cfg.TRASH_DROPPERS == 0 then + while true do sleep(3600) end + end + sleep(8) -- let initial scan finish first + log.info("DISCARD", "Auto-discard active with %d trash dropper(s)", #cfg.TRASH_DROPPERS) + while true do + activity.discarding = true + state.needsRedraw = true + pcall(ops.discardExcess) + activity.discarding = false + state.needsRedraw = true + sleep(cfg.DISCARD_INTERVAL) + end + end, + -- Task 6: Low-stock alert checker function() sleep(5)