From e333a1faad96a5a3d7ea03258ea2d92aaf0b6756 Mon Sep 17 00:00:00 2001 From: Olav Bakke Svendsen Date: Wed, 18 Oct 2023 03:22:02 +0200 Subject: [PATCH] Debugging --- steam/temporary-coal-feeder.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/steam/temporary-coal-feeder.lua b/steam/temporary-coal-feeder.lua index d128340..3761865 100644 --- a/steam/temporary-coal-feeder.lua +++ b/steam/temporary-coal-feeder.lua @@ -10,7 +10,7 @@ local start_coal_when = function(amt) return amt < 500 end local stop_coal_when = function(amt) return amt > 8000 end local rs_coal_side = "back" -local wood_to_keep_in_blaster = 10000 +local wood_to_keep_in_blaster = 1000 -- peripherals @@ -55,13 +55,22 @@ end local move_wood = function(wood_amount, farm_amount, farm_slot) local wood_amount, farm_amount = wood_amount, farm_amount local to_move = wood_to_keep_in_blaster - wood_amount - if to_move > 0 and to_move <= farm_amount then - local moved = farm_barrel.pushItems(peripheral.getName(wood_drawer), farm_slot, to_move) + print("move_wood pre:") + print(" in farm: "..tostring(farm_amount)) + print(" in blst: "..tostring(wood_amount)) + print(" to move: "..tostring(to_move)) + if to_move > 0 then + local moved = farm_barrel.pushItems(peripheral.getName(wood_drawer), farm_slot, math.min(to_move, farm_amount)) end if moved then wood_amount = wood_amount + moved farm_amount = farm_amount - moved end + print("move_wood post:") + print(" in farm: "..tostring(farm_amount)) + print(" in blst: "..tostring(wood_amount)) + print(" moved: "..tostring(moved)) + print("") return wood_amount, farm_amount end @@ -77,7 +86,7 @@ local feed = function(coal_amount) end local ok, e = f() if not ok then - print("Could not feed "..deployer_addr.."\n"..e) +-- print("Could not feed "..deployer_addr.."\n"..e) end end end -- 2.30.2