farm_control.lua: added logic to prevent extra planting
This commit is contained in:
parent
6310e3f741
commit
4e0905b5f8
1 changed files with 7 additions and 0 deletions
|
|
@ -55,6 +55,12 @@ function check_levels (levels, src)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function empty_into (src, dest)
|
||||||
|
for slot, _ in pairs(peripheral.call(src, "list")) do
|
||||||
|
peripheral.call(src, "pushItems", dest, slot)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function load_stack(item_name, src, dest)
|
function load_stack(item_name, src, dest)
|
||||||
local src = peripheral.wrap(src)
|
local src = peripheral.wrap(src)
|
||||||
for slot, item in pairs(src.list()) do
|
for slot, item in pairs(src.list()) do
|
||||||
|
|
@ -83,6 +89,7 @@ if arg[1] == "replant" then
|
||||||
end
|
end
|
||||||
send_machine(PLANTER_RELAY)
|
send_machine(PLANTER_RELAY)
|
||||||
os.sleep(SLEEP_TIME)
|
os.sleep(SLEEP_TIME)
|
||||||
|
empty_into(PLANTER, STORAGE)
|
||||||
end
|
end
|
||||||
send_machine(HARVESTER_RELAY)
|
send_machine(HARVESTER_RELAY)
|
||||||
os.sleep(SLEEP_TIME)
|
os.sleep(SLEEP_TIME)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue