Posted 25 February 2012 - 04:37 AM
I'm trying to make a program for my turtle to make it mine, and the program asks me for the depth, so I put it in, it digs down, moves down, digs forward, then I get this error: miner:7: attempt to call nil.
Here's my code:
Also, I'm pretty new at lua coding, so forgive me for any rookie errors :P/>/>
Here's my code:
write("Depth: ")
depth = read()
local function mineForward(blocks)
for counter=0, blocks, 1 do
turtle.dig()
turtle.Forward()
end
end
for counter=0, depth, 1 do
turtle.digDown()
turtle.down()
mineForward(6)
turtle.turnRight()
turtle.dig()
turtle.Forward()
turtle.turnRight()
mineForward(6)
turtle.turnRight()
turtle.dig()
turtle.Forward()
turtle.turnRight()
end
for counter=0, depth, 1 do
turtle.up()
end
Also, I'm pretty new at lua coding, so forgive me for any rookie errors :P/>/>