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

Big Reactors Control Panel

Started by Hydrotronics, 08 November 2015 - 06:24 PM
Hydrotronics #1
Posted 08 November 2015 - 07:24 PM
Hi, I have come across an error that doesn't make sense.
It is asking me for an = on line 11

Here is the pastebin

that's all there is to it

Thanks!
Lupus590 #2
Posted 08 November 2015 - 07:39 PM
reactor.doEjectWaste should be a function call

you need to add () on the end
Edited on 08 November 2015 - 06:39 PM
Hydrotronics #3
Posted 08 November 2015 - 07:58 PM
reactor.doEjectWaste should be a function call

you need to add () on the end

the official command doesn't include the () as far as i'm concerned. But i shall give it a go
Creator #4
Posted 08 November 2015 - 08:22 PM
Definitely include a (). Maybe it wasn't in the documentation because they are referring to the function, not to what it returns.

PS: 1400th post!
Edited on 08 November 2015 - 07:22 PM
KingofGamesYami #5
Posted 08 November 2015 - 09:37 PM
Just wanted to point out - you aren't calling any of the functions. If it's a function, you must call it. For example, a function will never equal 10000000.
Bomb Bloke #6
Posted 08 November 2015 - 11:43 PM
… and without a () on the end of the function reference, you aren't calling it.

http://lua-users.org/wiki/FunctionsTutorial
Hydrotronics #7
Posted 10 December 2015 - 05:23 PM
ok because what I am trying to do it get the value of the say amount of energy stored in the reactor, then decide whether to insert fuel, activate reactor or remain on stand by

Edit: and the max amount of energy stored in the reactor's buffer is 10000000.
Edited on 10 December 2015 - 04:31 PM
Dragon53535 #8
Posted 10 December 2015 - 08:48 PM
What Yami meant is that the function itself cannot equal 1000000, however what the function RETURNS after you call it, CAN.


local function getEnergy()
  return 20
end
print(getEnergy == 20)
print(getEnergy() == 20)
Edited on 10 December 2015 - 07:48 PM
Hydrotronics #9
Posted 21 December 2015 - 05:01 PM
I got it working :P/>
All I needed to do to get the numbers out was do math.floor()
I got it working now :)/>