Jump to content




[CC+BigReactors] getEnergyProducedLastTick not outputting any value


  • You cannot reply to this topic
3 replies to this topic

#1 zacchi4k

  • Members
  • 3 posts

Posted 09 September 2016 - 04:04 PM

I have a reactor from BigReactors connected via computer port to a computer in order to have an automatic control system.
I also have a monitor connected (via network cable) to the computer in order to get some real-time info of the reactor status.
However, the getEnergyProducedLastTick argument seems to not work correctly, as it doesn't output any number.
This is what i mean:
Posted Image

Here's the part of the code responsible for that part:
monitor.write("Energy produced: ")
monitor.write(reactor.getEnergyProducedLastTick)
monitor.write(" RF/t")

And here's the code responsible for the whole screen:
Spoiler

Can someone help me?

Edited by zacchi4k, 09 September 2016 - 05:51 PM.


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 09 September 2016 - 04:12 PM

You'll want to actually call the function. Your code is missing the parentheses on that line.

#3 zacchi4k

  • Members
  • 3 posts

Posted 09 September 2016 - 04:36 PM

View PostLyqyd, on 09 September 2016 - 04:12 PM, said:

You'll want to actually call the function. Your code is missing the parentheses on that line.
Whoops! I forgot them, and the computer was not giving any errors regrading them. Now it works. Thanks!

#4 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 09 September 2016 - 06:29 PM

You can merge those 3 lines by doing

term.write("Energy produced: " .. reactor.getEnergyProducedLastTick() .. " RF/T")

It will Write as

Energy produced: [number] RF/T

I also recomnend using math.floor on the temprature instead of it showing like

20.00047384719561

it will just show

20





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users