Skip to content

Instantly share code, notes, and snippets.

@artheus
Created Oct 28, 2017
Embed
What would you like to do?
BR Reactor controller script.
local component = require("component")
local r = component.br_reactor
local capacity = r.getEnergyCapacity();
while true do
s = r.getEnergyStored();
if r.getActive() then
if s/capacity > 0.8 then
r.setActive(false)
end
else
if s/capacity < 0.2 then
r.setActive(true)
end
end
os.sleep(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment