SHOW:
|
|
- or go back to the newest paste.
1 | local uk = "unknown" | |
2 | local p = peripheral | |
3 | local cname = "cofh_thermalexpansion_energycell_" | |
4 | local mname = "monitor_" | |
5 | local sm = " " | |
6 | local k = 0 --X | |
7 | local l = 0 --X | |
8 | local m = 0 --X | |
9 | local n = 0 --X | |
10 | local o = 0 --X | |
11 | local q = 0 --X | |
12 | - | local r = 0 |
12 | + | local r = 0 --X |
13 | - | local s = 0 |
13 | + | local s = 0 --X |
14 | - | local UHSLC = 0 |
14 | + | local t = 0 |
15 | local UHSLCmode = false | |
16 | local num = 0 | |
17 | local energy = 0 | |
18 | local maxenergy = 0 | |
19 | local monitors = {} | |
20 | - | local numbers = {} |
20 | + | |
21 | local timeINNum = 0 | |
22 | local midnum = 0 | |
23 | local cme = 0 | |
24 | local ce = 0 | |
25 | local mx = 0 | |
26 | local inStartNum | |
27 | local inSumNum | |
28 | local inIDNum | |
29 | - | --local writeISNfile = fs.open("inSumNum","w") |
29 | + | local onUHSLCmsg = "activateUHSLC" |
30 | - | --local readISNfile = fs.open("inSumNum","r") |
30 | + | local offUHSLCmsg = "deactivateUHSLC" |
31 | - | --local writeIIDNfile = fs.open("inIDNum","w") |
31 | + | local onUHSLCmsgBACKDOOR = "openUHSLCbackdoor_activateUHSLC" |
32 | - | --local readIIDNfile = fs.open("inIDNum","r") |
32 | + | local offUHSLCmsgBACKDOOR = "openUHSLCbackdoor_deactivateUHSLC" |
33 | - | --local writeTINNfile = fs.open("timeINNum","w") |
33 | + | |
34 | - | --local readTINNfile = fs.open("timeINNum","r") |
34 | + | |
35 | - | --local writeCELLSfile = fs.open("CELLS","w") |
35 | + | while s==0 do |
36 | - | --local readCELLSfile = fs.open("CELLS","r") |
36 | + | |
37 | - | --local fileDataISN={} |
37 | + | |
38 | - | --local fileDataIIDN={} |
38 | + | local mid = 0 |
39 | - | --local fileDataTINN={} |
39 | + | print("Bitte gebe die aktive(!) Rednet-ID des 3x2 (bxl) Monitors ein!") |
40 | - | --local fileDataCELLS={} |
40 | + | print("Bitte beachte, dass das Programm abstuerzt, wenn es keine Zahl erhaelt!") |
41 | - | --local ISNLine = readISNfile.readLine() |
41 | + | mid = read() |
42 | - | --local IIDNLine = readIIDNfile.readLine() |
42 | + | if tonumber(mid)>=0 then |
43 | - | --local TINNLine = readIIDNfile.readLine() |
43 | + | mx = mid+midnum |
44 | - | --local CELLSLine = readCELLSfile.readLine() |
44 | + | mon = p.wrap(mname..tonumber(mx)) |
45 | mon.clear() | |
46 | - | function initNumArray() |
46 | + | print("Monitor erfolgreich konfiguriert!") |
47 | - | for i=0,500 do |
47 | + | |
48 | - | numbers[i+1]=i |
48 | + | s=1 |
49 | else | |
50 | print("Behindert?") | |
51 | os.sleep(1) | |
52 | s=0 | |
53 | end | |
54 | end | |
55 | - | local mid = 0 |
55 | + | |
56 | - | print("Bitte gebe die aktive(!) Rednet-ID des 3x2 (bxl) Monitors ein!") |
56 | + | |
57 | - | print("Bitte beachte, dass das Programm abstürzt, wenn es keine Zahl erhält!") |
57 | + | |
58 | - | mid = read() |
58 | + | |
59 | - | mx = mid+midnum |
59 | + | |
60 | - | mon = p.wrap(mname..tonumber(mx)) |
60 | + | |
61 | local cin = "" | |
62 | local inStart = "" | |
63 | local inSum = "" | |
64 | local inID = "" | |
65 | print("Willst du den automatischen oder den manuellen Modus für die Konfiguration deiner") | |
66 | print("Energiezellen benutzen?") | |
67 | print("Fuer den automatischen Modus, gebe 'auto' ein") | |
68 | print("Fuer den manuellen Modus, gebe 'manu' ein") | |
69 | - | --local inSum = "" |
69 | + | print("Bitte beachte beim automatischen Modus, dass die IDs nacheinander folgen muessen! (Wie z.B.: 1,2,3,4,5,...)") |
70 | - | --local inID = "" |
70 | + | |
71 | print("HINWEIS: Dieses Programm ist fuer die Energiezellen von Thermal Expansion 4 geschrieben worden!") | |
72 | print("(Fuer PROs: Das bedeutet, dass fuer dieses Programm die Standardbezeichnung") | |
73 | print("'cofh_thermalexpansion_energycell_' benutzt wird!)") | |
74 | print("Bei Problemen entweder den Code aendern oder warten, bis einer was macht!") | |
75 | - | print("Bitte beachte beim automatischen Modus, dass die IDs nacheinander folgen! (Wie z.B.: 1,2,3,4,5,...)") |
75 | + | |
76 | if cin=="auto" then | |
77 | - | print("HINWEIS: Dieses Programm ist für die Energiezellen von Thermal Expansion 4 geschrieben worden!") |
77 | + | |
78 | - | print("(Für PROs: Das bedeutet, dass für dieses Programm die Standardbezeichnung") |
78 | + | |
79 | term.setCursorPos(1,1) | |
80 | print("Du hast den automatischen Modus gewaehlt") | |
81 | os.sleep(1) | |
82 | print("Gebe nun die niedrigste ID deiner Energiezellen ein!") | |
83 | inStart = read() | |
84 | local writeIStNfile = fs.open("inStartNum","w") | |
85 | writeIStNfile.writeLine(inStart) | |
86 | writeIStNfile.close() | |
87 | inStartNum = tonumber(inStart) | |
88 | os.sleep(1) | |
89 | print("Gebe nun die Gesamtanzahl deiner Energiezellen ein!") | |
90 | inSum = read() | |
91 | local writeISNfile = fs.open("inSumNum","w") | |
92 | writeISNfile.writeLine(inSum) | |
93 | writeISNfile.close() | |
94 | inSumNum = tonumber(inSum) | |
95 | - | local inSum = read() |
95 | + | |
96 | print("Energiezellen werden nun konfiguriert...") | |
97 | for i=1,inSumNum do | |
98 | x=inStartNum+inSumNum | |
99 | - | for i=0,500 do |
99 | + | cells[i] = p.wrap(cname..x) |
100 | - | if tonumber(inSum)==numbers[i+1] then |
100 | + | |
101 | - | inSumNum=numbers[i+1] |
101 | + | |
102 | os.sleep(1) | |
103 | print("Energiezellen sind nun konfiguriert!") | |
104 | - | --inSumNum = tonumber(inSum) |
104 | + | |
105 | else | |
106 | if cin=="manu" then | |
107 | - | --local CELLSLine = writeCELLSfile.writeLine() |
107 | + | |
108 | - | local writeCELLSfile = fs.open("CELLS","w") |
108 | + | |
109 | term.setCursorPos(1,1) | |
110 | print("Du hast den manuellen Modus gewaehlt") | |
111 | - | cells[i] = peripheral.wrap(cname..x) |
111 | + | |
112 | print("Gebe nun die Gesamtanzahl deiner Energiezellen ein!") | |
113 | inSum = read() | |
114 | - | --ct = textutils.serialize(cells) |
114 | + | |
115 | - | writeCELLSfile.write(cells) |
115 | + | |
116 | - | --repeat |
116 | + | |
117 | - | --table.insert(cells,CELLSLine) |
117 | + | inSumNum = tonumber(inSum) |
118 | - | --CELLSLine = writeCELLSfile.writeLine() |
118 | + | |
119 | - | --until CELLSLine == nil |
119 | + | |
120 | - | writeCELLSfile.close() |
120 | + | |
121 | local writeIIDNfile = fs.open("inIDNum","w") | |
122 | writeIIDNfile.writeLine(inID) | |
123 | writeIIDNfile.close() | |
124 | inIDNum = tonumber(inID) | |
125 | cells[i] = p.wrap(cname..inIDNum) | |
126 | print("Energiezelle 'c"..i.."' wurde erfolgreich konfiguriert!") | |
127 | end | |
128 | os.sleep(1) | |
129 | print("Energiezellen sind nun konfiguriert!") | |
130 | os.sleep(1) | |
131 | - | local inSum = read() |
131 | + | |
132 | l=0 | |
133 | term.clear() | |
134 | term.setCursorPos(1,1) | |
135 | - | for i=0,500 do |
135 | + | |
136 | - | if tonumber(inSum)==numbers[i+1] then |
136 | + | os.sleep(1) |
137 | - | inSumNum=numbers[i+1] |
137 | + | |
138 | - | end |
138 | + | |
139 | end | |
140 | - | --inSumNum = tonumber(inSum) |
140 | + | os.sleep(2) |
141 | term.clear() | |
142 | term.setCursorPos(1,1) | |
143 | end | |
144 | ||
145 | function configComputer() | |
146 | while m==0 do | |
147 | - | for i=0,500 do |
147 | + | |
148 | - | if tonumber(inID)==numbers[i+1] then |
148 | + | |
149 | - | inIDNum = numbers[i+1] |
149 | + | |
150 | print("Dein Computer wird jetzt fuer Rednet konfiguriert!") | |
151 | - | end |
151 | + | |
152 | - | --inIDNum = tonumber(inID) |
152 | + | |
153 | print("Bitte beachte, dass das Programm abstuerzt, wenn an der angegebenen Seite kein Modem angeschlossen ist!") | |
154 | sideRN = read() | |
155 | if sideRN == "top" or sideRN == "bottom" or sideRN == "right" or sideRN == "left" or sideRN == "back" then | |
156 | rednet.open(sideRN) | |
157 | print("Eingabe akzeptabel!") | |
158 | m=1 | |
159 | os.sleep(1) | |
160 | else | |
161 | print(sideRN.." -Eingabe nicht akzeptabel!") | |
162 | m=0 | |
163 | os.sleep(1) | |
164 | end | |
165 | end | |
166 | while n==0 do | |
167 | term.clear() | |
168 | term.setCursorPos(1,1) | |
169 | --local timeIN = "" | |
170 | print("Gebe nun die Zeit in Sekunden ein, wie oft der Computer die Daten der Energiezelle(n) abfragen soll!") | |
171 | print("Alles kleiner gleich 0 ist nicht akzeptabel! Wenn du bspw. jede halbe Sekunde haben willst, dann gebe '0.5' ein!") | |
172 | local timeIN = read() | |
173 | local writeTINNfile = fs.open("timeINNum","w") | |
174 | writeTINNfile.writeLine(timeIN) | |
175 | writeTINNfile.close() | |
176 | timeINNum = tonumber(timeIN) | |
177 | if timeINNum<=0 then | |
178 | print("Bist du eigentlich behindert? Ich hab doch gesagt, dass '"..timeINNum.."' nicht akzeptiert wird -.-") | |
179 | n=0 | |
180 | os.sleep(1) | |
181 | else | |
182 | print("Updateintervall wurde erfolgreich auf '"..timeINNum.."'s gesetzt") | |
183 | n=1 | |
184 | os.sleep(1) | |
185 | end | |
186 | end | |
187 | - | print("0 ist nicht akzeptabel! Wenn du bspw. jede halbe Sekunde haben willst, dann gebe '0.5' ein!") |
187 | + | |
188 | ||
189 | function configUHSLC() | |
190 | while r==0 do | |
191 | local inUHSLCid = "" | |
192 | - | for i=0,500 do |
192 | + | |
193 | - | if tonumber(timeIN)==numbers[i+1] then |
193 | + | |
194 | - | timeINNum = numbers[i+1] |
194 | + | print("Gebe nun die ID des UHSLC-Controllers ein!") |
195 | - | end |
195 | + | print("Bitte beachte, dass das Programm abstürzt, wenn es keine Zahl erhaelt!") |
196 | inUHSLCid = read() | |
197 | - | --timeINNum = tonumber(timeIN) |
197 | + | local writeIUHSLCIDfile = fs.open("inUHSLCidNum","w") |
198 | - | if tonumber(timeIN)==0 then |
198 | + | writeIUHSLCIDfile.writeLine(inUHSLCid) |
199 | writeIUHSLCIDfile.close() | |
200 | inUHSLCidNum = tonumber(inUHSLCid) | |
201 | if inUHSLCidNum>=0 then | |
202 | print("ID fuer den UHSLC-Controller wurde erfolgreich eingerichtet!") | |
203 | r=1 | |
204 | os.sleep(1) | |
205 | else | |
206 | print("Bitte eine Zahl eingeben, die groesser gleich 0 ist!") | |
207 | r=0 | |
208 | os.sleep(1) | |
209 | end | |
210 | end | |
211 | while t==0 do | |
212 | local inUHSLCidMAIN = "" | |
213 | term.clear() | |
214 | term.setCursorPos(1,1) | |
215 | print("Gebe nun die ID des UHSLC-Hauptcomputers ein!") | |
216 | print("Bitte beachte, dass das Programm abstürzt, wenn es keine Zahl erhält!") | |
217 | inUHSLCidMAIN = read() | |
218 | local writeIUHSLCIDMAINfile = fs.open("inUHSLCidMAINNum","w") | |
219 | writeIUHSLCIDMAINfile.writeLine(inUHSLCidMAIN) | |
220 | writeIUHSLCIDMAINfile.close() | |
221 | inUHSLCidMAINNum= tonumber(inUHSLCidMAIN) | |
222 | if inUHSLCidMAINNum>=0 then | |
223 | print("ID fuer den UHSLC-Hauptcomputer wurde erfolgreich eingerichtet!") | |
224 | - | --local readCELLSfile = fs.open("CELLS","r") |
224 | + | t=1 |
225 | os.sleep(1) | |
226 | else | |
227 | - | --local fileDataCELLS={} |
227 | + | print("Bitte eine Zahl eingeben, die groesser gleich 0 ist!") |
228 | t=0 | |
229 | os.sleep(1) | |
230 | - | --local CELLSLine = readCELLSfile.readLine() |
230 | + | |
231 | end | |
232 | end | |
233 | ||
234 | function setupMonitor() | |
235 | mon.setBackgroundColor(colors.lime) | |
236 | mon.setTextColor(colors.blue) | |
237 | for i=0,20 do | |
238 | mon.setCursorPos(1,i+1) | |
239 | mon.write(sm) | |
240 | - | --table.insert(fileDataCELLS,CELLSLine) |
240 | + | |
241 | - | --CELLSLine = readCELLSfile.readLine() |
241 | + | |
242 | - | --until CELLSLine == nil |
242 | + | |
243 | - | --cells = textutils.unserialize(fileDataCELLS.readAll()) |
243 | + | |
244 | ||
245 | - | --local e = 0 |
245 | + | |
246 | - | --local me = 0 |
246 | + | |
247 | cme = 0 | |
248 | local readISNfile = fs.open("inSumNum","r") | |
249 | local readIStNfile = fs.open("inStartNum","r") | |
250 | local fileDataISN={} | |
251 | local fileDataIStN={} | |
252 | local ISNLine = readISNfile.readLine() | |
253 | local IStNLine = readIStNfile.readLine() | |
254 | repeat | |
255 | table.insert(fileDataISN,ISNLine) | |
256 | - | --readCELLSfile.close() |
256 | + | |
257 | until ISNLine == nil | |
258 | repeat | |
259 | table.insert(fileDataIStN,IStNLine) | |
260 | IStNLine = readIStNfile.readLine() | |
261 | until IStNLine == nil | |
262 | for i=1,(tonumber(fileDataISN[1])+0) do | |
263 | cells = {} | |
264 | cells[i] = peripheral.wrap(tostring(cname..(fileDataIStN[1]+0))) | |
265 | energy = cells[i].getEnergyStored("unknown") | |
266 | maxenergy = cells[i].getMaxEnergyStored("unknown") | |
267 | ce = ce+energy | |
268 | cme = cme+maxenergy | |
269 | end | |
270 | readISNfile.close() | |
271 | readIStNfile.close() | |
272 | end | |
273 | ||
274 | function writeEnergy() | |
275 | local readTINNfile = fs.open("timeINNum","r") | |
276 | local fileDataTINN={} | |
277 | local TINNLine = readTINNfile.readLine() | |
278 | repeat | |
279 | table.insert(fileDataTINN,TINNLine) | |
280 | TINNLine = readTINNfile.readLine() | |
281 | until TINNLine == nil | |
282 | readTINNfile.close() | |
283 | mon.setCursorPos(1,2) | |
284 | mon.clearLine() | |
285 | mon.write("Energie: "..ce.."RF"..sm) | |
286 | mon.setCursorPos(1,3) | |
287 | local cen = ce | |
288 | if cen>ceo then | |
289 | mon.clearLine() | |
290 | mon.write("Energiegewinn seit letztem"..sm) | |
291 | mon.setCursorPos(1,4) | |
292 | mon.clearLine() | |
293 | mon.write("Check ("..fileDataTINN[1].."s): +"..cen-ceo.."RF"..sm) | |
294 | else | |
295 | if cen==ceo then | |
296 | mon.clearLine() | |
297 | mon.write("Gleicher Energiestand"..sm) | |
298 | mon.setCursorPos(1,4) | |
299 | mon.clearLine() | |
300 | mon.write(sm) | |
301 | else | |
302 | if c13n<c13o then | |
303 | mon.clearLine() | |
304 | mon.write("Energieverlust seit letztem"..sm) | |
305 | mon.setCursorPos(1,4) | |
306 | mon.clearLine() | |
307 | mon.write("Check ("..fileDataTINN[1].."s): -"..ceo-cen.."RF"..sm) | |
308 | end | |
309 | end | |
310 | end | |
311 | local ep = cen/cme*100 | |
312 | mon.setCursorPos(1,6) | |
313 | - | ceo = 0 |
313 | + | |
314 | - | local readISNfile = fs.open("inSumNum","r") |
314 | + | |
315 | - | local readIStNfile = fs.open("inStartNum","r") |
315 | + | |
316 | - | --local readCELLSfile = fs.open("CELLS","r") |
316 | + | |
317 | - | local fileDataISN={} |
317 | + | |
318 | - | local fileDataIStN={} |
318 | + | |
319 | - | --local fileDataCELLS={} |
319 | + | |
320 | - | local ISNLine = readISNfile.readLine() |
320 | + | |
321 | - | local IStNLine = readIStNfile.readLine() |
321 | + | |
322 | - | --local CELLSLine = readCELLSfile.readLine() |
322 | + | |
323 | o=1 | |
324 | - | table.insert(fileDataISN,ISNLine) |
324 | + | |
325 | - | ISNLine = readISNfile.readLine() |
325 | + | |
326 | - | until ISNLine == nil |
326 | + | |
327 | function calcEnergyB() | |
328 | - | table.insert(fileDataIStN,IStNLine) |
328 | + | ceo = 0 |
329 | - | IStNLine = readIStNfile.readLine() |
329 | + | |
330 | - | until IStNLine == nil |
330 | + | |
331 | - | --repeat |
331 | + | |
332 | - | --table.insert(fileDataCELLS,CELLSLine) |
332 | + | |
333 | - | --CELLSLine = readCELLSfile.readLine() |
333 | + | local ISNLine = readISNfile.readLine() |
334 | - | --until CELLSLine == nil |
334 | + | |
335 | - | --cells = textutils.unserialize(fileDataCELLS.readAll()) |
335 | + | |
336 | - | for i=1,(tonumber(fileDataISN[1])+0) do |
336 | + | |
337 | - | local eo = 0 |
337 | + | |
338 | - | cells = {} |
338 | + | |
339 | - | cells[i] = peripheral.wrap(tostring(cname..(fileDataIStN[1]+0))) |
339 | + | |
340 | - | eo = cells[i].getEnergyStored("unknown") |
340 | + | |
341 | - | ceo = ceo+eo |
341 | + | |
342 | - | end |
342 | + | |
343 | - | readISNfile.close() |
343 | + | |
344 | - | readIStNfile.close() |
344 | + | local eo = 0 |
345 | - | --readCELLSfile.close() |
345 | + | |
346 | cells[i] = peripheral.wrap(tostring(cname..(fileDataIStN[1]+0))) | |
347 | eo = cells[i].getEnergyStored("unknown") | |
348 | ceo = ceo+eo | |
349 | end | |
350 | readISNfile.close() | |
351 | readIStNfile.close() | |
352 | end | |
353 | ||
354 | - | initNumArray() |
354 | + | |
355 | local readTINNfile = fs.open("timeINNum","r") | |
356 | local fileDataTINN={} | |
357 | local TINNLine = readTINNfile.readLine() | |
358 | repeat | |
359 | table.insert(fileDataTINN,TINNLine) | |
360 | TINNLine = readTINNfile.readLine() | |
361 | until TINNLine == nil | |
362 | local RNid,RNmsg,RNdist = rednet.receive(tonumber((fileDataTINN[1]+0))) | |
363 | readTINNfile.close() | |
364 | local readIUHSLCIDMAINfile = fs.open("inUHSLCidMAINNum","r") | |
365 | local readIUHSLCIDfile = fs.open("inUHSLCidNum","r") | |
366 | local fileDataIUHSLCIDMAIN={} | |
367 | local fileDataIUHSLCID={} | |
368 | local IUHSLCIDMAINLine = readIUHSLCIDMAINfile.readLine() | |
369 | local IUHSLCIDLine = readIUHSLCIDfile.readLine() | |
370 | repeat | |
371 | table.insert(fileDataIUHSLCIDMAIN,IUHSLCIDMAINLine) | |
372 | IUHSLCIDMAINLine = readIUHSLCIDMAINfile.readLine() | |
373 | until IUHSLCIDMAINLine == nil | |
374 | repeat | |
375 | table.insert(fileDataIUHSLCID,IUHSLCIDLine) | |
376 | - | os.sleep(tonumber((fileDataTINN[1]+0))) |
376 | + | IUHSLCIDLine = readIUHSLCIDfile.readLine() |
377 | until IUHSLCIDLine == nil | |
378 | if RNid==tonumber(fileDataIUHSLCIDMAIN[1]) then | |
379 | if RNmsg==onUHSLCmsg then | |
380 | print("UHSLC-Hauptcomputer (#"..RNid..") hat den UHSLC-Modus aktiviert!") | |
381 | UHSLC = true | |
382 | else | |
383 | if RNmsg==offUHSLCmsg then | |
384 | print("UHSLC-Hauptcomputer (#"..RNid..") hat den UHSLC-Modus aktiviert!") | |
385 | UHSLC = false | |
386 | else | |
387 | print("UHSLC-Hauptcomputer (#"..RNid..") schrieb: "..RNmsg) | |
388 | UHSLC = false | |
389 | end | |
390 | end | |
391 | else | |
392 | if RNid==tonumber(fileDataIUHSLCID[1]) then | |
393 | if RNmsg==onUHSLCmsg then | |
394 | print("UHSLC-Controller (#"..RNid..") hat den UHSLC-Modus aktiviert!") | |
395 | UHSLC = true | |
396 | else | |
397 | if RNmsg==offUHSLCmsg then | |
398 | print("UHSLC-Controller (#"..RNid..") hat den UHSLC-Modus deaktiviert!") | |
399 | UHSLC = false | |
400 | else | |
401 | print("UHSLC-Controller (#"..RNid..") schrieb: "..RNmsg) | |
402 | UHSLC = false | |
403 | end | |
404 | end | |
405 | else | |
406 | if RNmsg==onUHSLCmsgBACKDOOR then | |
407 | print("Ein unbekanntes Gerät (#"..RNid..") hat den UHSLC-Modus erfolgreich per Backdoor aktiviert!") | |
408 | UHSLC = true | |
409 | else | |
410 | if RNmsg==offUHSLCmsgBACKDOOR then | |
411 | print("Ein unbekanntes Gerät (#"..RNid..") hat den UHSLC-Modus erfolgreich per Backdoor deaktiviert!") | |
412 | UHSLC = false | |
413 | else | |
414 | if RNmsg=="update" then | |
415 | UHSLC = false | |
416 | else | |
417 | --print("(#"..RNid..") schrieb: "..RNmsg) | |
418 | UHSLC = false | |
419 | end | |
420 | end | |
421 | end | |
422 | end | |
423 | end | |
424 | end | |
425 | ||
426 | function monitorUpdater() | |
427 | if UHSLC then | |
428 | --mon.clear() | |
429 | mon.setBackgroundColor(colors.red) | |
430 | mon.setTextColor(colors.blue) | |
431 | for i=1,30 do | |
432 | mon.setCursorPos(1,i+1) | |
433 | mon.write(sm) | |
434 | end | |
435 | mon.setCursorPos(1,1) | |
436 | mon.write(" ENERGIE-MONITOR"..sm) | |
437 | mon.setCursorPos(12,12) | |
438 | mon.write("UHSLC") | |
439 | mon.setCursorPos(1,1) | |
440 | else | |
441 | --mon.clear() | |
442 | mon.setBackgroundColor(colors.lime) | |
443 | mon.setTextColor(colors.blue) | |
444 | for i=1,30 do | |
445 | mon.setCursorPos(1,i+1) | |
446 | mon.write(sm) | |
447 | end | |
448 | mon.setCursorPos(1,1) | |
449 | mon.write(" ENERGIE-MONITOR"..sm) | |
450 | end | |
451 | end | |
452 | ||
453 | while true do | |
454 | if k==0 then | |
455 | configComputer() | |
456 | configMonitor() | |
457 | configUHSLC() | |
458 | configCells() | |
459 | k=1 | |
460 | end | |
461 | if q==0 then | |
462 | setupMonitor() | |
463 | q=1 | |
464 | end | |
465 | calcEnergyA() | |
466 | readEnergy() | |
467 | writeEnergy() | |
468 | calcEnergyB() | |
469 | rednetListener() | |
470 | monitorUpdater() | |
471 | --local readTINNfile = fs.open("timeINNum","r") | |
472 | --local fileDataTINN={} | |
473 | --local TINNLine = readTINNfile.readLine() | |
474 | --repeat | |
475 | --table.insert(fileDataTINN,TINNLine) | |
476 | --TINNLine = readTINNfile.readLine() | |
477 | --until TINNLine == nil | |
478 | --os.sleep(tonumber((fileDataTINN[1]+0))) | |
479 | --readTINNfile.close() | |
480 | end |