SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local turbine |
| 1 | + | local turbine1 |
| 2 | - | local reactor |
| 2 | + | local reactor1 |
| 3 | - | turbine = peripheral.wrap("left")
|
| 3 | + | local monitor |
| 4 | - | reactor = peripheral.wrap("BigReactors-Reactor_1")
|
| 4 | + | |
| 5 | monitor = peripheral.wrap("right")
| |
| 6 | - | function wipeScreen() |
| 6 | + | |
| 7 | - | term.clear() |
| 7 | + | |
| 8 | - | term.setCursorPos(1, 1) |
| 8 | + | rednet.open("back")
|
| 9 | - | end |
| 9 | + | message = rednet.receive() |
| 10 | bank = message["bank"] | |
| 11 | if bank == 1 | |
| 12 | - | sleep(0) |
| 12 | + | monitor.write('Reactor - Turbine Monitoring')
|
| 13 | - | --Turbine Info |
| 13 | + | term.setCursorPos(1,2) |
| 14 | - | turbine1capacitor = turbine.getEnergyStored() |
| 14 | + | monitor.write('Data Broadcast Received')
|
| 15 | - | turbine1rpm = turbine.getRotorSpeed() |
| 15 | + | term.setCursorPos(1,3) |
| 16 | - | turbine1RFT = turbine.getEnergyProducedLastTick() |
| 16 | + | monitor.write('System Status')
|
| 17 | - | turbine1Flow = turbine.getFluidFlowRate() |
| 17 | + | term.setCursorPos(1,4) |
| 18 | - | --Reactor Info |
| 18 | + | monitor.write('Turbine:')
|
| 19 | - | reactor1Temp = reactor.getFuelTemperature() |
| 19 | + | term.setCursorPos(1,5) |
| 20 | - | reactor1Steam = reactor.getEnergyProducedLastTick() |
| 20 | + | monitor.write('RPM: '..message["turbine1rpm"]..'')
|
| 21 | - | reactor1Fuel = reactor.getFuelConsumedLastTick() |
| 21 | + | term.setCursorPos(1,6) |
| 22 | - | --make table of info |
| 22 | + | monitor.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
|
| 23 | - | t = {}
|
| 23 | + | term.setCursorPos(1,7) |
| 24 | - | t["bank"] = bank1 |
| 24 | + | monitor.write('Generation: '..message["turbine1RFT"]..' rf/t')
|
| 25 | - | t["turbine1capacitor"] = turbine.getEnergyStored() |
| 25 | + | term.setCursorPos(1,8) |
| 26 | - | t["turbine1rpm"] = turbine.getRotorSpeed() |
| 26 | + | monitor.write('Capacitor: '..message["turbine1capacitor"]..'')
|
| 27 | - | t["turbine1RFT"] = turbine.getEnergyProducedLastTick() |
| 27 | + | term.setCursorPos(1,10) |
| 28 | - | t["turbine1Flow"] = turbine.getFluidFlowRate() |
| 28 | + | monitor.write('Reactor:')
|
| 29 | - | t["reactor1Temp"] = reactor.getFuelTemperature() |
| 29 | + | term.setCursorPos(1,11) |
| 30 | - | t["reactor1Steam"] = reactor.getEnergyProducedLastTick() |
| 30 | + | monitor.write('Temp: '..message["reactor1Temp"]..'')
|
| 31 | - | t["reactor1Fuel"] = reactor.getFuelConsumedLastTick() |
| 31 | + | term.setCursorPos(1,12) |
| 32 | - | sleep(1) |
| 32 | + | monitor.write('Steam Pressure: '..message["reactor1Steam"]..'')
|
| 33 | - | rednet.open("bottom")
|
| 33 | + | term.setCursorPos(1,13) |
| 34 | - | rednet.broadcast(t) |
| 34 | + | monitor.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
|
| 35 | - | |
| 35 | + | end |
| 36 | - | wipeScreen() |
| 36 | + | end |