Jump to content




Error, '=' expected


2 replies to this topic

#1 habnef3

  • Members
  • 3 posts

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.



#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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 by Bomb Bloke, 14 March 2016 - 11:56 PM.


#3 habnef3

  • Members
  • 3 posts

Posted 15 March 2016 - 12:43 AM

Thank you! That fixed it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users