Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_2")
- bank = peripheral.wrap("blockcapacitorbank_3")
- -- backup = peripheral.wrap("cofh_thermalexpansion_energycell_2")
- p = peripheral.wrap("back")
- function pulse()
- redstone.setOutput("back", true)
- end
- while true do
- mon.clear()
- mon.setTextScale(1.5)
- mon.setCursorPos(1,1)
- energy = bank.getEnergyStored("left")
- mj = bank.getMJStored("left")
- mjmax = bank.getMaxMJReceived("left")
- if bank.getMJStored("left") < 5000000 then
- p.setFreq(201)
- pulse()
- mon.setTextColor(colors.white)
- mon.write("POWER MANAGEMENT V3")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.red)
- mon.write("ENERGY CRITICAL")
- mon.setCursorPos(1,4)
- mon.write("RF:" ..energy)
- mon.setCursorPos(1,5)
- mon.write("MJ:" ..mj)
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.green)
- mon.write("CHARGING... ")
- mon.setCursorPos(1,8)
- mon.write("SPEED (MJ/t):" ..mjmax)
- sleep(5)
- else if bank.getMJStored("left") > 17500000 then
- p.setFreq(202)
- pulse()
- mon.setTextColor(colors.white)
- mon.write("POWER MANAGEMENT V3")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.green)
- mon.write("ENERGY OK")
- mon.setCursorPos(1,4)
- mon.write("RF:" ..energy)
- mon.setCursorPos(1,5)
- mon.write("MJ:" ..mj)
- mon.setCursorPos(1,7)
- mon.write("ALL SYSTEMS ARE OK")
- mon.setCursorPos(1,8)
- mon.write("CHARGING AT 22.5%")
- sleep(10)
- else
- p.setFreq(203)
- pulse()
- mon.setTextColor(colors.white)
- mon.write("POWER MANAGEMENT V3")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.yellow)
- mon.write("ENERGY LOW")
- mon.setCursorPos(1,4)
- mon.write("RF:" ..energy)
- mon.setCursorPos(1,5)
- mon.write("MJ:" ..mj)
- mon.setCursorPos(1,7)
- mon.write("POWER IS LOW")
- mon.setCursorPos(1,8)
- mon.write("CHARGING AT 22.5%")
- sleep(10)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment