From acdd22bd1f75bacd9b10fdefb3a3b2e159e1401a Mon Sep 17 00:00:00 2001 From: Emerson Rosen-Jones Date: Fri, 16 Jan 2026 22:05:57 -0500 Subject: [PATCH] feat: keep requesting until above MAX_NUM --- compacting-storage.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compacting-storage.lua b/compacting-storage.lua index 9390591..272660e 100644 --- a/compacting-storage.lua +++ b/compacting-storage.lua @@ -163,6 +163,7 @@ end local main_t = peripheral.wrap(MAIN_TICKER) local request_t = peripheral.wrap(REQUEST_TICKER) +local requesting = {} while true do -- 1. Sum items in inventory and organize by item type local items = sum_items(main_t.stock) @@ -178,9 +179,13 @@ while true do diff = filter_clamp(diff, current_dist) local crafts = diff_to_crafts(diff) execute_crafts(item_type, crafts) + elseif num > MAX_NUM then + -- keep requesting until above MAX_NUM + requesting[item_type] = nil else - -- TODO - -- TODO potentially keep requesting until above MAX_NUM + requesting[item_type] = true + end + if requesting[item_type] then request_more(request_t, item_type) end end