From 346bfeee4c12f6f765589d2c178d3db5dae1b638 Mon Sep 17 00:00:00 2001 From: Olav Bakke Svendsen Date: Wed, 18 Oct 2023 03:30:02 +0200 Subject: [PATCH] Items in drawers are in slot 2, not 1 --- steam/temporary-coal-feeder.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/steam/temporary-coal-feeder.lua b/steam/temporary-coal-feeder.lua index 4377d12..9c9ddc1 100644 --- a/steam/temporary-coal-feeder.lua +++ b/steam/temporary-coal-feeder.lua @@ -33,10 +33,10 @@ end -- program local take_stock = function() - local coal_item_detail = coal_drawer.getItemDetail(1) + local coal_item_detail = coal_drawer.getItemDetail(2) local coal_amount = coal_item_detail and coal_item_detail.count or 0 - local wood_item_detail = wood_drawer.getItemDetail(1) + local wood_item_detail = wood_drawer.getItemDetail(2) local wood_amount = wood_item_detail and wood_item_detail.count or 0 local farm_amount = 0 @@ -82,7 +82,7 @@ local feed = function(coal_amount) local f = function() return false, "No coal available" end if coal_amount >= refill_amt then coal_amount = coal_amount - refill_amt - f = function() return deployer.pullItems(peripheral.getName(coal_drawer), 1, refill_amt, 1) end + f = function() return deployer.pullItems(peripheral.getName(coal_drawer), 2, refill_amt, 1) end end local ok, e = f() if not ok then @@ -179,7 +179,8 @@ while true do print("coal: "..tostring(coal_amount)) print("wood: "..tostring(wood_amount)) print("farm: "..tostring(farm_amount)) --- wood_amount, farm_amount, farm_slot = move_wood(wood_amount, farm_amount, farm_slot) + print("") + wood_amount, farm_amount, farm_slot = move_wood(wood_amount, farm_amount, farm_slot) local coal_online, wood_online = manage_farms(coal_amount, wood_amount, farm_amount) print_spinner(main_monitor, 29,12, "*") coal_amount = feed(coal_amount) -- 2.30.2