if turtle then
local size = {...}
if #size < 3 then
print("Usage: room <length> <height> <depth>")
return
end
local depth = size[3]
local height = size[2]
local length = size[1]
function digRow()
for h = 1,height do
for d = 1,depth do
while not turtle.forward() do
turtle.dig()
end
end
turtle.turnLeft()
turtle.turnLeft()
if h < height then
turtle.digUp()
turtle.up()
end
if h = height then
for d = 1,depth do
turtle.forward()
end
for h = 1,height do
turtle,down()
end
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
end
end
for l = 1,length do
digRow()
end
else
print("Mining turtle is required for this program!")
end
This code is meant for digging square hole underground, it should work perfectly, but because of whathever reason it gives me this error:I checked the code multiple times and couldn't find any mistakes.bios:338: [string "room"]:24: 'then' expected
I'm sorry if I missed something obvious, and if you need any more informations, please ask.