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

Resonent energy cell

Started by Gamerendk, 08 September 2014 - 06:05 PM
Gamerendk #1
Posted 08 September 2014 - 08:05 PM
Hey im on the way to build a computer screen their show the amount of in the resonent cell but i cant get it to work. The reactor works just fine but not the cell.

Spoilerlocal reactor = peripheral.wrap("BigReactors-Reactor_0")
local turbine = peripheral.wrap("BigReactors-Turbine_0")
local mon = peripheral.wrap("right")
reso1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
function reactoractive()
mon.clear()
mon.setCursorPos(1,1)
mon.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
mon.write("Reactor: ")
if reactor.getActive() == true then
mon.setTextColor( colors.lime )
mon.write( "online" )
else
mon.setTextColor( colors.red )
mon.write( "Offline" )
end
end
function reso()
stored = reso1.getEnergyStored()
mon.setCursorPos(1,2)
mon.write("energy", stored)


end

while true do
sleep(.1)
reactoractive()
reso()
end



Hope your guys can help me
DannySMc #2
Posted 08 September 2014 - 10:37 PM
Hey im on the way to build a computer screen their show the amount of in the resonent cell but i cant get it to work. The reactor works just fine but not the cell.

Spoilerlocal reactor = peripheral.wrap("BigReactors-Reactor_0")
local turbine = peripheral.wrap("BigReactors-Turbine_0")
local mon = peripheral.wrap("right")
reso1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
function reactoractive()
mon.clear()
mon.setCursorPos(1,1)
mon.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
mon.write("Reactor: ")
if reactor.getActive() == true then
mon.setTextColor( colors.lime )
mon.write( "online" )
else
mon.setTextColor( colors.red )
mon.write( "Offline" )
end
end
function reso()
stored = reso1.getEnergyStored()
mon.setCursorPos(1,2)
mon.write("energy", stored)


end

while true do
sleep(.1)
reactoractive()
reso()
end



Hope your guys can help me

At the bottom it says:
sleep(.1)
This should have a number in front:
0
1
0.1
0.5
0.75
etc.
Bomb Bloke #3
Posted 09 September 2014 - 03:02 AM
Whether or not there's a leading zero in front of the decimal point is irrelevant.

When combining strings, use a double dot. Eg:

mon.write("energy" .. stored)

If you're still having problems, explain what your script does instead of "working".