feat: implement auto-crafting feature for excess stock management

This commit is contained in:
MayaTheShy
2026-03-25 18:07:26 -04:00
parent 2c99169ce9
commit f327f82677
6 changed files with 99 additions and 0 deletions

View File

@@ -64,6 +64,9 @@ C.TRASH_DROPPERS = { -- droppers facing lava/void for destroying
}
C.DISCARD_INTERVAL = 5 -- seconds between discard checks
-- Auto-craft (overridable via config file)
C.AUTO_CRAFT_INTERVAL = 10 -- seconds between auto-craft checks
-- Peripheral
C.PERIPHERAL_CACHE_TTL = 5
@@ -126,6 +129,7 @@ function C.loadConfig()
if cfg.compostHopper then C.COMPOST_HOPPER = cfg.compostHopper end
if cfg.trashDroppers then C.TRASH_DROPPERS = cfg.trashDroppers end
if cfg.discardInterval then C.DISCARD_INTERVAL = cfg.discardInterval end
if cfg.autoCraftInterval then C.AUTO_CRAFT_INTERVAL = cfg.autoCraftInterval end
if cfg.stockLimits then
for item, limit in pairs(cfg.stockLimits) do
C.STOCK_LIMITS[item] = limit -- merge / override per-item
@@ -149,6 +153,7 @@ local _compostData = dofile(_path("data/compostable.lua"))
C.COMPOSTABLE = _compostData.items
C.COMPOST_TRASH = _compostData.trash
C.STOCK_LIMITS = dofile(_path("data/stock_limits.lua"))
C.AUTO_CRAFT_RULES = dofile(_path("data/auto_craft.lua"))
C.LOW_STOCK_ALERTS = dofile(_path("data/alerts.lua"))
-- Recipe book: merges built-in recipes + user-learned recipes