From 10edbe8ffffc03ef90d3b2b31154a334afc1e108 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Mon, 16 Mar 2026 18:41:15 -0400 Subject: [PATCH] Enhance autoSmelt function by adding cache adjustments for item movements --- inventoryManager.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inventoryManager.lua b/inventoryManager.lua index 31803e5..52bef6c 100644 --- a/inventoryManager.lua +++ b/inventoryManager.lua @@ -2201,6 +2201,7 @@ local function autoSmelt() for _, chest in ipairs(chests) do local n = furnace.pushItems(chest, SLOT_OUTPUT) if n and n > 0 then + adjustCache(outputItem.name, chest, n) remaining = remaining - n print(string.format("[SMELT] Output %s x%d -> %s", outputItem.name, n, chest)) @@ -2221,6 +2222,7 @@ local function autoSmelt() for _, chest in ipairs(chests) do local n = furnace.pushItems(chest, slot) if n and n > 0 then + adjustCache(item.name, chest, n) print(string.format("[SMELT] Extra slot %d: %s x%d -> %s", slot, item.name, n, chest)) didWork = true @@ -2252,6 +2254,7 @@ local function autoSmelt() for _, chest in ipairs(chests) do local n = furnace.pushItems(chest, SLOT_INPUT) if n and n > 0 then + adjustCache(inputItem.name, chest, n) print(string.format("[SMELT] Removed incompatible %s x%d from %s -> %s", inputItem.name, n, fname, chest)) didWork = true @@ -2278,6 +2281,7 @@ local function autoSmelt() local toMove = math.min(16, slotItem.count) local n = chest.pushItems(fname, slot, toMove, SLOT_FUEL) if n and n > 0 then + adjustCache(fuel.name, source.chest, -n) print(string.format("[SMELT] Fuel %s x%d -> %s", fuel.name, n, fname)) didWork = true @@ -2347,6 +2351,7 @@ local function autoSmelt() local toMove = math.min(slotItem.count, remaining) local n = chest.pushItems(fname, slot, toMove, SLOT_INPUT) if n and n > 0 then + adjustCache(itemName, source.chest, -n) print(string.format("[SMELT] Input %s x%d -> %s (reserve %d)", itemName, n, fname, math.max(0, totalInStorage - n))) didWork = true