Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_1")
- bank = peripheral.wrap("blockcapacitorbank_2")
- p = peripheral.wrap("back")
- -----------------------------------
- function poweron()
- redstone.setOutput("back", true)
- end
- function poweroff()
- redstone.setOutput("back", false)
- end
- function pulse()
- redstone.setOutput("back", true)
- sleep(0.7)
- redstone.setOutput("back", false)
- end
- function info()
- mon.setCursorPos(2,3)
- mon.write("MJ:" ..mj)
- mon.setCursorPos(2,4)
- mon.write("RF:" ..rf)
- end
- -----------------------------------
- while true do
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(2,2)
- mon.write("CAPACITOR 1")
- mon.setCursorPos(20,2)
- mon.write("GENERATOR")
- -----------------------------------
- mj = bank.getMJStored("left")
- rf = bank.getEnergyStored("left")
- -----------------------------------
- if bank.getMJStored("left") <200000 then
- p.setFreq(201)
- poweroff()
- p.setFreq(202)
- pulse()
- info()
- mon.setTextColor(colors.red)
- mon.setCursorPos(2,6)
- mon.write("ENERGY CRITICAL")
- mon.setCursorPos(2,7)
- mon.write("CHARGING...")
- sleep(20)
- else if bank.getMJStored("left") >400000 then
- p.setFreq(201)
- poweron()
- info()
- mon.setTextColor(colors.green)
- mon.setCursorPos(2,6)
- mon.write("ENERGY OK")
- mon.setCursorPos(2,7)
- mon.write("PRODUCING OIL")
- sleep(5)
- else if bank.getMJStored("left") >100000 and bank.getMJStored("left") <400000 then
- p.setFreq(201)
- poweroff()
- p.setFreq(202)
- pulse()
- info()
- mon.setTextColor(colors.yellow)
- mon.setCursorPos(2,6)
- mon.write("ENERGY LOW")
- mon.setCursorPos(2,7)
- mon.write("STANDBY")
- sleep(5)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment