i am currently playing ftb on minecraft and have gotten into the mod called computer craft, that uses lua as its programing language. i have written a basic script so far for clearing out rooms with 3 directions and any size. the directions are Right Left and Center. the center is for if the person wants the door to be the center of the room. but i am having trouble performing a function i made along wit a bit of code one in another function once.
this is the function i want to perform once in another function
function hwd()
for m = 1,w*0.5 do
turtle.dig()
echest()
turtle.forward()
end
end
this is the main function
function cntr()
if d == "c" then
for p = 1,w do
length()
turtle.turnRight()
turtle.dig()
echest()
turtle.forward()
turtle.turnLeft()
end
end
end
the part i need to perform once in on the first loop will look like this
turtle.turnLeft()
hwd()
turtle.turnRight()
after "for p = 1,w do" and before "length()"
i have the script working without the center part but need to ad this part. any help would be greatly appreciated.
for the working script head to: http://pastebin.com/Uf5Li1Cy
for the script with the added center part head to: http://pastebin.com/AqZHQrFb