SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local turbine1 |
| 1 | + | local turbine |
| 2 | - | local reactor1 |
| 2 | + | local reactor |
| 3 | - | local monitor |
| 3 | + | turbine = peripheral.wrap("left")
|
| 4 | reactor = peripheral.wrap("BigReactors-Reactor_0")
| |
| 5 | - | monitor = peripheral.wrap("right")
|
| 5 | + | |
| 6 | function wipeScreen() | |
| 7 | term.clear() | |
| 8 | - | rednet.open("back")
|
| 8 | + | term.setCursorPos(1, 1) |
| 9 | - | message = rednet.receive() |
| 9 | + | end |
| 10 | - | if message["bank"] == "bank1" then |
| 10 | + | |
| 11 | - | monitor.write('Reactor - Turbine Monitoring')
|
| 11 | + | |
| 12 | - | term.setCursorPos(1,2) |
| 12 | + | sleep(0) |
| 13 | - | monitor.write('Data Broadcast Received')
|
| 13 | + | --Turbine Info |
| 14 | - | term.setCursorPos(1,3) |
| 14 | + | turbine1capacitor = turbine.getEnergyStored() |
| 15 | - | monitor.write('System Status')
|
| 15 | + | turbine1rpm = turbine.getRotorSpeed() |
| 16 | - | term.setCursorPos(1,4) |
| 16 | + | turbine1RFT = turbine.getEnergyProducedLastTick() |
| 17 | - | monitor.write('Turbine:')
|
| 17 | + | turbine1Flow = turbine.getFluidFlowRate() |
| 18 | - | term.setCursorPos(1,5) |
| 18 | + | --Reactor Info |
| 19 | - | monitor.write('RPM: '..message["turbine1rpm"]..'')
|
| 19 | + | reactor1Temp = reactor.getFuelTemperature() |
| 20 | - | term.setCursorPos(1,6) |
| 20 | + | reactor1Steam = reactor.getEnergyProducedLastTick() |
| 21 | - | monitor.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
|
| 21 | + | reactor1Fuel = reactor.getFuelConsumedLastTick() |
| 22 | - | term.setCursorPos(1,7) |
| 22 | + | --make table of info |
| 23 | - | monitor.write('Generation: '..message["turbine1RFT"]..' rf/t')
|
| 23 | + | t = {}
|
| 24 | - | term.setCursorPos(1,8) |
| 24 | + | t["bank"] = 1 |
| 25 | - | monitor.write('Capacitor: '..message["turbine1capacitor"]..'')
|
| 25 | + | t["turbine1capacitor"] = turbine.getEnergyStored() |
| 26 | - | term.setCursorPos(1,10) |
| 26 | + | t["turbine1rpm"] = turbine.getRotorSpeed() |
| 27 | - | monitor.write('Reactor:')
|
| 27 | + | t["turbine1RFT"] = turbine.getEnergyProducedLastTick() |
| 28 | - | term.setCursorPos(1,11) |
| 28 | + | t["turbine1Flow"] = turbine.getFluidFlowRate() |
| 29 | - | monitor.write('Temp: '..message["reactor1Temp"]..'')
|
| 29 | + | t["reactor1Temp"] = reactor.getFuelTemperature() |
| 30 | - | term.setCursorPos(1,12) |
| 30 | + | t["reactor1Steam"] = reactor.getEnergyProducedLastTick() |
| 31 | - | monitor.write('Steam Pressure: '..message["reactor1Steam"]..'')
|
| 31 | + | t["reactor1Fuel"] = reactor.getFuelConsumedLastTick() |
| 32 | - | term.setCursorPos(1,13) |
| 32 | + | sleep(1) |
| 33 | - | monitor.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
|
| 33 | + | rednet.open("bottom")
|
| 34 | - | end |
| 34 | + | rednet.send(2, t) |
| 35 | - | end |
| 35 | + | |
| 36 | wipeScreen() | |
| 37 | print('Reactor - Turbine Monitor')
| |
| 38 | term.setCursorPos(1,2) | |
| 39 | print('Data Broadcast Live')
| |
| 40 | term.setCursorPos(1,3) | |
| 41 | print('System Status')
| |
| 42 | term.setCursorPos(1,4) | |
| 43 | print('Turbine:')
| |
| 44 | term.setCursorPos(1,5) | |
| 45 | print('RPM: '..turbine.getRotorSpeed()..'')
| |
| 46 | term.setCursorPos(1,6) | |
| 47 | print('Flow Rate: '..turbine.getFluidFlowRate()..'mb/t')
| |
| 48 | term.setCursorPos(1,7) | |
| 49 | print('Generation: '..turbine.getEnergyProducedLastTick()..' rf/t')
| |
| 50 | term.setCursorPos(1,8) | |
| 51 | print('Capacitor: '..turbine.getEnergyStored()..'')
| |
| 52 | term.setCursorPos(1,10) | |
| 53 | print('Reactor:')
| |
| 54 | term.setCursorPos(1,11) | |
| 55 | print('Temp: '..reactor.getFuelTemperature()..'')
| |
| 56 | term.setCursorPos(1,12) | |
| 57 | print('Steam Pressure: '..reactor.getEnergyProducedLastTick()..'')
| |
| 58 | term.setCursorPos(1,13) | |
| 59 | print('Fuel Consumption: '..reactor.getFuelConsumedLastTick()..'')
| |
| 60 | end |