Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setTextColor(colors.blue)
- p = peripheral.wrap("back")
- rednet.open("left")
- rednet.broadcast("Core Monitoring Online", PowerManagement)
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("Djgaven588's Power Monitor")
- print(" ")
- print("Monitoring Draconic Energy Core")
- print(" ")
- powerPercentage = p.getEnergyStored()/p.getMaxEnergyStored()
- if powerPercentage > 0.99 then
- rednet.broadcast("PowerFull", "PowerManagement")
- end
- if powerPercentage <= 0.99 and powerPercentage > 0.96 then
- rednet.broadcast("Power98", "PowerManagement")
- end
- if powerPercentage <=0.96 and powerPercentage > 0.94 then
- rednet.broadcast("Power96", "PowerManagement")
- end
- if powerPercentage <=0.94 and powerPercentage > 0.92 then
- rednet.broadcast("Power94", "PowerManagement")
- end
- if powerPercentage <=0.92 then
- rednet.broadcast("PowerFalling", "PowerManagement")
- end
- print("Power Level: "..powerPercentage*100)
- sleep(15)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement