SHOW:
|
|
- or go back to the newest paste.
| 1 | - | mon = peripheral.wrap("monitor_2")
|
| 1 | + | mon = peripheral.wrap("monitor_1")
|
| 2 | - | bank = peripheral.wrap("blockcapacitorbank_3")
|
| 2 | + | bank = peripheral.wrap("blockcapacitorbank_2")
|
| 3 | - | -- backup = peripheral.wrap("cofh_thermalexpansion_energycell_2")
|
| 3 | + | |
| 4 | ----------------------------------- | |
| 5 | function poweron() | |
| 6 | redstone.setOutput("back", true)
| |
| 7 | end | |
| 8 | ||
| 9 | function poweroff() | |
| 10 | redstone.setOutput("back", false)
| |
| 11 | end | |
| 12 | ||
| 13 | function pulse() | |
| 14 | - | mon.setTextScale(1.5) |
| 14 | + | |
| 15 | - | mon.setCursorPos(1,1) |
| 15 | + | sleep(0.7) |
| 16 | redstone.setOutput("back", false)
| |
| 17 | - | energy = bank.getEnergyStored("left")
|
| 17 | + | |
| 18 | ||
| 19 | - | mjmax = bank.getMaxMJReceived("left")
|
| 19 | + | function info() |
| 20 | mon.setCursorPos(2,3) | |
| 21 | - | if bank.getMJStored("left") < 5000000 then
|
| 21 | + | |
| 22 | mon.setCursorPos(2,4) | |
| 23 | mon.write("RF:" ..rf)
| |
| 24 | - | mon.setTextColor(colors.white) |
| 24 | + | |
| 25 | - | mon.write("POWER MANAGEMENT V3")
|
| 25 | + | ----------------------------------- |
| 26 | - | mon.setCursorPos(1,3) |
| 26 | + | |
| 27 | mon.clear() | |
| 28 | mon.setTextColor(colors.white) | |
| 29 | - | mon.setCursorPos(1,4) |
| 29 | + | mon.setCursorPos(2,2) |
| 30 | - | mon.write("RF:" ..energy)
|
| 30 | + | mon.write("CAPACITOR 1")
|
| 31 | - | mon.setCursorPos(1,5) |
| 31 | + | mon.setCursorPos(20,2) |
| 32 | mon.write("GENERATOR")
| |
| 33 | - | mon.setCursorPos(1,7) |
| 33 | + | ----------------------------------- |
| 34 | mj = bank.getMJStored("left")
| |
| 35 | - | mon.write("CHARGING... ")
|
| 35 | + | rf = bank.getEnergyStored("left")
|
| 36 | - | mon.setCursorPos(1,8) |
| 36 | + | ----------------------------------- |
| 37 | - | mon.write("SPEED (MJ/t):" ..mjmax)
|
| 37 | + | if bank.getMJStored("left") <200000 then
|
| 38 | p.setFreq(201) | |
| 39 | poweroff() | |
| 40 | - | else if bank.getMJStored("left") > 17500000 then
|
| 40 | + | |
| 41 | pulse() | |
| 42 | info() | |
| 43 | - | mon.setTextColor(colors.white) |
| 43 | + | |
| 44 | - | mon.write("POWER MANAGEMENT V3")
|
| 44 | + | mon.setCursorPos(2,6) |
| 45 | - | mon.setCursorPos(1,3) |
| 45 | + | |
| 46 | mon.setCursorPos(2,7) | |
| 47 | mon.write("CHARGING...")
| |
| 48 | - | mon.setCursorPos(1,4) |
| 48 | + | sleep(20) |
| 49 | - | mon.write("RF:" ..energy)
|
| 49 | + | |
| 50 | - | mon.setCursorPos(1,5) |
| 50 | + | else if bank.getMJStored("left") >400000 then
|
| 51 | p.setFreq(201) | |
| 52 | - | mon.setCursorPos(1,7) |
| 52 | + | poweron() |
| 53 | - | mon.write("ALL SYSTEMS ARE OK")
|
| 53 | + | info() |
| 54 | - | mon.setCursorPos(1,8) |
| 54 | + | |
| 55 | - | mon.write("CHARGING AT 22.5%")
|
| 55 | + | mon.setCursorPos(2,6) |
| 56 | - | sleep(10) |
| 56 | + | |
| 57 | mon.setCursorPos(2,7) | |
| 58 | - | else |
| 58 | + | mon.write("PRODUCING OIL")
|
| 59 | - | p.setFreq(203) |
| 59 | + | |
| 60 | ||
| 61 | - | mon.setTextColor(colors.white) |
| 61 | + | else if bank.getMJStored("left") >100000 and bank.getMJStored("left") <400000 then
|
| 62 | - | mon.write("POWER MANAGEMENT V3")
|
| 62 | + | |
| 63 | - | mon.setCursorPos(1,3) |
| 63 | + | poweroff() |
| 64 | p.setFreq(202) | |
| 65 | pulse() | |
| 66 | - | mon.setCursorPos(1,4) |
| 66 | + | info() |
| 67 | - | mon.write("RF:" ..energy)
|
| 67 | + | |
| 68 | - | mon.setCursorPos(1,5) |
| 68 | + | mon.setCursorPos(2,6) |
| 69 | mon.write("ENERGY LOW")
| |
| 70 | - | mon.setCursorPos(1,7) |
| 70 | + | mon.setCursorPos(2,7) |
| 71 | - | mon.write("POWER IS LOW")
|
| 71 | + | mon.write("STANDBY")
|
| 72 | - | mon.setCursorPos(1,8) |
| 72 | + | |
| 73 | - | mon.write("CHARGING AT 22.5%")
|
| 73 | + | |
| 74 | - | sleep(10) |
| 74 | + | |
| 75 | end | |
| 76 | - | end |
| 76 | + | |
| 77 | - | end |
| 77 | + | |
| 78 | end |