Posted 22 December 2012 - 12:14 PM
Hey guys I'm pretty new to this community and I only recently started trying to make ComputerCraft programs. I have a program that I wrote to automatically chop down trees and and deposit the logs into a chest. Currently the method I'm using to deposit the logs is really long and I'm sure there is some kind of loop I can use to shorten it. But being the beginner I am I don't know how exactly. The current code goes like this:
Any help as to how I could make a loop to cycle through inventory slots and drop items into a chest would be appreciated.
turtle.getItemCount(16)
if turtle.getItemCount(16) >= 64 then
turtle.turnRight()
turtle.turnRight()
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()
turtle.turnLeft()
turtle.turnLeft()
end
Any help as to how I could make a loop to cycle through inventory slots and drop items into a chest would be appreciated.