Jump to content




test.lua: 6: attemp to call nil

lua peripheral help

13 replies to this topic

#1 Machallovnik

  • Members
  • 3 posts

Posted 08 October 2015 - 02:03 PM

Please help me
I use CC for monitoring Reactor


local mon = peripheral.wrap("monitor_1")
local reactor = peripheral.wrap("BigReactors-Reactor_0")
mon.clear()
mon.setCursorPos(1,1)
mon.setTextScale(2)
local Steam = reactor.getHotFluidProducedLastTick()
mon.write(Steam)

#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 08 October 2015 - 05:32 PM

This means that the function getHotFluidProducedLastTick() does not exist in reactor.

Are you sure BigReactors-Reactor_0 is written like this and not BigReactorsReactor_0?

#3 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 08 October 2015 - 05:47 PM

View PostCreator, on 08 October 2015 - 05:32 PM, said:

Are you sure BigReactors-Reactor_0 is written like this and not BigReactorsReactor_0?

I am. If he didn't wrap anything, he'd get an 'attempt to index ? (a nil value)'

#4 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 08 October 2015 - 05:54 PM

So the first statement should be true.

#5 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 08 October 2015 - 06:46 PM

Yes.

#6 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 08 October 2015 - 06:57 PM

.getHotFluidProducedLastTick()
- that requires you to have a fluid intake and output (used to power a turbine usually) do you have this??

Edited by Dustmuz, 08 October 2015 - 07:00 PM.


#7 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 08 October 2015 - 08:38 PM

Why would the existence of a function depend on whether or not there is fluid?

#8 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 08 October 2015 - 08:49 PM

Creator he means a Fluid Intake block. The reactor is modular.

Edited by TYKUHN2, 08 October 2015 - 09:30 PM.


#9 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 08 October 2015 - 09:11 PM

OK, I see.

#10 Bomb Bloke

    Hobbyist Coder

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

Posted 08 October 2015 - 09:58 PM

It also requires BigReactors 0.3 or later.

http://wiki.technicp...r_Computer_Port

#11 Dustmuz

  • Members
  • 174 posts
  • LocationDenmark

Posted 08 October 2015 - 10:24 PM

OP: if you can, could you suply us with a picture of your setup.

i've written multiple of these power management programs, as i use them to become better at lua, so each world i create, i start from scratch :D
think i have 40-45 of these on my pastebin :D
most problems with this kind of program lies in compability between mods :)

#12 Machallovnik

  • Members
  • 3 posts

Posted 19 October 2015 - 01:12 PM

Posted Image

#13 Machallovnik

  • Members
  • 3 posts

Posted 20 October 2015 - 02:39 PM

Thanks you all for advice but I solve it.I try change function to getEnergyProducedLastTick and that worked

#14 TYKUHN2

  • Members
  • 210 posts
  • LocationSomewhere in this dimension... I think.

Posted 20 October 2015 - 07:22 PM

Likely means HotFluid didn't exist for your version.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users