13 posts
Posted 04 August 2013 - 01:32 AM
Title: how to dump whole turtle inventory?
So I've been wondering how to dump the whole turtle inventory with only a couple of lines because i don't want to go thru the time of typing turtle.select(1) turtle.dump() turtle.select(2) etc.etc. and if you can how to skip some slots as in to not dump a specific slot.
8543 posts
Posted 04 August 2013 - 02:14 AM
Split into new topic.
This would iterate through every slot in the turtle and drop all of the contents:
for i = 1, 16 do
turtle.select(i)
turtle.drop()
end
997 posts
Location
Wellington, New Zealand
Posted 04 August 2013 - 04:32 AM
To clarify, Lyqyd's code is the same as this, but using a loop to make the code shorter and less repetitive:
turtle.select(1)
turtle.drop()
turtle.select(2)
turtle.drop()
turtle.select(3)
turtle.drop()
turtle.select(4)
turtle.drop()
turtle.select(5)
turtle.drop()
turtle.select(6)
turtle.drop()
turtle.select(7)
turtle.drop()
turtle.select(8)
turtle.drop()
turtle.select(9)
turtle.drop()
turtle.select(10)
turtle.drop()
turtle.select(11)
turtle.drop()
turtle.select(12)
turtle.drop()
turtle.select(13)
turtle.drop()
turtle.select(14)
turtle.drop()
turtle.select(15)
turtle.drop()
turtle.select(16)
turtle.drop()
[removed incorrect information about turtle.drop]
8543 posts
Posted 04 August 2013 - 04:59 AM
That is incorrect;
turtle.drop() with no arguments will drop all items in the selected slot.