173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
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 pastebinthat's all there is to it
Thanks!
2427 posts
Location
UK
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
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
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
2679 posts
Location
You will never find me, muhahahahahaha
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
3057 posts
Location
United States of America
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.
7083 posts
Location
Tasmania (AU)
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
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
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
1080 posts
Location
In the Matrix
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
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
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 :)/>