Jump to content




[LUA][Error][Question] Misc. Errors and Questions :P


  • You cannot reply to this topic
4 replies to this topic

#1 rhyser9

  • Members
  • 9 posts

Posted 29 December 2012 - 11:57 AM

Hey, I'm just delving into the mysteries of ComputerCraft and decided to make a tree farm as my first project. I just finished writing my code, but came across an error saying it was expecting an = sign, but looking at the code, no = sign belongs on that line as far as I can tell. http://pastebin.com/um7B9xTX
Error:
bios:388: [string "TreeFarm"]:76: '=' expected
EDIT: Fixed, Thanks OmegaVest! Here's the new code: http://pastebin.com/pTdEYhGU Please tell me about anything else I should be doing!


How can I check multiple parameters in a while loop? a.k.a
while condition1 = true & quantity1 > 50 do
  stuff
end
EDIT: Fixed, Thanks Diegodan1983!

BTW, if you see anything I should be doing differently, tell me! I'm just learning lua, and would love some tips!

#2 OmegaVest

  • Members
  • 436 posts

Posted 29 December 2012 - 12:02 PM

You forgot the parentheses on the line previous.


Actually, you forgot parentheses for a lot of functions. Just because they have no parameters does not mean they don't need parentheses. Yay multi-negatives.

#3 rhyser9

  • Members
  • 9 posts

Posted 29 December 2012 - 12:08 PM

View PostOmegaVest, on 29 December 2012 - 12:02 PM, said:

You forgot the parentheses on the line previous.

Actually, you forgot parentheses for a lot of functions. Just because they have no parameters does not mean they don't need parentheses. Yay multi-negatives.
Oops duh. I wasn't paying attention and forgot that they all require parantheses. Thx.

#4 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 30 December 2012 - 12:33 AM

to check multiple paramethers you must do:
while condition1 == true and quantity1 > 50 do
  stuff
end
--also you can do
while condition1 == true or quantity1 > 50 do
  stuff
end


#5 rhyser9

  • Members
  • 9 posts

Posted 30 December 2012 - 08:33 AM

View Postdiegodan1893, on 30 December 2012 - 12:33 AM, said:

to check multiple paramethers you must do:
while condition1 == true and quantity1 > 50 do
  stuff
end
--also you can do
while condition1 == true or quantity1 > 50 do
  stuff
end
Thanks diego, I didn't think of using the word 'and' instead of '&' :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users