Posted 07 September 2012 - 02:34 AM
I have been trying to get this bug-proof for almost a week. No luck, but here's everything working except the Y level for the return on the way up. Assistance welcome and enjoy!
function Mine(x)
for i = 1, x do
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.digUp()
turtle.up()
turtle.dig()
turtle.digUp()
turtle.up()
turtle.dig()
turtle.turnRight()
turtle.turnRight()
turtle.dig()
turtle.down()
turtle.dig()
turtle.down()
turtle.dig()
turtle.down()
turtle.turnLeft()
end
end
function Down(x)
for i = 1, x do
turtle.digDown()
turtle.down()
end
end
function Up(x)
for i = 1, x do
turtle.up()
end
end
function Return(x)
for i = 1, x do
turtle.forward()
end
end
term.clear()
term.setCursorPos(1,1)
print("How far should I mine?")
local a = read()
term.clear()
term.setCursorPos(1,1)
print("How far down should I go?")
local b = read()
term.clear()
term.setCursorPos(1,1)
print("Mining...")
Down(b)
Mine(a)
turtle.turnLeft()
turtle.turnLeft()
Return(a)
Up(b)
turtle.turnLeft()
turtle.turnLeft()