Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------
- -- Big Reactor Power Management --
- -- --
- -- Minecraft HermitCraft FTB Infinity Episode 15 --
- -- https://www.youtube.com/watch?v=Ac-v20Algmg --
- -- --
- -- YouTube Channel http://youtube.com/hypnotizd --
- ----------------------------------------------------------
- local stored = 0
- local status = "Discharging"
- local function setStored()
- stored = peripheral.wrap("right").getEnergyStored("DOWN")
- end
- local function checkPower()
- setStored()
- if ((stored / 25000000) >= .85) then
- rs.setOutput("bottom", false)
- status = "Discharging"
- elseif ((stored / 25000000) <= .25) then
- rs.setOutput("bottom", true)
- status = "Charging"
- end
- end
- local function displayStatus()
- local pct = stored/25000000
- term.clear()
- term.setCursorPos(1,1)
- print("Current Energy: "..stored.." ("..string.sub(pct,3,4).."."..string.sub(pct,5,6).."%)")
- print(" Status: "..status)
- end
- while true do
- checkPower()
- displayStatus()
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement