From 0f1ace911626ae7f16e733da8f2e59764859eb90 Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Fri, 2 Jan 2026 23:58:27 -0500 Subject: [PATCH] fix: get to a working state --- oregen-manager.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/oregen-manager.lua b/oregen-manager.lua index e926857..155eef9 100644 --- a/oregen-manager.lua +++ b/oregen-manager.lua @@ -101,7 +101,7 @@ function cycleItems (ticker, items) local makeRequest makeRequest = function (item, amt, addr) local limit = 64 - if addr = MELTER_ADDR then limit = 9 end + if addr == MELTER_ADDR then limit = 9 end if amt < limit then return end local request = { name = item, @@ -109,7 +109,7 @@ function cycleItems (ticker, items) } ticker.requestFiltered(addr, request) os.sleep(1) - return makeRequest(item, amt - limit) + return makeRequest(item, amt - limit, addr) end for _, pair in pairs(PRODUCTS) do local name, addr = pair[1], pair[2] @@ -142,20 +142,22 @@ function getNumCraftable (recipe, current_stock) result = math.min(result, num) end end + if result == nil then result = 0 end return result end function craftRecipe (ticker, recipe, count) if count == nil then count = 1 end local createRequest - createRequest = function (recipe) - local ingredient = table.remove(recipe) + createRequest = function (recipe, i) + if i == nil then i = 1 end + local ingredient = recipe[i] if ingredient == nil then return end local item = { name = ingredient[1], _requestCount = ingredient[2], } - return item, createRequest(recipe) + return item, createRequest(recipe, i + 1) end while count > 0 do ticker.requestFiltered(PRESS_ADDR, createRequest(recipe))