Posted 06 February 2013 - 05:47 PM
I am making a land clearing program. I have it mostly done, but I've found that it will turn one time too many. I want it to clear out, say, an 5x5 area, it will do the fifth line, and then turn again.
Also, for efficiency, I have my turtle breaking the blocks in front, above, and below it, then moving up three spaces. This makes the problem of if I want it ten high, it will go to twelve (or possibly 9, I haven't thoroughly tested it)
Any suggestions?
function plane()
for i = 1,width do
line() -- just does how far to go and digging
if length%2==0 then
nextLeft() -- runs the function to turn left
else
nextRight() -- runs the function to turn right
end
end
end
Also, for efficiency, I have my turtle breaking the blocks in front, above, and below it, then moving up three spaces. This makes the problem of if I want it ten high, it will go to twelve (or possibly 9, I haven't thoroughly tested it)
high = 10
function uplvl()
for i = 1,high,3 do
turtle.digUp()
turtle.up()
turtle.digUp()
turtle.up()
turtle.digUp()
turtle.up()
end
end
Any suggestions?