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

'=' expected?

Started by axel.codeFail(), 04 January 2014 - 12:11 PM
axel.codeFail() #1
Posted 04 January 2014 - 01:11 PM
I wrote a simple program for a sugarcane farm, and when I run it, it instantly returns an error from line 11 saying.

bios:339: [string "sugar"]:11: '=' expected
This is the program code:

while true do
	for a=1,9 do
		turtle.dig()
		turtle.forward()
	end
	for b=1,1 do
		turtle.turnRight()
		turtle.dig()
		turtle.forward()
		turtle.turnRight()
	end
	for c=1,16 do
		turtle.select(c)
		turtle.dropDown()
	end
	sleep(240)
end
What do I need to do to fix this?
I'm running ComputerCraft version 1.58 in Minecraft version 1.6.4.

The farm is in this setup
x is sugarcane
[] is chest
the turtle starts out on top of the chest
the setup is only two blocks tall

xx
xx
xx
xx
xx
xx
xx
xx
[]x
Edited on 04 January 2014 - 12:12 PM
CometWolf #2
Posted 04 January 2014 - 01:19 PM
You sure that's the right code? Cause it dosen't give me any errors, nor can i see anything wrong with it really.
axel.codeFail() #3
Posted 04 January 2014 - 01:25 PM
You sure that's the right code? Cause it dosen't give me any errors, nor can i see anything wrong with it really.
That's exactly how I have it, and it returns that error.
CometWolf #4
Posted 04 January 2014 - 01:42 PM
Only thing i can suggest really would be to reinstall computercraft, as there is nothing wrong with the code you posted.
Edited on 04 January 2014 - 01:00 PM
axel.codeFail() #5
Posted 04 January 2014 - 01:55 PM
Yea, I already thought of that, it still didn't work. <_</>
Lyqyd #6
Posted 04 January 2014 - 02:18 PM
Did you actually copy and paste it, or retype it from the computer? You're probably missing the parentheses from the function call on line 10.
axel.codeFail() #7
Posted 04 January 2014 - 04:12 PM
I copy-pasted the code. Besides, wouldn't it run, then error when it gets to that line? With this, it errors imediately.
Edited on 04 January 2014 - 03:15 PM
Lyqyd #8
Posted 04 January 2014 - 04:32 PM
Lua parses the script and turns it into Lua bytecode before it runs. This is a "compile"-time error, not a run-time error.
axel.codeFail() #9
Posted 04 January 2014 - 04:47 PM
I relaunched the game, and now it works. Hm. Well thanks to all who helped. :)/>
CometWolf #10
Posted 04 January 2014 - 04:51 PM
So when you re-installed cc… You didn't relaunch it? Lol.
axel.codeFail() #11
Posted 05 January 2014 - 12:37 PM
I did, but for some reason it worked this time.