Posted 01 February 2013 - 03:30 PM
I started working on a new turtle quarry program, but I am having a problem with it. I want the user to be able to type in how deep they want the quarry to be however I can't seem to get it to stop once it gets to that depth. This is what I have:
Help is appreciated!
Thanks! :D/>
local tArgs = { ... }
local depth = 0
local maxdepth = tArgs[1]
local fuel = turtle.getFuelLevel()
local function qry()
turtle.digDown()
turtle.down()
turtle.dig()
turtle.turnLeft()
turtle.dig()
turtle.turnLeft()
turtle.dig()
turtle.turnLeft()
turtle.dig()
turtle.turnLeft()
end
local function dropoff()
for i = 1, 16 do
turtle.select(i)
turtle.dropUp()
i = i+1
end
end
term.clear()
term.setCursorPos(1,1)
print("I will try to go down ",maxdepth," blocks")
print(maxdepth)
while depth ~= maxdepth do
qry()
depth = depth+1
print(depth)
end
for i = 1, depth do
turtle.up()
end
dropoff()
When I run the program it just keeps going after reaching the specified depth. Some of the things in the program are my debug attempts. Help is appreciated!
Thanks! :D/>