SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI "monAPI" | |
| 2 | local turbine1 | |
| 3 | local reactor1 | |
| 4 | local mon = monAPI.wrapMonitor("right")
| |
| 5 | ||
| 6 | mon.setTextColor(colors.white) | |
| 7 | mon.setBackgroundColor(colors.black) | |
| 8 | mon.clear() | |
| 9 | mon.setCursorPos(1,1) | |
| 10 | mon.setTextScale(0.5) | |
| 11 | ||
| 12 | local section1 = mon.createSection(1,1,20,19) | |
| 13 | section1.clear() | |
| 14 | local section2 = mon.createSection(21,1,51,19) | |
| 15 | section2.clear() | |
| 16 | local section3 = mon.createSection(52,1,82,19) | |
| 17 | section3.clear() | |
| 18 | ||
| 19 | ||
| 20 | while true do | |
| 21 | rednet.open("back")
| |
| 22 | id,message = rednet.receive() | |
| 23 | ||
| 24 | if id == 158 then | |
| 25 | section2.clear() | |
| 26 | section2.drawBorder('#','#','+')
| |
| 27 | section2.setCursorPos(2,3) | |
| 28 | section2.write('Turbine - Reactor Bank 1')
| |
| 29 | section2.setCursorPos(2,4) | |
| 30 | section2.write('Data Broadcast Received')
| |
| 31 | section2.setCursorPos(2,5) | |
| 32 | section2.write('System Status')
| |
| 33 | section2.setCursorPos(2,6) | |
| 34 | section2.write('Turbine:')
| |
| 35 | section2.setCursorPos(2,7) | |
| 36 | if message["turbine1rpm"] >= 1725 then | |
| 37 | - | mon.setTextColor(colors.green) |
| 37 | + | section2.setTextColor(colors.green) |
| 38 | elseif message["turbine1rpm"] >= 800 then | |
| 39 | - | mon.setTextColor(colors.orange) |
| 39 | + | section2.setTextColor(colors.orange) |
| 40 | else | |
| 41 | - | mon.setTextColor(colors.red) |
| 41 | + | section2.setTextColor(colors.red) |
| 42 | end | |
| 43 | section2.write('RPM: '..message["turbine1rpm"]..'')
| |
| 44 | section2.setCursorPos(2,8) | |
| 45 | if message["turbine1Flow"] >= 1950 then | |
| 46 | section2.setTextColor(colors.green) | |
| 47 | elseif message["turbine1Flow"] >= 1000 then | |
| 48 | section2.setTextColor(colors.orange) | |
| 49 | else | |
| 50 | section2.setTextColor(colors.red) | |
| 51 | end | |
| 52 | section2.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
| |
| 53 | section2.setCursorPos(2,9) | |
| 54 | if message["turbine1RFT"] >= 25000 then | |
| 55 | section2.setTextColor(colors.green) | |
| 56 | elseif message["turbine1RFT"] >= 14000 then | |
| 57 | - | section2.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
|
| 57 | + | section2.setTextColor(colors.orange) |
| 58 | else | |
| 59 | section2.setTextColor(colors.red) | |
| 60 | end | |
| 61 | section2.write('Generation: '..message["turbine1RFT"]..' rf/t')
| |
| 62 | section2.setCursorPos(2,10) | |
| 63 | if message["turbine1capacitor"] >= 900000 then | |
| 64 | section2.setTextColor(colors.green) | |
| 65 | elseif message["turbine1capacitor"] >= 400000 then | |
| 66 | section2.setTextColor(colors.orange) | |
| 67 | else | |
| 68 | section2.setTextColor(colors.red) | |
| 69 | end | |
| 70 | section2.write('Capacitor: '..message["turbine1capacitor"]..'')
| |
| 71 | section2.setCursorPos(2,11) | |
| 72 | - | mon.setTextColor(colors.green) |
| 72 | + | section2.setTextColor(colors.white) |
| 73 | section2.write('Reactor:')
| |
| 74 | - | mon.setTextColor(colors.orange) |
| 74 | + | |
| 75 | if message["reactor1Temp"] <= 700 then | |
| 76 | - | mon.setTextColor(colors.red) |
| 76 | + | section2.setTextColor(colors.green) |
| 77 | elseif message["reactor1Temp"] <= 800 then | |
| 78 | section2.setTextColor(colors.orange) | |
| 79 | else | |
| 80 | section2.setTextColor(colors.red) | |
| 81 | - | mon.setTextColor(colors.green) |
| 81 | + | |
| 82 | section2.write('Temp: '..message["reactor1Temp"]..'')
| |
| 83 | - | mon.setTextColor(colors.orange) |
| 83 | + | |
| 84 | if message["reactor1Steam"] >= 1950 then | |
| 85 | - | mon.setTextColor(colors.red) |
| 85 | + | section2.setTextColor(colors.green) |
| 86 | elseif message["reactor1Steam"] >= 1000 then | |
| 87 | section2.setTextColor(colors.orange) | |
| 88 | else | |
| 89 | section2.setTextColor(colors.red) | |
| 90 | - | mon.setTextColor(colors.green) |
| 90 | + | |
| 91 | section2.write('Steam Pressure: '..message["reactor1Steam"]..'')
| |
| 92 | - | mon.setTextColor(colors.orange) |
| 92 | + | |
| 93 | if message["reactor1Fuel"] <= 0.06 then | |
| 94 | - | mon.setTextColor(colors.red) |
| 94 | + | section2.setTextColor(colors.green) |
| 95 | elseif message["reactor1Fuel"] <= 0.05 then | |
| 96 | section2.setTextColor(colors.orange) | |
| 97 | else | |
| 98 | section2.setTextColor(colors.red) | |
| 99 | - | mon.setTextColor(colors.green) |
| 99 | + | |
| 100 | section2.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
| |
| 101 | - | mon.setTextColor(colors.orange) |
| 101 | + | |
| 102 | elseif id == 159 then | |
| 103 | - | mon.setTextColor(colors.red) |
| 103 | + | |
| 104 | section2.drawBorder('#','#','+')
| |
| 105 | section3.setCursorPos(2,3) | |
| 106 | section3.write('Turbine - Reactor Bank 2')
| |
| 107 | - | mon.setTextColor(colors.white) |
| 107 | + | |
| 108 | section3.write('Data Broadcast Received')
| |
| 109 | section3.setCursorPos(2,5) | |
| 110 | section3.write('System Status')
| |
| 111 | - | mon.setTextColor(colors.green) |
| 111 | + | |
| 112 | section3.write('Turbine:')
| |
| 113 | - | mon.setTextColor(colors.orange) |
| 113 | + | |
| 114 | if message["turbine1rpm"] >= 1725 then | |
| 115 | - | mon.setTextColor(colors.red) |
| 115 | + | section3.setTextColor(colors.green) |
| 116 | elseif message["turbine1rpm"] >= 800 then | |
| 117 | section3.setTextColor(colors.orange) | |
| 118 | else | |
| 119 | section3.setTextColor(colors.red) | |
| 120 | - | mon.setTextColor(colors.green) |
| 120 | + | |
| 121 | section3.write('RPM: '..message["turbine1rpm"]..'')
| |
| 122 | - | mon.setTextColor(colors.orange) |
| 122 | + | |
| 123 | if message["turbine1Flow"] >= 1950 then | |
| 124 | - | mon.setTextColor(colors.red) |
| 124 | + | section3.setTextColor(colors.green) |
| 125 | elseif message["turbine1Flow"] >= 1000 then | |
| 126 | section3.setTextColor(colors.orange) | |
| 127 | else | |
| 128 | section3.setTextColor(colors.red) | |
| 129 | - | mon.setTextColor(colors.green) |
| 129 | + | |
| 130 | section3.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
| |
| 131 | - | mon.setTextColor(colors.orange) |
| 131 | + | |
| 132 | if message["turbine1RFT"] >= 25000 then | |
| 133 | - | mon.setTextColor(colors.red) |
| 133 | + | section3.setTextColor(colors.green) |
| 134 | elseif message["turbine1RFT"] >= 14000 then | |
| 135 | section3.setTextColor(colors.orange) | |
| 136 | else | |
| 137 | section3.setTextColor(colors.red) | |
| 138 | end | |
| 139 | section3.write('Generation: '..message["turbine1RFT"]..' rf/t')
| |
| 140 | section3.setCursorPos(2,10) | |
| 141 | if message["turbine1capacitor"] >= 900000 then | |
| 142 | section3.setTextColor(colors.green) | |
| 143 | elseif message["turbine1capacitor"] >= 400000 then | |
| 144 | section3.setTextColor(colors.orange) | |
| 145 | else | |
| 146 | section3.setTextColor(colors.red) | |
| 147 | end | |
| 148 | section3.write('Capacitor: '..message["turbine1capacitor"]..'')
| |
| 149 | section3.setCursorPos(2,11) | |
| 150 | section3.setTextColor(colors.white) | |
| 151 | section3.write('Reactor:')
| |
| 152 | section3.setCursorPos(2,12) | |
| 153 | if message["reactor1Temp"] <= 700 then | |
| 154 | section3.setTextColor(colors.green) | |
| 155 | elseif message["reactor1Temp"] <= 800 then | |
| 156 | section3.setTextColor(colors.orange) | |
| 157 | else | |
| 158 | section3.setTextColor(colors.red) | |
| 159 | end | |
| 160 | section3.write('Temp: '..message["reactor1Temp"]..'')
| |
| 161 | section3.setCursorPos(2,13) | |
| 162 | if message["reactor1Steam"] >= 1950 then | |
| 163 | section3.setTextColor(colors.green) | |
| 164 | elseif message["reactor1Steam"] >= 1000 then | |
| 165 | section3.setTextColor(colors.orange) | |
| 166 | else | |
| 167 | section3.setTextColor(colors.red) | |
| 168 | end | |
| 169 | section3.write('Steam Pressure: '..message["reactor1Steam"]..'')
| |
| 170 | section3.setCursorPos(2,14) | |
| 171 | if message["reactor1Fuel"] <= 0.06 then | |
| 172 | section3.setTextColor(colors.green) | |
| 173 | elseif message["reactor1Fuel"] <= 0.05 then | |
| 174 | section3.setTextColor(colors.orange) | |
| 175 | else | |
| 176 | section3.setTextColor(colors.red) | |
| 177 | end | |
| 178 | section3.write('Fuel Consumption: '..message["reactor1Fuel"]..'')
| |
| 179 | end | |
| 180 | ||
| 181 | end |