cleanup reactor controller

This commit is contained in:
LordMZTE 2021-11-13 15:43:42 +01:00
parent df0f056360
commit 3e58a0d5b2

View file

@ -4,12 +4,8 @@ if reac == nil then
error "no reactor found!"
end
while true do
local cap = reac.getEnergyCapacity()
-- this happens when the chunk loads in for some reason. gotta check to prevent crash
if type(cap) == "number" then
local newstate = reac.getEnergyStored() < cap * 0.8
local function update()
local newstate = reac.getEnergyStored() < reac.getEnergyCapacity() * 0.8
local active = reac.getActive()
@ -18,5 +14,10 @@ while true do
end
end
while true do
if reac.mbIsAssembled() then
update()
end
sleep(5)
end