Items in drawers are in slot 2, not 1
authorOlav Bakke Svendsen <mail@olavbs.no>
Wed, 18 Oct 2023 01:30:02 +0000 (03:30 +0200)
committerOlav Bakke Svendsen <mail@olavbs.no>
Wed, 18 Oct 2023 01:30:02 +0000 (03:30 +0200)
steam/temporary-coal-feeder.lua

index 4377d12c421ae751cea990a6ae9413531afddc69..9c9ddc1ed1f019d7a03d2dfdca3b8650997ff4e2 100644 (file)
@@ -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)