r/ComputerCraft • • Mar 10 '15

Error help? (check description)

http://youtu.be/tP6BnmmdCZk
1 Upvotes

15 comments sorted by

1

u/moomoomoo309 Mar 10 '15

Either lua doesn't like underscores in variables, or the turtle.back() and turtle.forward() need parentheses. Now, when I said not to use parentheses, I meant like this:

waitForRedstone(”side",functionName)

Instead of like this

waitForRedstone(”side",functionName())

Otherwise, your syntax is fine.

Edit: since it's on line one, the error is definitely the underscore. The parentheses aren't throwing an error yet, but they'll be next.

1

u/RedstonerOuiguy Mar 10 '15

I changed the underscores to dashes, added parenthesis after the turtle.forward's and turtle.back's, but i don't know what you're talking about pertaining to the redstone thing. I don't have a waitForRedstone function anywhere in my code.

1

u/moomoomoo309 Mar 10 '15

Never mind, then. I was referring to something I said on the other thread. I hope that fixes your problem.

1

u/RedstonerOuiguy Mar 10 '15

http://pastebin.com/mgkDZykY updated code still doesn't work

1

u/dragon53535 Mar 10 '15

I will tell you this, visit the CC forums, they have a wonderfully devoted help area in which your questions are answered with knowledgeable reasoning.

As for your problem, MooMooMoo should have told you the correct problem actually being the underscores.

Forums

The help area is the "ask a pro" section.

Also, line 38, i'm assuming you need the variable to be fuelLevel, not fuelevel and it to be getting turtle.getFuelLevel() You ALWAYS need the () for functions And you're missing an end at the end.

1

u/RedstonerOuiguy Mar 10 '15

http://pastebin.com/mgkDZykY updated code still doesn't work

Also, thx for the link, i will also ask the forums

1

u/dragon53535 Mar 10 '15

Read my comment again, line 38, turtle.getFuelLevel**()**

1

u/revereddesecration Mar 10 '15 edited Mar 10 '15

Lines 6,7,10,11 and 38 need to have () on the end of them.

Also, put one more end at the end of the program.

1

u/RedstonerOuiguy Mar 10 '15

http://pastebin.com/mgkDZykY updated code still doesn't work

1

u/revereddesecration Mar 11 '15

Line 42, more parentheses! You're almost there.

1

u/[deleted] Mar 10 '15

As others have said, line 42: fuelevel = turtle.getFuelLevel

Should be: fuelevel = turtle.getFuelLevel()

0

u/[deleted] Mar 10 '15

[deleted]

1

u/RedstonerOuiguy Mar 10 '15

http://pastebin.com/mgkDZykY updated code still doesn't work

0

u/[deleted] Mar 10 '15

[deleted]

1

u/[deleted] Mar 10 '15

Good point, it appears that it will only run if the fuel level is below 20 right?

0

u/[deleted] Mar 10 '15

[deleted]

1

u/dragon53535 Mar 10 '15

He did, it's in the video's description