Jump to content




Big Reactors Control Panel


8 replies to this topic

#1 Hydrotronics

  • Members
  • 131 posts
  • LocationThe 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 pastebin

that's all there is to it

Thanks!

#2 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 08 November 2015 - 07:39 PM

reactor.doEjectWaste should be a function call

you need to add () on the end

Edited by Lupus590, 08 November 2015 - 07:39 PM.


#3 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 08 November 2015 - 07:58 PM

 Lupus590, on 08 November 2015 - 07:39 PM, said:

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

#4 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou 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 by Creator, 08 November 2015 - 08:22 PM.


#5 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited 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.

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (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...nctionsTutorial

#7 Hydrotronics

  • Members
  • 131 posts
  • LocationThe 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 by Hydrotronics, 10 December 2015 - 05:31 PM.


#8 Dragon53535

  • Members
  • 973 posts
  • LocationIn 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 by Dragon53535, 10 December 2015 - 08:48 PM.


#9 Hydrotronics

  • Members
  • 131 posts
  • LocationThe 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 :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users