Created
October 28, 2017 11:55
-
-
Save artheus/c6ce63aa23aea617996a38e16c494adb to your computer and use it in GitHub Desktop.
BR Reactor controller script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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