Jump to content




'=' expected?


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

#1 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

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 by axel.codeFail(), 04 January 2014 - 01:12 PM.


#2 CometWolf

  • Members
  • 1,283 posts

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.

#3 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

Posted 04 January 2014 - 01:25 PM

View PostCometWolf, on 04 January 2014 - 01:19 PM, said:

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.

#4 CometWolf

  • Members
  • 1,283 posts

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 by CometWolf, 04 January 2014 - 02:00 PM.


#5 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

Posted 04 January 2014 - 01:55 PM

Yea, I already thought of that, it still didn't work. <_<

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.

#7 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

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 by axel.codeFail(), 04 January 2014 - 04:15 PM.


#8 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.

#9 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

Posted 04 January 2014 - 04:47 PM

I relaunched the game, and now it works. Hm. Well thanks to all who helped. :)

#10 CometWolf

  • Members
  • 1,283 posts

Posted 04 January 2014 - 04:51 PM

So when you re-installed cc... You didn't relaunch it? Lol.

#11 axel.codeFail()

  • Members
  • 47 posts
  • LocationA bit lost

Posted 05 January 2014 - 12:37 PM

I did, but for some reason it worked this time.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users