http://pastebin.com/GvbvvZFX
--clear inventory
for i = 1, 16 do
turtle.select(i)
turtle.dropDown()
end
sleep(1)
--get enough items
turtle.select(1)
turtle.suckDown()
sleep(1)
if turtle.getItemCount(1) < 9 then
os.reboot()
end
--distribute items
turtle.transferTo(2,1)
turtle.transferTo(3,1)
turtle.transferTo(5,1)
turtle.transferTo(6,1)
turtle.transferTo(7,1)
turtle.transferTo(9,1)
turtle.transferTo(10,1)
turtle.transferTo(11,1)
sleep(1)
--craft and expel item to front
turtle.select(16)
turtle.craft()
turtle.drop()
os.reboot()
Program renamed to startup and with 3 nuggets in the chest below the turtle, first iteration results in a reboot. Second iteration, turtle ignores the ItemCount conditional and proceeds to distribute items anyway, runs out, and exits to prompt.
Unsure of why the conditional gets ignored after the first reboot. With nugget count of 9/more in chest, everything works as intended. Any help is appreciated.
--clear inventory
for i = 1, 16 do
turtle.select(i)
turtle.dropDown()
end
sleep(1)
--get enough items
turtle.select(1)
turtle.suckDown()
sleep(1)
if turtle.getItemCount(1) < 9 then
os.reboot()
end
--distribute items
turtle.transferTo(2,1)
turtle.transferTo(3,1)
turtle.transferTo(5,1)
turtle.transferTo(6,1)
turtle.transferTo(7,1)
turtle.transferTo(9,1)
turtle.transferTo(10,1)
turtle.transferTo(11,1)
sleep(1)
--craft and expel item to front
turtle.select(16)
turtle.craft()
turtle.drop()
os.reboot()
Program renamed to startup and with 3 nuggets in the chest below the turtle, first iteration results in a reboot. Second iteration, turtle ignores the ItemCount conditional and proceeds to distribute items anyway, runs out, and exits to prompt.
Unsure of why the conditional gets ignored after the first reboot. With nugget count of 9/more in chest, everything works as intended. Any help is appreciated.