This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
akeldama280's profile picture

[Lua Noob] Turtle Put stuff in chest

Started by akeldama280, 23 March 2013 - 06:41 AM
akeldama280 #1
Posted 23 March 2013 - 07:41 AM
I would like to know how to make my turtle automatically check if it can hold no more items in its inventory, and go back to a certain spot and empty itself. Can anyone help?
Lyqyd #2
Posted 23 March 2013 - 07:45 AM
Moved to Ask a Pro.
Apfeldstrudel #3
Posted 23 March 2013 - 08:28 AM
that depends on what its storing, for example a excavating turtle would do

if turtle.getItemCount(16) >0 then
  for i = 1, 16 do
    turtle.select(i)
    turtle.drop()
  end
end

That would check if the turtle had started filling the last space of its inventory ( example: if the turtle had only collected cobblestone but found redstone every slot would be filled with cobblestone and the redstone would not be picked up)