This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
raywave's profile picture

error eof expected?

Started by raywave, 05 January 2013 - 04:58 AM
raywave #1
Posted 05 January 2013 - 05:58 AM
i get eof expected when i have this coded for my turtle any one know how to fix?

function comeout()
turtle.Left()
end
function digtunnle()
turtle.digForward(40)
turtle.Forward(39)
end
function comeback()
turtle.Back(39)
turtle.Left()
end
comeout()
digtunnle()
comeback()
end
end
Alekso56 #2
Posted 05 January 2013 - 06:25 AM
Remove the end at the bottom.

also what's with all the functions?

turtle.back(39) only works once… 39 doesn't do anything, same with forward.
also try spelling the commands properly, digForward() doesn't exsist…
Alekso56 #3
Posted 05 January 2013 - 06:41 AM
A working example of what you wrote (exept perfect):


turtle.turnLeft()
for k=1 ,39 do
 turtle.forward()
 turtle.dig()
end
turtle.turnRight()
turtle.turnRight()
for l=1 ,39 do
 turtle.forward()
 turtle.dig()
end
Lyqyd #4
Posted 05 January 2013 - 06:48 AM
The for loops should be using 1, 39. 0, 39 is 40 iterations.
raywave #5
Posted 05 January 2013 - 07:17 AM
A working example of what you wrote (exept perfect):


turtle.turnLeft()
for k=1 ,39 do
turtle.forward()
turtle.dig()
end
turtle.turnRight()
turtle.turnRight()
for l=1 ,39 do
turtle.forward()
turtle.dig()
end

thanks!it didnt do exactly what i wanted though i wanted it to come back and tuck itself back in a hole
ChunLing #6
Posted 05 January 2013 - 10:06 AM
Yeah…okay so Alekso isn't psychic.

Yet. We'll work on that ;)/>