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

Startup Not Working

Started by EpicCenter, 29 September 2013 - 05:24 PM
EpicCenter #1
Posted 29 September 2013 - 07:24 PM
I have a script that won't work, here it is:
theoriginalbit #2
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.
MR_nesquick #3
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?
theoriginalbit #4
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.
EpicCenter #5
Posted 29 September 2013 - 07:45 PM
Thank you for the info on repeat loops and also, thanks for helpin' me out!