13 posts
Posted 29 September 2013 - 07:24 PM
I have a script that won't work, here it is:
7508 posts
Location
Australia
Posted 29 September 2013 - 07:33 PM
Ok so here in Ask a Pro we like it if when you get an error, actually tell us these errors, they are very useful in helping debug problems as they provide a lot of useful information!
However this program is small and easy to read, so I'll let is slide this time (normally I wouldn't answer and ask for the error). The problem is that the repeat loop is the only control structure within Lua that does not require an
end to close it. Remove the
end on the last line and it will be fine.
For future reference please use
pastebin (in-game
pastebin put [filename]) for long programs of [
code][
/code] tags for short programs, not many people on these forums are willing to download files.
101 posts
Location
Norway
Posted 29 September 2013 - 07:36 PM
do you need 'end' on the last line? does the turtle have fuel? is turtle.detectDown() = true when you start the program?
7508 posts
Location
Australia
Posted 29 September 2013 - 07:38 PM
is turtle.detectDown() == true when you start the program?
Doesn't matter. A repeat loop will always execute its body at least once before checking its conditional, unlike the while loop which checks its conditional before executing its body.
13 posts
Posted 29 September 2013 - 07:45 PM
Thank you for the info on repeat loops and also, thanks for helpin' me out!