Posted 18 May 2015 - 03:02 AM
So the only problem I'm having here is getting the turtle to switch between slots when the selected slot has 1 item in it. I can get through the first stack, and the second stack but it wont move to the 3rd, 4th and so on.
below is my code
below is my code
function forward(blockCount)
turtle.select(blockCount)
if turtle.getItemCount(blockCount) == 1 or blockCount > 14 then
blockCount = blockCount + 1
turtle.select(blockCount)
end
turtle.placeDown()
turtle.forward()
end
function turnRight()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end
function turnLeft()
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
rows = 30
columns = 30
blockCount = 1
for i = 0, columns do
for j = 0, rows do
forward(blockCount)
end
if i == 0 or i % 2 == 0 then
turnRight()
else
turnLeft()
end
end