7 posts
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
66 posts
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…
66 posts
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
8543 posts
Posted 05 January 2013 - 06:48 AM
The for loops should be using 1, 39. 0, 39 is 40 iterations.
7 posts
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
2005 posts
Posted 05 January 2013 - 10:06 AM
Yeah…okay so Alekso isn't psychic.
Yet. We'll work on that ;)/>