Posted 02 April 2014 - 10:53 PM
Hi,
I'm currently trying to write a program which feeds the monitor with live information (such as fuel temperature) from a nuclear reactor (Big Reactors mod).
The code bit in question:
Now, while the energy storage part works perfectly, I seem to have some problems with the fuel temp.
The program is able to get the temperature reading, but not updating it per loop.
This is how it looks:
Any ideas on how I may improve this?
Thanks,
Trakthor.
I'm currently trying to write a program which feeds the monitor with live information (such as fuel temperature) from a nuclear reactor (Big Reactors mod).
The code bit in question:
local reactor = peripheral.wrap("back")
ftemp = reactor.getFuelTemperature()
while true do
sleep(1) -- One second delay
if reactor.getFuelTemperature() > 1 then -- if the fuel temperature is >1
mon.write("Fuel Temp: "..ftemp) -- monitor writes the fuel temp (partially working)
end
if reactor.getEnergyStored() < 9900000 then -- if the energy storage gets below 9900000 RF then (works)
reactor.setActive (true) -- activate the reactor (works)
end
if reactor.getEnergyStored() > 9990000 then -- if the energy storage gets above 9990000 RF then (works)
reactor.setActive (false) -- shut down the reactor (works)
end
end
Now, while the energy storage part works perfectly, I seem to have some problems with the fuel temp.
The program is able to get the temperature reading, but not updating it per loop.
This is how it looks:
Any ideas on how I may improve this?
Thanks,
Trakthor.