Skip to content

Instantly share code, notes, and snippets.

@artheus
Created October 28, 2017 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artheus/c6ce63aa23aea617996a38e16c494adb to your computer and use it in GitHub Desktop.
Save artheus/c6ce63aa23aea617996a38e16c494adb to your computer and use it in GitHub Desktop.
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