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

Issues with my program

Started by minerlogo, 28 November 2015 - 07:46 PM
minerlogo #1
Posted 28 November 2015 - 08:46 PM
I was making a program for my minecarts and then when i put this loop

local x = 15

if x = 15 and turtle.detect()==true
then do throwAway() – this is one of my functions above, I know this works
else do turtle.detect()

When i run this it shows me the error

bios:14: [string ".temp"]:27: 'then' expected. if someone could help that would be awesome.
Bomb Bloke #2
Posted 28 November 2015 - 11:05 PM
Lua did not expect a single = to be used when parsing the conditional for your "if" statement. Use "x == 15" instead.

You'll likely also want to get rid of that redundant "do". "for" statements need 'em, but they're seldom useful otherwise.