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

test.lua: 6: attemp to call nil

Started by Machallovnik, 08 October 2015 - 01:03 PM
Machallovnik #1
Posted 08 October 2015 - 03: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)
Creator #2
Posted 08 October 2015 - 06: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?
KingofGamesYami #3
Posted 08 October 2015 - 06:47 PM
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)'
Creator #4
Posted 08 October 2015 - 06:54 PM
So the first statement should be true.
KingofGamesYami #5
Posted 08 October 2015 - 07:46 PM
Yes.
Dustmuz #6
Posted 08 October 2015 - 07:57 PM
.getHotFluidProducedLastTick()
- that requires you to have a fluid intake and output (used to power a turbine usually) do you have this??
Edited on 08 October 2015 - 06:00 PM
Creator #7
Posted 08 October 2015 - 09:38 PM
Why would the existence of a function depend on whether or not there is fluid?
TYKUHN2 #8
Posted 08 October 2015 - 09:49 PM
Creator he means a Fluid Intake block. The reactor is modular.
Edited on 08 October 2015 - 08:30 PM
Creator #9
Posted 08 October 2015 - 10:11 PM
OK, I see.
Bomb Bloke #10
Posted 08 October 2015 - 10:58 PM
It also requires BigReactors 0.3 or later.

http://wiki.technicpack.net/Reactor_Computer_Port
Dustmuz #11
Posted 08 October 2015 - 11: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 :)/>
Machallovnik #12
Posted 19 October 2015 - 02:12 PM
Machallovnik #13
Posted 20 October 2015 - 03:39 PM
Thanks you all for advice but I solve it.I try change function to getEnergyProducedLastTick and that worked
TYKUHN2 #14
Posted 20 October 2015 - 08:22 PM
Likely means HotFluid didn't exist for your version.