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

Help with turtle melonfarm?

Started by Cardwell, 15 June 2016 - 08:45 PM
Cardwell #1
Posted 15 June 2016 - 10:45 PM
Hi! I'm having a problem where my shovel turtle is not starting the program I've written. Any idea why?
Here's the code
TYKUHN2 #2
Posted 16 June 2016 - 01:38 AM
What is the error it puts out?
Dog #3
Posted 16 June 2016 - 01:50 AM
Without proper indentation it's hard to tell what your script is doing (properly indenting your code helps us help you), but I did notice some things…

First, you have two functions, both named fuelling (line 1 and line 24) - this will cause problems - function names need to be unique.

The second issue is that you appear to have two functions (both named fuelling) but you never call the function(s) so neither of them ever executes. A function doesn't run on its own, it must be called.

The third issue I noticed is on line 46 - that's not how you use a while/do loop. In your case the line only needs to read sleep(10) (no while/do).

The fourth thing is that you appear to have some unnecessary ends at the end of your program - without proper indenting it's hard to tell.
Edited on 15 June 2016 - 11:51 PM
Cardwell #4
Posted 16 June 2016 - 09:34 PM
What is the error it puts out?

There is no error coming up, that's why I'm confused about what I'm doing wrong.
Cardwell #5
Posted 16 June 2016 - 09:38 PM
Without proper indentation it's hard to tell what your script is doing (properly indenting your code helps us help you), but I did notice some things…

First, you have two functions, both named fuelling (line 1 and line 24) - this will cause problems - function names need to be unique.

The second issue is that you appear to have two functions (both named fuelling) but you never call the function(s) so neither of them ever executes. A function doesn't run on its own, it must be called.

The third issue I noticed is on line 46 - that's not how you use a while/do loop. In your case the line only needs to read sleep(10) (no while/do).

The fourth thing is that you appear to have some unnecessary ends at the end of your program - without proper indenting it's hard to tell.

Ok, I see. How do I call a function then? I'm a noob here..