SHOW:
|
|
- or go back to the newest paste.
1 | - | print('ReactorControl Engaged. View Monitor.') |
1 | + | local turbine1=peripheral.wrap('BigReactors-Turbine_0') |
2 | - | print('Thank you Vircomore!') |
2 | + | local turbine2=peripheral.wrap('BigReactors-Turbine_1') |
3 | local turbine3=peripheral.wrap('BigReactors-Turbine_2') | |
4 | - | emptyflag=0 |
4 | + | local turbine4=peripheral.wrap('BigReactors-Turbine_3') |
5 | - | offlineflag=0 |
5 | + | local turbine5=peripheral.wrap('BigReactors-Turbine_4') |
6 | - | flashflag=0 |
6 | + | local turbine6=peripheral.wrap('BigReactors-Turbine_5') |
7 | local turbine7=peripheral.wrap('BigReactors-Turbine_6') | |
8 | - | reactor=peripheral.wrap('back') |
8 | + | local turbine8=peripheral.wrap('BigReactors-Turbine_7') |
9 | - | local monitor=peripheral.wrap('monitor_14') |
9 | + | local monitor=peripheral.wrap('monitor_2') |
10 | ||
11 | monitor.setTextScale(1) | |
12 | monitor.setBackgroundColor(colors.black) | |
13 | ||
14 | while true do | |
15 | monitor.clear() | |
16 | - | monitor.setCursorPos(9,1) |
16 | + | monitor.setCursorPos(2,2) |
17 | monitor.setTextColor(colors.white) | |
18 | - | monitor.write('Backup-Reactor') |
18 | + | monitor.write('Turbine Information System') |
19 | - | monitor.setCursorPos(9,2) |
19 | + | monitor.setCursorPos(2,3) |
20 | monitor.setTextColor(colors.white) | |
21 | - | monitor.write('==============') |
21 | + | monitor.write('==========================') |
22 | - | monitor.setCursorPos(1,4) |
22 | + | |
23 | monitor.setCursorPos(1,5) | |
24 | - | monitor.write('Fuel Level:') |
24 | + | |
25 | monitor.write('Turbine 01:') | |
26 | - | monitor.setTextColor(colors.yellow) |
26 | + | |
27 | - | monitor.write(math.floor(((reactor.getFuelAmount()/reactor.getFuelAmountMax())*100)+0.5)..'% Fuel') |
27 | + | if turbine1.getActive()==false then |
28 | redstone.setOutput('left', true) | |
29 | - | monitor.setTextColor(colors.lightBlue) |
29 | + | monitor.setTextColor(colors.red) |
30 | - | monitor.write(math.floor(((reactor.getWasteAmount()/reactor.getFuelAmountMax())*100)+0.5)..'% Waste') |
30 | + | monitor.write('OFFLINE') |
31 | sleep(1) | |
32 | redstone.setOutput('left', false) | |
33 | - | monitor.write('Control Rod Levels:') |
33 | + | |
34 | - | monitor.setTextColor(colors.green) |
34 | + | redstone.setOutput('left', false) |
35 | monitor.setTextColor(colors.green) | |
36 | - | monitor.write('All Rods: '..(100-(reactor.getControlRodLevel(0)))..'% Depth') |
36 | + | monitor.write((math.floor(turbine1.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
37 | monitor.write((math.floor(turbine1.getRotorSpeed()+0.5))..' RPM') | |
38 | end | |
39 | - | monitor.write('Temperature:') |
39 | + | |
40 | monitor.setCursorPos(1,8) | |
41 | - | monitor.setTextColor(colors.lightGray) |
41 | + | |
42 | - | monitor.write('Casing: ') |
42 | + | monitor.write('Turbine 02:') |
43 | - | if reactor.getCasingTemperature()>=1700 then |
43 | + | |
44 | - | monitor.setTextColor(colors.purple) |
44 | + | if turbine2.getActive()==false then |
45 | - | else if reactor.getCasingTemperature()>=2240 then |
45 | + | redstone.setOutput('left', true) |
46 | - | monitor.setTextColor(colors.red) |
46 | + | monitor.setTextColor(colors.red) |
47 | - | else |
47 | + | monitor.write('OFFLINE') |
48 | - | monitor.setTextColor(colors.green) |
48 | + | sleep(1) |
49 | - | end |
49 | + | redstone.setOutput('left', false) |
50 | else | |
51 | - | monitor.write(reactor.getCasingTemperature()..'C') |
51 | + | redstone.setOutput('left', false) |
52 | monitor.setTextColor(colors.green) | |
53 | - | monitor.setCursorPos(1,13) |
53 | + | monitor.write((math.floor(turbine2.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
54 | - | monitor.setTextColor(colors.yellow) |
54 | + | monitor.write((math.floor(turbine2.getRotorSpeed()+0.5))..' RPM') |
55 | - | monitor.write('Fuel: ') |
55 | + | |
56 | - | if reactor.getFuelTemperature()>=1700 then |
56 | + | |
57 | - | monitor.setTextColor(colors.purple) |
57 | + | |
58 | - | else if reactor.getFuelTemperature()>=2240 then |
58 | + | |
59 | - | monitor.setTextColor(colors.red) |
59 | + | monitor.write('Turbine 03:') |
60 | - | else |
60 | + | |
61 | - | monitor.setTextColor(colors.green) |
61 | + | if turbine3.getActive()==false then |
62 | - | end |
62 | + | redstone.setOutput('left', true) |
63 | monitor.setTextColor(colors.red) | |
64 | - | monitor.write(reactor.getFuelTemperature()..'C') |
64 | + | monitor.write('OFFLINE') |
65 | sleep(1) | |
66 | redstone.setOutput('left', false) | |
67 | else | |
68 | - | monitor.write('Flux:') |
68 | + | redstone.setOutput('left', false) |
69 | - | monitor.setCursorPos(1,16) |
69 | + | monitor.setTextColor(colors.green) |
70 | - | monitor.setTextColor(colors.green) |
70 | + | monitor.write((math.floor(turbine3.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
71 | - | monitor.write(reactor.getEnergyStored()..' RF Stored ') |
71 | + | monitor.write((math.floor(turbine3.getRotorSpeed()+0.5))..' RPM') |
72 | end | |
73 | - | if reactor.getEnergyProducedLastTick()>=46000 and reactor.getEnergyProducedLastTick()<60000 then |
73 | + | |
74 | - | monitor.setTextColor(colors.orange) |
74 | + | monitor.setCursorPos(1,14) |
75 | monitor.setTextColor(colors.white) | |
76 | monitor.write('Turbine 04:') | |
77 | - | if reactor.getEnergyProducedLastTick()>=60000 then |
77 | + | |
78 | - | monitor.setTextColor(colors.red) |
78 | + | if turbine3.getActive()==false then |
79 | redstone.setOutput('left', true) | |
80 | - | monitor.write((math.floor(reactor.getEnergyProducedLastTick()+0.5))..'RF/t') |
80 | + | monitor.setTextColor(colors.red) |
81 | monitor.write('OFFLINE') | |
82 | sleep(1) | |
83 | - | monitor.setTextColor(colors.orange) |
83 | + | redstone.setOutput('left', false) |
84 | - | monitor.write('Status:') |
84 | + | |
85 | redstone.setOutput('left', false) | |
86 | - | if flashflag==0 then |
86 | + | monitor.setTextColor(colors.green) |
87 | - | flashflag=1 |
87 | + | monitor.write((math.floor(turbine3.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
88 | - | if offlineflag==1 then |
88 | + | monitor.write((math.floor(turbine3.getRotorSpeed()+0.5))..' RPM') |
89 | - | monitor.setCursorPos(1,19) |
89 | + | |
90 | - | monitor.setTextColor(colors.lightGray) |
90 | + | |
91 | - | monitor.write('OFFLINE - Manual Override') |
91 | + | monitor.setCursorPos(1,17) |
92 | - | end |
92 | + | |
93 | - | if emptyflag==1 then |
93 | + | monitor.write('Turbine 05:') |
94 | - | monitor.setCursorPos(1,19) |
94 | + | |
95 | - | monitor.setTextColor(colors.pink) |
95 | + | if turbine4.getActive()==false then |
96 | - | monitor.write('OFFLINE - Fuel Exhausted') |
96 | + | redstone.setOutput('left', true) |
97 | - | end |
97 | + | monitor.setTextColor(colors.red) |
98 | - | if emptyflag==0 and offlineflag==0 and reactor.getControlRodLevel(0)>74 then |
98 | + | monitor.write('OFFLINE') |
99 | - | monitor.setCursorPos(1,19) |
99 | + | sleep(1) |
100 | - | monitor.setTextColor(colors.yellow) |
100 | + | redstone.setOutput('left', false) |
101 | - | monitor.write('ONLINE - Efficient-Mode') |
101 | + | |
102 | - | end |
102 | + | redstone.setOutput('left', false) |
103 | - | if emptyflag==0 and offlineflag==0 and reactor.getControlRodLevel(0)<=74 then |
103 | + | monitor.setTextColor(colors.green) |
104 | - | monitor.setCursorPos(1,19) |
104 | + | monitor.write((math.floor(turbine4.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
105 | - | monitor.setTextColor(colors.orange) |
105 | + | monitor.write((math.floor(turbine4.getRotorSpeed()+0.5))..' RPM') |
106 | - | monitor.write('ONLINE - High Fuel Consumption!') |
106 | + | |
107 | - | end |
107 | + | |
108 | monitor.setCursorPos(1,20) | |
109 | - | flashflag=0 |
109 | + | |
110 | - | monitor.setCursorPos(1,19) |
110 | + | monitor.write('Turbine 06:') |
111 | - | monitor.clearLine() |
111 | + | monitor.setCursorPos(1,21) |
112 | if turbine5.getActive()==false then | |
113 | redstone.setOutput('left', true) | |
114 | - | if reactor.getEnergyStored()<=10000000 and reactor.getEnergyStored()>100 then |
114 | + | monitor.setTextColor(colors.red) |
115 | - | reactor.setAllControlRodLevels(0+(math.floor(reactor.getEnergyStored()/100000))) |
115 | + | monitor.write('OFFLINE') |
116 | sleep(1) | |
117 | - | reactor.setAllControlRodLevels(0) |
117 | + | redstone.setOutput('left', false) |
118 | else | |
119 | redstone.setOutput('left', false) | |
120 | - | if reactor.getFuelAmount()<=100 and offlineflag==0 then |
120 | + | monitor.setTextColor(colors.green) |
121 | - | reactor.setAllControlRodLevels(100) |
121 | + | monitor.write((math.floor(turbine5.getEnergyProducedLastTick()+0.5))..' RF/t @ ') |
122 | - | reactor.setActive(false) |
122 | + | monitor.write((math.floor(turbine5.getRotorSpeed()+0.5))..' RPM') |
123 | - | emptyflag=1 |
123 | + | |
124 | ||
125 | - | emptyflag=0 |
125 | + | monitor.setCursorPos(1,23) |
126 | monitor.setTextColor(colors.white) | |
127 | - | |
127 | + | monitor.write('Turbine 07:') |
128 | - | if rs.getInput('bottom')==false and emptyflag==0 then |
128 | + | monitor.setCursorPos(1,24) |
129 | - | reactor.setActive(true) |
129 | + | if turbine6.getActive()==false then |
130 | - | offlineflag=0 |
130 | + | redstone.setOutput('left', true) |
131 | monitor.setTextColor(colors.red) | |
132 | - | |
132 | + | monitor.write('OFFLINE') |
133 | - | if rs.getInput('bottom')==true and emptyflag==0 then |
133 | + | sleep(1) |
134 | - | reactor.setActive(false) |
134 | + | redstone.setOutput('left', false) |
135 | - | reactor.setAllControlRodLevels(100) |
135 | + | |
136 | - | offlineflag=1 |
136 | + | redstone.setOutput('left', false) |
137 | - | end |
137 | + | monitor.setTextColor(colors.green) |
138 | monitor.write((math.floor(turbine6.getEnergyProducedLastTick()+0.5))..' RF/t @ ') | |
139 | monitor.write((math.floor(turbine6.getRotorSpeed()+0.5))..' RPM') | |
140 | end | |
141 | ||
142 | monitor.setCursorPos(1,26) | |
143 | monitor.setTextColor(colors.white) | |
144 | monitor.write('Turbine 08:') | |
145 | monitor.setCursorPos(1,27) | |
146 | if turbine7.getActive()==false then | |
147 | redstone.setOutput('left', true) | |
148 | monitor.setTextColor(colors.red) | |
149 | monitor.write('OFFLINE') | |
150 | sleep(1) | |
151 | redstone.setOutput('left', false) | |
152 | else | |
153 | redstone.setOutput('left', false) | |
154 | monitor.setTextColor(colors.green) | |
155 | monitor.write((math.floor(turbine7.getEnergyProducedLastTick()+0.5))..' RF/t @ ') | |
156 | monitor.write((math.floor(turbine7.getRotorSpeed()+0.5))..' RPM') | |
157 | end | |
158 | ||
159 | sleep(1) | |
160 | end |