I am programming a Crafty Miner Turtle to create shaft mining stations off of my Bedrock staircase. The idea is to plunk the turtle down on one of the steps on the desired level, run the program, then return later to the completed mining station. The intended design is for a 1 x 2 x 3 link tunnel to open into a chamber that is 5 x 3 x 5. One corner of the room, front left as you enter, is dug out one level lower into the wall creating a 2 x 1 x 2 hole for an endless water source.
I accomplished this last night with a simple (if somewhat lengthy) program that accomplished this goal by giving each command one at a time. The chamber took nearly 180 lines of code.
I am attempting to condense a program to utilize fewer lines of code by defining functions. My first snag hit immediately when defining the initial "digLink" function. I intend for the "digLink" function to result in the requisite 1x2x3 link tunnel carved into the wall. However when I run the program the turtle merely digs the block in front of it once then stops. I am sure I have an error somewhere, but I am not knowledgeable or experienced enough for it to be apparent to me. Can anyone assist me?
function digLink() LinkLength = 0 while LinkLength < 3 do turtle.dig() turtle.forward() turtle.digUp() LinkLength = LinkLength + 1 end end digLink()