Add conditional

This commit is contained in:
Salt 2023-12-01 12:14:25 -06:00
parent 8129f039cd
commit 946d96a6af

View File

@ -5,7 +5,8 @@ function placeBreeder()
breeder = peripheral.wrap('top') breeder = peripheral.wrap('top')
-- First, we nab the new chicken in slot 1 -- First, we nab the new chicken in slot 1
turtle.select(1) turtle.select(1)
turtle.suckUp() -- Check to see if this iteration obtained a new chicken
if turtle.suckUp() then
-- Then, we destroy the breeder -- Then, we destroy the breeder
turtle.select(2) turtle.select(2)
turtle.digUp() turtle.digUp()
@ -18,6 +19,11 @@ function placeBreeder()
-- In any case, discarding 1 item in slot 2 will eliminate poor genes -- In any case, discarding 1 item in slot 2 will eliminate poor genes
--turtle.select(2) -- Unnecessary due to previous instr --turtle.select(2) -- Unnecessary due to previous instr
turtle.dropDown(1) turtle.dropDown(1)
else
-- Just pop the breeder for consistency
turtle.select(2)
turtle.digUp()
end
-- Now we re set-up the breeder -- Now we re set-up the breeder
selectItem('chickens:breeder') selectItem('chickens:breeder')
turtle.placeUp() turtle.placeUp()