From 22836dafb222eee038c639064358efa55e0466e2 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Wed, 25 Mar 2026 17:46:18 -0400 Subject: [PATCH] feat: implement auto-discard feature for excess stock management --- inventoryManager.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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)