Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local os = require("os")
- local term = require("term")
- function checkBatt()
- curr = 0
- for addr, name in (component.list("capacitor_bank")) do
- battcheck = component.proxy(addr).getEnergyStored()
- curr = curr + battcheck
- end
- return curr
- end
- function getMaxBatt()
- max = 0
- for addr, name in (component.list("capacitor_bank")) do
- maxcheck = component.proxy(addr).getMaxEnergyStored()
- max = max + maxcheck
- end
- return max
- end
- function updateMon(curr, max)
- term.clear()
- term.setCursor(1,1)
- io.stdout:write(curr .. "/" .. max .. " RF Stored.")
- return
- end
- while true do
- max = getMaxBatt()
- curr = checkBatt()
- updateMon(curr, max)
- os.sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement