Posted 13 February 2013 - 02:28 PM
Now I know there are already many turtle quarry programs out there, but I like to try to create my own. Case in point. I'm creating one, but once I activate it to only do 1 layer, it does not finish the last zcoord column, and if I begin to add layers, it does even weirder things.
This program is loosely based on my other quarry program that I asked for help on a couple weeks ago, but for the most part is completely different. Here it is below:
Edit: I found a solution. While it may not be the most elegant, it seems to work.
solution below
This program is loosely based on my other quarry program that I asked for help on a couple weeks ago, but for the most part is completely different. Here it is below:
Edit: I found a solution. While it may not be the most elegant, it seems to work.
solution below
y=3 -- Up/Down
x=3 -- East/West
z=3 -- North/South
zReverse=false
xreverse=false
function xMovE()
for cX=1, x-1 do
zMovE()
if zReverse and not xReverse then
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
elseif zReverse and xReverse then
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
elseif not zReverse and xReverse then
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
else
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
end
xReverse=not xReverse
end
function zMovE()
for cZ=1, z-1 do
turtle.dig()
turtle.forward()
end
zReverse=not zReverse
end
function layer()
turtle.digDown()
turtle.down()
xMovE()
zMovE()
zReverse=not zReverse
xReverse=not xReverse
turtle.turnLeft()
turtle.turnLeft()
end
function excavate()
for i=1, y do
layer()
end
end
excavate()