Crafty Turtle Issues

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

SmokeLuvr1971

New Member
Jul 29, 2019
753
0
0
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.
 

SmokeLuvr1971

New Member
Jul 29, 2019
753
0
0
Still dunno why the conditional gets ignored, but removed the second reboot and wrapped everything in an infinite loop and that seems to have solved the problem. Also added a second suckDown command in-case to insure the chest doesn't fill up.
 

immibis

New Member
Jul 29, 2019
884
0
0
You can't reboot within 5 seconds of booting to prevent lagmachines.
os.reboot() is not a loop.