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

Error, '=' expected

Started by habnef3, 14 March 2016 - 10:52 PM
habnef3 #1
Posted 14 March 2016 - 11:52 PM
I am currently trying to make a somewhat advanced program and so far I've been doing okay. That is, until recently I hit a snag. I am getting the error message "bios:14: [string "ekT5pKm0"]:37: '=' expected


The part of the script that is getting the error is

print("Refuelling")
if 20000 - CurrentFuel >= 5000 then
	print("Low on fuel. Refilling until at 5000 fuel.")
	print(CurrentFuel)
	turtle.refuel
else
	print("All fueled up.")


I have the local variables set up, so it's not that. The link to the full script is below.

Spoilerhttp://pastebin.com/ekT5pKm0
Bomb Bloke #2
Posted 14 March 2016 - 11:55 PM
You've got a reference to "turtle.refuel" there, immediately followed by "else". The VM's suggesting you might've wanted to assign something to turtle.refuel, but in this case you wanted to call it (by adding brackets).

You've also neglected to call turtle.getFuelLimit back up on line 9; MaxFuel is set to a function pointer instead of a number.
Edited on 14 March 2016 - 10:56 PM
habnef3 #3
Posted 15 March 2016 - 12:43 AM
Thank you! That fixed it.