I did a program to manage my batteries and reactors, and i got a problem in reactor.setActive(true/false)
for address, name in pairs(reactorsID) do
local reactor = component.proxy(address)
countR = countR + 1
local tR = (countR + count) * 3
progressBar( name, tR, reactor.getEnergyStored(), reactor.getEnergyCapacity(), 0x00bb00, true, "RF")
progressBar( "Reactor(Energy Last Tick)", tR + 3, math.ceil(reactor.getEnergyProducedLastTick()), 6200, 0x00bb00, true, "RF")
if brPower + totalPower < brMaxPower + totalMaxPower then
reactor.setActive(True)
else