Posted 11 July 2013 - 03:20 PM
Every time I try to run my program, I get an error reading, "mainTunnel :3: attempt to index ? (a nil value.)"
For the command line arguments I put in "4 3 2". Please help. I have looked at all of the tutorials i could find on these arguments and I can't figure out what went wrong.
For the command line arguments I put in "4 3 2". Please help. I have looked at all of the tutorials i could find on these arguments and I can't figure out what went wrong.
local tArgs = {...}
local width = tArgs[1]
local height = tARgs[2]
local depth = tArgs[3]
function moveRight()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
end
function moveLeft()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
end
m=0
function row()
if m==0 then
for i=1,width do
turtle.dig()
moveRight()
end
m=1
else
for i=1,width do
turtle.dig()
moveLeft()
end
m=0
end
end
function tunnelHeight()
for i=1,height do
row()
turtle.up()
end
end
function resetTurtlePos()
if m==0 then
for i=1,height do
turtle.down()
end
for i=1,width do
moveLeft()
end
else
for i=1,height do
turtle.down()
end
end
turtle.forward()
end
tunnelHeight()
resetTurtlePos()
Edited by