he guys!

i started programming turtles with lua 2 or 3 months ago. im a newbie when it comes to programming things.
so ive written a code that the turle digs automaticly from the highest point all the way down to the bedrock.

now i want to make a group of turtles which i can control with a computer.

a short example so that it is easier to explain my problem:

i wrote a funtion that the turtle is going to the highest point on a particular distance(lengthToGo)
lengthToGo=100
hight = 1
lengthGone=1
function messen()
while lengthGone~=lengthToGo do
if turtle.detect() == true then
turtle.digUp()
turtle.up()
else
turtle.forward()
lengthGone=lengthGone+1
end
end
end


i start all 3 turtles with that function. and if there are back i want them to write the hight in a table which is a seperate file(first question :)/>/> ) because i want to calculate the maximum hight of all three turtles whith math.max() that a computer can send a signal to start the highest turtle.

i have three turtles every single one on a differnt hight. the highest one starts do dig and going forward and backwards as long as i had told the turtle to.

now the turtle drops all the items and goes down one block that it is on the same hight as the second one. both should do digging, going and backwards. the second turtle did his job faster then first one and should wait for the first one to finish.

i hope the example helps to understand what i want to do.

thanks in advance for your help