· 4 years ago · Jul 29, 2021, 11:12 PM
1inputTable = {
2 [ "boot_log.txt" ] = "\
3---------------New Boot----------------\
4Starting...\
5\
6Clearing temporary directory\
7Setting up FS API\
8Opening file - Real file path is: /System/APIs/screenworks\
9Opening file - Real file path is: /System/APIs/images\
10Opening file - Real file path is: /System/APIs/advanced_read\
11Setting up OS API\
12Setting up Environment\
13Trying to run System UI\
14Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
15Trying to create background task for \"system\"\
16Opening file - Real file path is: /System/Scripts/update_checker.lua\
17[system] - Creating background task with access level: 1\
18Error in app System UI: Start.x:19: bad argument #1 to 'create' (expected table, got nil)\
19System UI had been terminated\
20Trying to run app \"Launcher\"\
21[Launcher] - Access level: 1\
22[bg:UpdateService] - Running\
23[bg:UpdateService] - Downloading last verion info\
24[Launcher] - Trying to execute main file\
25Trying to get access to the file system, access level: 1\
26Opening file - Real file path is: /System/Apps/Launcher/Start.x\
27[Launcher] - Running\
28Trying to get access to the file system, access level: 1\
29Opening file - Real file path is: System/Apps/Launcher/App.info\
30[Launcher] - Success\
31[bg:UpdateService] - Checking updates\
32[bg:UpdateService] - No updates available\
33\
34---------------New Boot----------------\
35Starting...\
36\
37Clearing temporary directory\
38Setting up FS API\
39Opening file - Real file path is: /System/APIs/screenworks\
40Opening file - Real file path is: /System/APIs/images\
41Opening file - Real file path is: /System/APIs/advanced_read\
42Setting up OS API\
43Setting up Environment\
44Trying to run System UI\
45Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
46Trying to create background task for \"system\"\
47Opening file - Real file path is: /System/Scripts/update_checker.lua\
48[system] - Creating background task with access level: 1\
49Trying to run app \"Launcher\"\
50[Launcher] - Access level: 1\
51[bg:UpdateService] - Running\
52[bg:UpdateService] - Downloading last verion info\
53[SystemUI] - Started\
54[Launcher] - Trying to execute main file\
55Trying to get access to the file system, access level: 1\
56Opening file - Real file path is: /System/Apps/Launcher/Start.x\
57[Launcher] - Running\
58Trying to get access to the file system, access level: 1\
59Opening file - Real file path is: System/Apps/Launcher/App.info\
60[Launcher] - Success\
61[bg:UpdateService] - Checking updates\
62[bg:UpdateService] - No updates available\
63\
64---------------New Boot----------------\
65Starting...\
66\
67Clearing temporary directory\
68Setting up FS API\
69Opening file - Real file path is: /System/APIs/screenworks\
70Opening file - Real file path is: /System/APIs/images\
71Opening file - Real file path is: /System/APIs/advanced_read\
72Setting up OS API\
73Setting up Environment\
74Trying to run System UI\
75Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
76Trying to create background task for \"system\"\
77Opening file - Real file path is: /System/Scripts/update_checker.lua\
78[system] - Creating background task with access level: 1\
79Error in app System UI: Start.x:4: bad argument #1 to 'redirect' (expected table, got nil)\
80System UI had been terminated\
81Trying to run app \"Launcher\"\
82[Launcher] - Access level: 1\
83[bg:UpdateService] - Running\
84[bg:UpdateService] - Downloading last verion info\
85[Launcher] - Trying to execute main file\
86Trying to get access to the file system, access level: 1\
87Opening file - Real file path is: /System/Apps/Launcher/Start.x\
88[Launcher] - Running\
89Trying to get access to the file system, access level: 1\
90Opening file - Real file path is: System/Apps/Launcher/App.info\
91[Launcher] - Success\
92[bg:UpdateService] - Checking updates\
93[bg:UpdateService] - No updates available\
94\
95---------------New Boot----------------\
96Starting...\
97\
98Clearing temporary directory\
99Setting up FS API\
100Opening file - Real file path is: /System/APIs/screenworks\
101Opening file - Real file path is: /System/APIs/images\
102Opening file - Real file path is: /System/APIs/advanced_read\
103Setting up OS API\
104Setting up Environment\
105Trying to run System UI\
106Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
107Trying to create background task for \"system\"\
108Opening file - Real file path is: /System/Scripts/update_checker.lua\
109[system] - Creating background task with access level: 1\
110Trying to run app \"Launcher\"\
111[Launcher] - Access level: 1\
112[bg:UpdateService] - Running\
113[bg:UpdateService] - Downloading last verion info\
114[SystemUI] - Started\
115[Launcher] - Trying to execute main file\
116Trying to get access to the file system, access level: 1\
117Opening file - Real file path is: /System/Apps/Launcher/Start.x\
118[Launcher] - Running\
119Trying to get access to the file system, access level: 1\
120Opening file - Real file path is: System/Apps/Launcher/App.info\
121[Launcher] - Success\
122[bg:UpdateService] - Checking updates\
123[bg:UpdateService] - No updates available\
124\
125---------------New Boot----------------\
126Starting...\
127\
128Clearing temporary directory\
129Setting up FS API\
130Opening file - Real file path is: /System/APIs/screenworks\
131Opening file - Real file path is: /System/APIs/images\
132Opening file - Real file path is: /System/APIs/advanced_read\
133Setting up OS API\
134Setting up Environment\
135Trying to run System UI\
136Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
137Trying to create background task for \"system\"\
138Opening file - Real file path is: /System/Scripts/update_checker.lua\
139[system] - Creating background task with access level: 1\
140Trying to run app \"Launcher\"\
141[Launcher] - Access level: 1\
142[bg:UpdateService] - Running\
143[bg:UpdateService] - Downloading last verion info\
144[SystemUI] - Started\
145[Launcher] - Trying to execute main file\
146Trying to get access to the file system, access level: 1\
147Opening file - Real file path is: /System/Apps/Launcher/Start.x\
148[Launcher] - Running\
149Trying to get access to the file system, access level: 1\
150Opening file - Real file path is: System/Apps/Launcher/App.info\
151[Launcher] - Success\
152[bg:UpdateService] - Checking updates\
153[bg:UpdateService] - No updates available\
154\
155---------------New Boot----------------\
156Starting...\
157\
158Clearing temporary directory\
159Setting up FS API\
160Opening file - Real file path is: /System/APIs/screenworks\
161Opening file - Real file path is: /System/APIs/images\
162Opening file - Real file path is: /System/APIs/advanced_read\
163Setting up OS API\
164Setting up Environment\
165Trying to run System UI\
166Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
167Trying to create background task for \"system\"\
168Opening file - Real file path is: /System/Scripts/update_checker.lua\
169[system] - Creating background task with access level: 1\
170Trying to run app \"Launcher\"\
171[Launcher] - Access level: 1\
172[bg:UpdateService] - Running\
173[bg:UpdateService] - Downloading last verion info\
174[SystemUI] - Started\
175[Launcher] - Trying to execute main file\
176Trying to get access to the file system, access level: 1\
177Opening file - Real file path is: /System/Apps/Launcher/Start.x\
178[Launcher] - Running\
179Trying to get access to the file system, access level: 1\
180Opening file - Real file path is: System/Apps/Launcher/App.info\
181[Launcher] - Success\
182[bg:UpdateService] - Checking updates\
183[bg:UpdateService] - No updates available\
184[SystemUI] - Trying to open Recent apps\
185Trying to change app to \"Launcher\"\
186[SystemUI] - Trying to open Recent apps\
187Trying to change app to \"Launcher\"\
188Trying to run app \"Logger\"\
189[Logger] - Access level: 1\
190[Logger] - Trying to execute main file\
191Trying to get access to the file system, access level: 1\
192Opening file - Real file path is: /System/Apps/Logger/Start.x\
193Trying to get access to the file system, access level: 1\
194Opening file - Real file path is: System/APIs/screenworks\
195Trying to create background task for \"Logger\"\
196[Logger] - Creating background task with access level: 1\
197[Logger] - Success\
198Trying to change app to \"Launcher\"\
199Trying to run app \"Logger\"\
200App \"Logger\" already running\
201Trying to change app to \"Logger\"\
202Trying to change app to \"Launcher\"\
203Trying to run app \"Logger\"\
204App \"Logger\" already running\
205Trying to change app to \"Logger\"\
206\
207---------------New Boot----------------\
208Starting...\
209\
210Clearing temporary directory\
211Setting up FS API\
212Opening file - Real file path is: /System/APIs/screenworks\
213Opening file - Real file path is: /System/APIs/images\
214Opening file - Real file path is: /System/APIs/advanced_read\
215Setting up OS API\
216Setting up Environment\
217Trying to run System UI\
218Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
219Trying to create background task for \"system\"\
220Opening file - Real file path is: /System/Scripts/update_checker.lua\
221[system] - Creating background task with access level: 1\
222Trying to run app \"Launcher\"\
223[Launcher] - Access level: 1\
224[bg:UpdateService] - Running\
225[bg:UpdateService] - Downloading last verion info\
226[SystemUI] - Started\
227[Launcher] - Trying to execute main file\
228Trying to get access to the file system, access level: 1\
229Opening file - Real file path is: /System/Apps/Launcher/Start.x\
230[Launcher] - Running\
231Trying to get access to the file system, access level: 1\
232Opening file - Real file path is: System/Apps/Launcher/App.info\
233[Launcher] - Success\
234[bg:UpdateService] - Checking updates\
235[bg:UpdateService] - No updates available\
236[SystemUI] - Trying to open Recent apps\
237Trying to change app to \"Launcher\"\
238Trying to run app \"Logger\"\
239[Logger] - Access level: 1\
240[Logger] - Trying to execute main file\
241Trying to get access to the file system, access level: 1\
242Opening file - Real file path is: /System/Apps/Logger/Start.x\
243Trying to get access to the file system, access level: 1\
244Opening file - Real file path is: System/APIs/screenworks\
245Trying to create background task for \"Logger\"\
246[Logger] - Creating background task with access level: 1\
247[Logger] - Success\
248[SystemUI] - Trying to open Recent apps\
249Trying to close app \"Logger\"\
250[bg:Logger#1] - Terminated\
251App \"Logger\" closed\
252[SystemUI] - Open Launcher\
253Trying to change app to \"Launcher\"\
254\
255---------------New Boot----------------\
256Starting...\
257\
258Clearing temporary directory\
259Setting up FS API\
260Opening file - Real file path is: /System/APIs/screenworks\
261Opening file - Real file path is: /System/APIs/images\
262Opening file - Real file path is: /System/APIs/advanced_read\
263Setting up OS API\
264Setting up Environment\
265Trying to run System UI\
266Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
267Trying to create background task for \"system\"\
268Opening file - Real file path is: /System/Scripts/update_checker.lua\
269[system] - Creating background task with access level: 1\
270Trying to run app \"Launcher\"\
271[Launcher] - Access level: 1\
272[bg:UpdateService] - Running\
273[bg:UpdateService] - Downloading last verion info\
274[SystemUI] - Started\
275[Launcher] - Trying to execute main file\
276Trying to get access to the file system, access level: 1\
277Opening file - Real file path is: /System/Apps/Launcher/Start.x\
278[Launcher] - Running\
279Trying to get access to the file system, access level: 1\
280Opening file - Real file path is: System/Apps/Launcher/App.info\
281[Launcher] - Success\
282[bg:UpdateService] - Checking updates\
283[bg:UpdateService] - No updates available\
284[SystemUI] - Clearing notifications\
285Trying to run app \"Logger\"\
286[Logger] - Access level: 1\
287[Logger] - Trying to execute main file\
288Trying to get access to the file system, access level: 1\
289Opening file - Real file path is: /System/Apps/Logger/Start.x\
290Trying to get access to the file system, access level: 1\
291Opening file - Real file path is: System/APIs/screenworks\
292Trying to create background task for \"Logger\"\
293[Logger] - Creating background task with access level: 1\
294[Logger] - Success\
295[SystemUI] - Trying to open Recent apps\
296Trying to change app to \"Logger\"\
297[SystemUI] - Trying to open Recent apps\
298Trying to change app to \"Logger\"\
299[SystemUI] - Trying to open Recent apps\
300Trying to change app to \"Logger\"\
301[SystemUI] - Trying to open Recent apps\
302Trying to change app to \"Launcher\"\
303[SystemUI] - Trying to open Recent apps\
304Trying to change app to \"Launcher\"\
305[SystemUI] - Trying to open Recent apps\
306Trying to change app to \"Launcher\"\
307[SystemUI] - Trying to open Recent apps\
308Trying to close app \"Logger\"\
309[bg:Logger#1] - Terminated\
310App \"Logger\" closed\
311[SystemUI] - Open Launcher\
312Trying to change app to \"Launcher\"\
313Trying to run app \"Logger\"\
314[Logger] - Access level: 1\
315[Logger] - Trying to execute main file\
316Trying to get access to the file system, access level: 1\
317Opening file - Real file path is: /System/Apps/Logger/Start.x\
318Trying to get access to the file system, access level: 1\
319Opening file - Real file path is: System/APIs/screenworks\
320Trying to create background task for \"Logger\"\
321[Logger] - Creating background task with access level: 1\
322[Logger] - Success\
323Trying to change app to \"Launcher\"\
324Trying to run app \"Logger\"\
325App \"Logger\" already running\
326Trying to change app to \"Logger\"\
327Trying to change app to \"Launcher\"\
328Trying to run app \"Logger\"\
329App \"Logger\" already running\
330Trying to change app to \"Logger\"\
331\
332---------------New Boot----------------\
333Starting...\
334\
335Clearing temporary directory\
336Setting up FS API\
337Opening file - Real file path is: /System/APIs/screenworks\
338Opening file - Real file path is: /System/APIs/images\
339Opening file - Real file path is: /System/APIs/advanced_read\
340Setting up OS API\
341Setting up Environment\
342Trying to run System UI\
343Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
344Trying to create background task for \"system\"\
345Opening file - Real file path is: /System/Scripts/update_checker.lua\
346[system] - Creating background task with access level: 1\
347Trying to run app \"Launcher\"\
348[Launcher] - Access level: 1\
349[bg:UpdateService] - Running\
350[bg:UpdateService] - Downloading last verion info\
351[SystemUI] - Started\
352[Launcher] - Trying to execute main file\
353Trying to get access to the file system, access level: 1\
354Opening file - Real file path is: /System/Apps/Launcher/Start.x\
355[Launcher] - Running\
356Trying to get access to the file system, access level: 1\
357Opening file - Real file path is: System/Apps/Launcher/App.info\
358[Launcher] - Success\
359[bg:UpdateService] - Checking updates\
360[bg:UpdateService] - No updates available\
361[bg:UpdateService] - Downloading last verion info\
362[bg:UpdateService] - Checking updates\
363[bg:UpdateService] - No updates available\
364[SystemUI] - Trying to open Recent apps\
365Trying to change app to \"Launcher\"\
366Trying to run app \"Logger\"\
367[Logger] - Access level: 1\
368[Logger] - Trying to execute main file\
369Trying to get access to the file system, access level: 1\
370Opening file - Real file path is: /System/Apps/Logger/Start.x\
371Trying to get access to the file system, access level: 1\
372Opening file - Real file path is: System/APIs/screenworks\
373Trying to create background task for \"Logger\"\
374[Logger] - Creating background task with access level: 1\
375[Logger] - Success\
376\
377---------------New Boot----------------\
378Starting...\
379\
380Clearing temporary directory\
381Setting up FS API\
382Opening file - Real file path is: /System/APIs/screenworks\
383Opening file - Real file path is: /System/APIs/images\
384Opening file - Real file path is: /System/APIs/advanced_read\
385Setting up OS API\
386Setting up Environment\
387Trying to run System UI\
388Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
389Trying to create background task for \"system\"\
390Opening file - Real file path is: /System/Scripts/update_checker.lua\
391[system] - Creating background task with access level: 1\
392Trying to run app \"Launcher\"\
393[Launcher] - Access level: 1\
394[bg:UpdateService] - Running\
395[bg:UpdateService] - Downloading last verion info\
396[SystemUI] - Started\
397[Launcher] - Trying to execute main file\
398Trying to get access to the file system, access level: 1\
399Opening file - Real file path is: /System/Apps/Launcher/Start.x\
400[Launcher] - Running\
401Trying to get access to the file system, access level: 1\
402Opening file - Real file path is: System/Apps/Launcher/App.info\
403[Launcher] - Success\
404[bg:UpdateService] - Checking updates\
405[bg:UpdateService] - No updates available\
406\
407---------------New Boot----------------\
408Starting...\
409\
410Clearing temporary directory\
411Setting up FS API\
412Opening file - Real file path is: /System/APIs/screenworks\
413Opening file - Real file path is: /System/APIs/images\
414Opening file - Real file path is: /System/APIs/advanced_read\
415Setting up OS API\
416Setting up Environment\
417Trying to run System UI\
418Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
419Trying to create background task for \"system\"\
420Opening file - Real file path is: /System/Scripts/update_checker.lua\
421[system] - Creating background task with access level: 1\
422Trying to run app \"Launcher\"\
423[Launcher] - Access level: 1\
424[bg:UpdateService] - Running\
425[bg:UpdateService] - Downloading last verion info\
426[SystemUI] - Started\
427[Launcher] - Trying to execute main file\
428Trying to get access to the file system, access level: 1\
429Opening file - Real file path is: /System/Apps/Launcher/Start.x\
430[Launcher] - Running\
431Trying to get access to the file system, access level: 1\
432Opening file - Real file path is: System/Apps/Launcher/App.info\
433[Launcher] - Success\
434[bg:UpdateService] - Checking updates\
435[bg:UpdateService] - No updates available\
436[SystemUI] - Trying to open Recent apps\
437Trying to change app to \"Launcher\"\
438\
439---------------New Boot----------------\
440Starting...\
441\
442Clearing temporary directory\
443Setting up FS API\
444Opening file - Real file path is: /System/APIs/screenworks\
445Opening file - Real file path is: /System/APIs/images\
446Opening file - Real file path is: /System/APIs/advanced_read\
447Setting up OS API\
448Setting up Environment\
449Trying to run System UI\
450Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
451Trying to create background task for \"system\"\
452Opening file - Real file path is: /System/Scripts/update_checker.lua\
453[system] - Creating background task with access level: 1\
454Trying to run app \"Launcher\"\
455[Launcher] - Access level: 1\
456[bg:UpdateService] - Running\
457[bg:UpdateService] - Downloading last verion info\
458[SystemUI] - Started\
459[Launcher] - Trying to execute main file\
460Trying to get access to the file system, access level: 1\
461Opening file - Real file path is: /System/Apps/Launcher/Start.x\
462[Launcher] - Running\
463Trying to get access to the file system, access level: 1\
464Opening file - Real file path is: System/Apps/Launcher/App.info\
465[Launcher] - Success\
466[bg:UpdateService] - Checking updates\
467[bg:UpdateService] - No updates available\
468\
469---------------New Boot----------------\
470Starting...\
471\
472Clearing temporary directory\
473Setting up FS API\
474Opening file - Real file path is: /System/APIs/screenworks\
475Opening file - Real file path is: /System/APIs/images\
476Opening file - Real file path is: /System/APIs/advanced_read\
477Setting up OS API\
478Setting up Environment\
479Trying to run System UI\
480Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
481Trying to create background task for \"system\"\
482Opening file - Real file path is: /System/Scripts/update_checker.lua\
483[system] - Creating background task with access level: 1\
484Trying to run app \"Launcher\"\
485[Launcher] - Access level: 1\
486[bg:UpdateService] - Running\
487[bg:UpdateService] - Downloading last verion info\
488[SystemUI] - Started\
489[Launcher] - Trying to execute main file\
490Trying to get access to the file system, access level: 1\
491Opening file - Real file path is: /System/Apps/Launcher/Start.x\
492[Launcher] - Running\
493Trying to get access to the file system, access level: 1\
494Opening file - Real file path is: System/Apps/Launcher/App.info\
495[Launcher] - Success\
496[bg:UpdateService] - Checking updates\
497[bg:UpdateService] - No updates available\
498[SystemUI] - Trying to open Recent apps\
499\
500---------------New Boot----------------\
501Starting...\
502\
503Clearing temporary directory\
504Setting up FS API\
505Opening file - Real file path is: /System/APIs/screenworks\
506Opening file - Real file path is: /System/APIs/images\
507Opening file - Real file path is: /System/APIs/advanced_read\
508Setting up OS API\
509Setting up Environment\
510Trying to run System UI\
511Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
512Trying to create background task for \"system\"\
513Opening file - Real file path is: /System/Scripts/update_checker.lua\
514[system] - Creating background task with access level: 1\
515Trying to run app \"Launcher\"\
516[Launcher] - Access level: 1\
517[bg:UpdateService] - Running\
518[bg:UpdateService] - Downloading last verion info\
519[SystemUI] - Started\
520[Launcher] - Trying to execute main file\
521Trying to get access to the file system, access level: 1\
522Opening file - Real file path is: /System/Apps/Launcher/Start.x\
523[Launcher] - Running\
524Trying to get access to the file system, access level: 1\
525Opening file - Real file path is: System/Apps/Launcher/App.info\
526[Launcher] - Success\
527[bg:UpdateService] - Checking updates\
528[bg:UpdateService] - No updates available\
529[SystemUI] - Trying to open Recent apps\
530Trying to change app to \"Launcher\"\
531[SystemUI] - Trying to open Recent apps\
532Trying to change app to \"Launcher\"\
533[SystemUI] - Trying to open Recent apps\
534Trying to change app to \"Launcher\"\
535[SystemUI] - Trying to open Recent apps\
536Trying to change app to \"Launcher\"\
537\
538---------------New Boot----------------\
539Starting...\
540\
541Clearing temporary directory\
542Setting up FS API\
543Opening file - Real file path is: /System/APIs/screenworks\
544Opening file - Real file path is: /System/APIs/images\
545Opening file - Real file path is: /System/APIs/advanced_read\
546Setting up OS API\
547Setting up Environment\
548Trying to run System UI\
549Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
550Trying to create background task for \"system\"\
551Opening file - Real file path is: /System/Scripts/update_checker.lua\
552[system] - Creating background task with access level: 1\
553Trying to run app \"Launcher\"\
554[Launcher] - Access level: 1\
555[bg:UpdateService] - Running\
556[bg:UpdateService] - Downloading last verion info\
557[SystemUI] - Started\
558[Launcher] - Trying to execute main file\
559Trying to get access to the file system, access level: 1\
560Opening file - Real file path is: /System/Apps/Launcher/Start.x\
561[Launcher] - Running\
562Trying to get access to the file system, access level: 1\
563Opening file - Real file path is: System/Apps/Launcher/App.info\
564[Launcher] - Success\
565[bg:UpdateService] - Checking updates\
566[bg:UpdateService] - No updates available\
567[SystemUI] - Trying to open Recent apps\
568Trying to change app to \"Launcher\"\
569[SystemUI] - Trying to open Recent apps\
570Trying to change app to \"Launcher\"\
571[SystemUI] - Trying to open Recent apps\
572Trying to change app to \"Launcher\"\
573\
574---------------New Boot----------------\
575Starting...\
576\
577Clearing temporary directory\
578Setting up FS API\
579Opening file - Real file path is: /System/APIs/screenworks\
580Opening file - Real file path is: /System/APIs/images\
581Opening file - Real file path is: /System/APIs/advanced_read\
582Setting up OS API\
583Setting up Environment\
584Trying to run System UI\
585Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
586Trying to create background task for \"system\"\
587Opening file - Real file path is: /System/Scripts/update_checker.lua\
588[system] - Creating background task with access level: 1\
589Error in app System UI: Start.x:4: bad argument #1 to 'redirect' (expected table, got string)\
590System UI had been terminated\
591Trying to run app \"Launcher\"\
592[Launcher] - Access level: 1\
593[bg:UpdateService] - Running\
594[bg:UpdateService] - Downloading last verion info\
595[Launcher] - Trying to execute main file\
596Trying to get access to the file system, access level: 1\
597Opening file - Real file path is: /System/Apps/Launcher/Start.x\
598[Launcher] - Running\
599Trying to get access to the file system, access level: 1\
600Opening file - Real file path is: System/Apps/Launcher/App.info\
601[Launcher] - Success\
602[bg:UpdateService] - Checking updates\
603[bg:UpdateService] - No updates available\
604\
605---------------New Boot----------------\
606Starting...\
607\
608Clearing temporary directory\
609Setting up FS API\
610Opening file - Real file path is: /System/APIs/screenworks\
611Opening file - Real file path is: /System/APIs/images\
612Opening file - Real file path is: /System/APIs/advanced_read\
613Setting up OS API\
614Setting up Environment\
615Trying to run System UI\
616Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
617Trying to create background task for \"system\"\
618Opening file - Real file path is: /System/Scripts/update_checker.lua\
619[system] - Creating background task with access level: 1\
620Trying to run app \"Launcher\"\
621[Launcher] - Access level: 1\
622[bg:UpdateService] - Running\
623[bg:UpdateService] - Downloading last verion info\
624[SystemUI] - Started\
625[Launcher] - Trying to execute main file\
626Trying to get access to the file system, access level: 1\
627Opening file - Real file path is: /System/Apps/Launcher/Start.x\
628[Launcher] - Running\
629Trying to get access to the file system, access level: 1\
630Opening file - Real file path is: System/Apps/Launcher/App.info\
631[Launcher] - Success\
632[bg:UpdateService] - Checking updates\
633[bg:UpdateService] - No updates available\
634\
635---------------New Boot----------------\
636Starting...\
637\
638Clearing temporary directory\
639Setting up FS API\
640Opening file - Real file path is: /System/APIs/screenworks\
641Opening file - Real file path is: /System/APIs/images\
642Opening file - Real file path is: /System/APIs/advanced_read\
643Setting up OS API\
644Setting up Environment\
645Trying to run System UI\
646Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
647Trying to create background task for \"system\"\
648Opening file - Real file path is: /System/Scripts/update_checker.lua\
649[system] - Creating background task with access level: 1\
650Error in app System UI: Start.x:4: bad argument #1 to 'redirect' (expected table, got string)\
651System UI had been terminated\
652Trying to run app \"Launcher\"\
653[Launcher] - Access level: 1\
654[bg:UpdateService] - Running\
655[bg:UpdateService] - Downloading last verion info\
656[Launcher] - Trying to execute main file\
657Trying to get access to the file system, access level: 1\
658Opening file - Real file path is: /System/Apps/Launcher/Start.x\
659[Launcher] - Running\
660Trying to get access to the file system, access level: 1\
661Opening file - Real file path is: System/Apps/Launcher/App.info\
662[Launcher] - Success\
663[bg:UpdateService] - Checking updates\
664[bg:UpdateService] - No updates available\
665\
666---------------New Boot----------------\
667Starting...\
668\
669Clearing temporary directory\
670Setting up FS API\
671Opening file - Real file path is: /System/APIs/screenworks\
672Opening file - Real file path is: /System/APIs/images\
673Opening file - Real file path is: /System/APIs/advanced_read\
674Setting up OS API\
675Setting up Environment\
676Trying to run System UI\
677Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
678Trying to create background task for \"system\"\
679Opening file - Real file path is: /System/Scripts/update_checker.lua\
680[system] - Creating background task with access level: 1\
681Error in app System UI: Start.x:4: bad argument #1 to 'redirect' (expected table, got string)\
682System UI had been terminated\
683Trying to run app \"Launcher\"\
684[Launcher] - Access level: 1\
685[bg:UpdateService] - Running\
686[bg:UpdateService] - Downloading last verion info\
687[Launcher] - Trying to execute main file\
688Trying to get access to the file system, access level: 1\
689Opening file - Real file path is: /System/Apps/Launcher/Start.x\
690[Launcher] - Running\
691Trying to get access to the file system, access level: 1\
692Opening file - Real file path is: System/Apps/Launcher/App.info\
693[Launcher] - Success\
694[bg:UpdateService] - Checking updates\
695[bg:UpdateService] - No updates available\
696\
697---------------New Boot----------------\
698Starting...\
699\
700Clearing temporary directory\
701Setting up FS API\
702Opening file - Real file path is: /System/APIs/screenworks\
703Opening file - Real file path is: /System/APIs/images\
704Opening file - Real file path is: /System/APIs/advanced_read\
705Setting up OS API\
706Setting up Environment\
707Trying to run System UI\
708Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
709Trying to create background task for \"system\"\
710Opening file - Real file path is: /System/Scripts/update_checker.lua\
711[system] - Creating background task with access level: 1\
712Trying to run app \"Launcher\"\
713[Launcher] - Access level: 1\
714[bg:UpdateService] - Running\
715[bg:UpdateService] - Downloading last verion info\
716[SystemUI] - Started\
717[Launcher] - Trying to execute main file\
718Trying to get access to the file system, access level: 1\
719Opening file - Real file path is: /System/Apps/Launcher/Start.x\
720[Launcher] - Running\
721Trying to get access to the file system, access level: 1\
722Opening file - Real file path is: System/Apps/Launcher/App.info\
723[Launcher] - Success\
724[bg:UpdateService] - Checking updates\
725[bg:UpdateService] - No updates available\
726[SystemUI] - Trying to open Recent apps\
727Trying to change app to \"Launcher\"\
728[SystemUI] - Trying to open Recent apps\
729Trying to change app to \"Launcher\"\
730[SystemUI] - Trying to open Recent apps\
731Trying to change app to \"Launcher\"\
732\
733---------------New Boot----------------\
734Starting...\
735\
736Clearing temporary directory\
737Setting up FS API\
738Opening file - Real file path is: /System/APIs/screenworks\
739Opening file - Real file path is: /System/APIs/images\
740Opening file - Real file path is: /System/APIs/advanced_read\
741Setting up OS API\
742Setting up Environment\
743Trying to run System UI\
744Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
745Trying to create background task for \"system\"\
746Opening file - Real file path is: /System/Scripts/update_checker.lua\
747[system] - Creating background task with access level: 1\
748Error in app System UI: Start.x:18: attempt to call field 'current' (a nil value)\
749System UI had been terminated\
750Trying to run app \"Launcher\"\
751[Launcher] - Access level: 1\
752[bg:UpdateService] - Running\
753[bg:UpdateService] - Downloading last verion info\
754[Launcher] - Trying to execute main file\
755Trying to get access to the file system, access level: 1\
756Opening file - Real file path is: /System/Apps/Launcher/Start.x\
757[Launcher] - Running\
758Trying to get access to the file system, access level: 1\
759Opening file - Real file path is: System/Apps/Launcher/App.info\
760[Launcher] - Success\
761[bg:UpdateService] - Checking updates\
762[bg:UpdateService] - No updates available\
763\
764---------------New Boot----------------\
765Starting...\
766\
767Clearing temporary directory\
768Setting up FS API\
769Opening file - Real file path is: /System/APIs/screenworks\
770Opening file - Real file path is: /System/APIs/images\
771Opening file - Real file path is: /System/APIs/advanced_read\
772Setting up OS API\
773Setting up Environment\
774Trying to run System UI\
775Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
776Trying to create background task for \"system\"\
777Opening file - Real file path is: /System/Scripts/update_checker.lua\
778[system] - Creating background task with access level: 1\
779Error in app System UI: Start.x:18: attempt to call field 'current' (a nil value)\
780System UI had been terminated\
781Trying to run app \"Launcher\"\
782[Launcher] - Access level: 1\
783[bg:UpdateService] - Running\
784[bg:UpdateService] - Downloading last verion info\
785[Launcher] - Trying to execute main file\
786Trying to get access to the file system, access level: 1\
787Opening file - Real file path is: /System/Apps/Launcher/Start.x\
788[Launcher] - Running\
789Trying to get access to the file system, access level: 1\
790Opening file - Real file path is: System/Apps/Launcher/App.info\
791[Launcher] - Success\
792[bg:UpdateService] - Checking updates\
793[bg:UpdateService] - No updates available\
794\
795---------------New Boot----------------\
796Starting...\
797\
798Clearing temporary directory\
799Setting up FS API\
800Opening file - Real file path is: /System/APIs/screenworks\
801Opening file - Real file path is: /System/APIs/images\
802Opening file - Real file path is: /System/APIs/advanced_read\
803Setting up OS API\
804Setting up Environment\
805Trying to run System UI\
806Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
807Trying to create background task for \"system\"\
808Opening file - Real file path is: /System/Scripts/update_checker.lua\
809[system] - Creating background task with access level: 1\
810Error in app System UI: Start.x:35: attempt to call field 'native' (a nil value)\
811System UI had been terminated\
812Trying to run app \"Launcher\"\
813[Launcher] - Access level: 1\
814[bg:UpdateService] - Running\
815[bg:UpdateService] - Downloading last verion info\
816[Launcher] - Trying to execute main file\
817Trying to get access to the file system, access level: 1\
818Opening file - Real file path is: /System/Apps/Launcher/Start.x\
819[Launcher] - Running\
820Trying to get access to the file system, access level: 1\
821Opening file - Real file path is: System/Apps/Launcher/App.info\
822[Launcher] - Success\
823[bg:UpdateService] - Checking updates\
824[bg:UpdateService] - No updates available\
825\
826---------------New Boot----------------\
827Starting...\
828\
829Clearing temporary directory\
830Setting up FS API\
831Opening file - Real file path is: /System/APIs/screenworks\
832Opening file - Real file path is: /System/APIs/images\
833Opening file - Real file path is: /System/APIs/advanced_read\
834Setting up OS API\
835Setting up Environment\
836Trying to run System UI\
837Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
838Trying to create background task for \"system\"\
839Opening file - Real file path is: /System/Scripts/update_checker.lua\
840[system] - Creating background task with access level: 1\
841Trying to run app \"Launcher\"\
842[Launcher] - Access level: 1\
843[bg:UpdateService] - Running\
844[bg:UpdateService] - Downloading last verion info\
845[SystemUI] - Started\
846[Launcher] - Trying to execute main file\
847Trying to get access to the file system, access level: 1\
848Opening file - Real file path is: /System/Apps/Launcher/Start.x\
849[Launcher] - Running\
850Trying to get access to the file system, access level: 1\
851Opening file - Real file path is: System/Apps/Launcher/App.info\
852[Launcher] - Success\
853[bg:UpdateService] - Checking updates\
854[bg:UpdateService] - No updates available\
855\
856---------------New Boot----------------\
857Starting...\
858\
859Clearing temporary directory\
860Setting up FS API\
861Opening file - Real file path is: /System/APIs/screenworks\
862Opening file - Real file path is: /System/APIs/images\
863Opening file - Real file path is: /System/APIs/advanced_read\
864Setting up OS API\
865Setting up Environment\
866Trying to run System UI\
867Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
868Trying to create background task for \"system\"\
869Opening file - Real file path is: /System/Scripts/update_checker.lua\
870[system] - Creating background task with access level: 1\
871Error in app System UI: Start.x:18: attempt to call field 'current' (a nil value)\
872System UI had been terminated\
873Trying to run app \"Launcher\"\
874[Launcher] - Access level: 1\
875[bg:UpdateService] - Running\
876[bg:UpdateService] - Downloading last verion info\
877[Launcher] - Trying to execute main file\
878Trying to get access to the file system, access level: 1\
879Opening file - Real file path is: /System/Apps/Launcher/Start.x\
880[Launcher] - Running\
881Trying to get access to the file system, access level: 1\
882Opening file - Real file path is: System/Apps/Launcher/App.info\
883[Launcher] - Success\
884[bg:UpdateService] - Checking updates\
885[bg:UpdateService] - No updates available\
886\
887---------------New Boot----------------\
888Starting...\
889\
890Clearing temporary directory\
891Setting up FS API\
892Opening file - Real file path is: /System/APIs/screenworks\
893Opening file - Real file path is: /System/APIs/images\
894Opening file - Real file path is: /System/APIs/advanced_read\
895Setting up OS API\
896Setting up Environment\
897Trying to run System UI\
898Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
899Trying to create background task for \"system\"\
900Opening file - Real file path is: /System/Scripts/update_checker.lua\
901[system] - Creating background task with access level: 1\
902Trying to run app \"Launcher\"\
903[Launcher] - Access level: 1\
904[bg:UpdateService] - Running\
905[bg:UpdateService] - Downloading last verion info\
906[SystemUI] - Started\
907[Launcher] - Trying to execute main file\
908Trying to get access to the file system, access level: 1\
909Opening file - Real file path is: /System/Apps/Launcher/Start.x\
910[Launcher] - Running\
911Trying to get access to the file system, access level: 1\
912Opening file - Real file path is: System/Apps/Launcher/App.info\
913[Launcher] - Success\
914[bg:UpdateService] - Checking updates\
915[bg:UpdateService] - No updates available\
916\
917---------------New Boot----------------\
918Starting...\
919\
920Clearing temporary directory\
921Setting up FS API\
922Opening file - Real file path is: /System/APIs/screenworks\
923Opening file - Real file path is: /System/APIs/images\
924Opening file - Real file path is: /System/APIs/advanced_read\
925Setting up OS API\
926Setting up Environment\
927Trying to run System UI\
928Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
929Trying to create background task for \"system\"\
930Opening file - Real file path is: /System/Scripts/update_checker.lua\
931[system] - Creating background task with access level: 1\
932Error in app System UI: Start.x:19: attempt to call field 'native' (a nil value)\
933System UI had been terminated\
934Trying to run app \"Launcher\"\
935[Launcher] - Access level: 1\
936[bg:UpdateService] - Running\
937[bg:UpdateService] - Downloading last verion info\
938[Launcher] - Trying to execute main file\
939Trying to get access to the file system, access level: 1\
940Opening file - Real file path is: /System/Apps/Launcher/Start.x\
941[Launcher] - Running\
942Trying to get access to the file system, access level: 1\
943Opening file - Real file path is: System/Apps/Launcher/App.info\
944[Launcher] - Success\
945[bg:UpdateService] - Checking updates\
946[bg:UpdateService] - No updates available\
947\
948---------------New Boot----------------\
949Starting...\
950\
951Clearing temporary directory\
952Setting up FS API\
953Opening file - Real file path is: /System/APIs/screenworks\
954Opening file - Real file path is: /System/APIs/images\
955Opening file - Real file path is: /System/APIs/advanced_read\
956Setting up OS API\
957Setting up Environment\
958Trying to run System UI\
959Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
960Trying to create background task for \"system\"\
961Opening file - Real file path is: /System/Scripts/update_checker.lua\
962[system] - Creating background task with access level: 1\
963Trying to run app \"Launcher\"\
964[Launcher] - Access level: 1\
965[bg:UpdateService] - Running\
966[bg:UpdateService] - Downloading last verion info\
967[SystemUI] - Started\
968[Launcher] - Trying to execute main file\
969Trying to get access to the file system, access level: 1\
970Opening file - Real file path is: /System/Apps/Launcher/Start.x\
971[Launcher] - Running\
972Trying to get access to the file system, access level: 1\
973Opening file - Real file path is: System/Apps/Launcher/App.info\
974[Launcher] - Success\
975[bg:UpdateService] - Checking updates\
976[bg:UpdateService] - No updates available\
977[SystemUI] - Trying to open Recent apps\
978Trying to change app to \"Launcher\"\
979\
980---------------New Boot----------------\
981Starting...\
982\
983Clearing temporary directory\
984Setting up FS API\
985Opening file - Real file path is: /System/APIs/screenworks\
986Opening file - Real file path is: /System/APIs/images\
987Opening file - Real file path is: /System/APIs/advanced_read\
988Setting up OS API\
989Setting up Environment\
990Trying to run System UI\
991Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
992Trying to create background task for \"system\"\
993Opening file - Real file path is: /System/Scripts/update_checker.lua\
994[system] - Creating background task with access level: 1\
995Trying to run app \"Launcher\"\
996[Launcher] - Access level: 1\
997[bg:UpdateService] - Running\
998[bg:UpdateService] - Downloading last verion info\
999[SystemUI] - Started\
1000[Launcher] - Trying to execute main file\
1001Trying to get access to the file system, access level: 1\
1002Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1003[Launcher] - Running\
1004Trying to get access to the file system, access level: 1\
1005Opening file - Real file path is: System/Apps/Launcher/App.info\
1006[Launcher] - Success\
1007[bg:UpdateService] - Checking updates\
1008[bg:UpdateService] - No updates available\
1009[SystemUI] - Clearing notifications\
1010Trying to run app \"Logger\"\
1011[Logger] - Access level: 1\
1012[Logger] - Trying to execute main file\
1013Trying to get access to the file system, access level: 1\
1014Opening file - Real file path is: /System/Apps/Logger/Start.x\
1015Trying to get access to the file system, access level: 1\
1016Opening file - Real file path is: System/APIs/screenworks\
1017Trying to create background task for \"Logger\"\
1018[Logger] - Creating background task with access level: 1\
1019[Logger] - Success\
1020\
1021---------------New Boot----------------\
1022Starting...\
1023\
1024Clearing temporary directory\
1025Setting up FS API\
1026Opening file - Real file path is: /System/APIs/screenworks\
1027Opening file - Real file path is: /System/APIs/images\
1028Opening file - Real file path is: /System/APIs/advanced_read\
1029Setting up OS API\
1030Setting up Environment\
1031Trying to run System UI\
1032Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1033Trying to create background task for \"system\"\
1034Opening file - Real file path is: /System/Scripts/update_checker.lua\
1035[system] - Creating background task with access level: 1\
1036Trying to run app \"Launcher\"\
1037[Launcher] - Access level: 1\
1038[bg:UpdateService] - Running\
1039[bg:UpdateService] - Downloading last verion info\
1040[SystemUI] - Started\
1041[Launcher] - Trying to execute main file\
1042Trying to get access to the file system, access level: 1\
1043Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1044[Launcher] - Running\
1045Trying to get access to the file system, access level: 1\
1046Opening file - Real file path is: System/Apps/Launcher/App.info\
1047[Launcher] - Success\
1048[bg:UpdateService] - Checking updates\
1049[bg:UpdateService] - No updates available\
1050\
1051---------------New Boot----------------\
1052Starting...\
1053\
1054Clearing temporary directory\
1055Setting up FS API\
1056Opening file - Real file path is: /System/APIs/screenworks\
1057Opening file - Real file path is: /System/APIs/images\
1058Opening file - Real file path is: /System/APIs/advanced_read\
1059Setting up OS API\
1060Setting up Environment\
1061Trying to run System UI\
1062Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1063Trying to create background task for \"system\"\
1064Opening file - Real file path is: /System/Scripts/update_checker.lua\
1065[system] - Creating background task with access level: 1\
1066Trying to run app \"Launcher\"\
1067[Launcher] - Access level: 1\
1068[bg:UpdateService] - Running\
1069[bg:UpdateService] - Downloading last verion info\
1070[SystemUI] - Started\
1071[Launcher] - Trying to execute main file\
1072Trying to get access to the file system, access level: 1\
1073Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1074[Launcher] - Running\
1075Trying to get access to the file system, access level: 1\
1076Opening file - Real file path is: System/Apps/Launcher/App.info\
1077[Launcher] - Success\
1078[bg:UpdateService] - Checking updates\
1079[bg:UpdateService] - No updates available\
1080\
1081---------------New Boot----------------\
1082Starting...\
1083\
1084Clearing temporary directory\
1085Setting up FS API\
1086Opening file - Real file path is: /System/APIs/screenworks\
1087Opening file - Real file path is: /System/APIs/images\
1088Opening file - Real file path is: /System/APIs/advanced_read\
1089Setting up OS API\
1090Setting up Environment\
1091Trying to run System UI\
1092Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1093Trying to create background task for \"system\"\
1094Opening file - Real file path is: /System/Scripts/update_checker.lua\
1095[system] - Creating background task with access level: 1\
1096Trying to run app \"Launcher\"\
1097[Launcher] - Access level: 1\
1098[bg:UpdateService] - Running\
1099[bg:UpdateService] - Downloading last verion info\
1100[SystemUI] - Started\
1101[Launcher] - Trying to execute main file\
1102Trying to get access to the file system, access level: 1\
1103Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1104[Launcher] - Running\
1105Trying to get access to the file system, access level: 1\
1106Opening file - Real file path is: System/Apps/Launcher/App.info\
1107[Launcher] - Success\
1108[bg:UpdateService] - Checking updates\
1109[bg:UpdateService] - No updates available\
1110[SystemUI] - Trying to open Recent apps\
1111Trying to change app to \"Launcher\"\
1112\
1113---------------New Boot----------------\
1114Starting...\
1115\
1116Clearing temporary directory\
1117Setting up FS API\
1118Opening file - Real file path is: /System/APIs/screenworks\
1119Opening file - Real file path is: /System/APIs/images\
1120Opening file - Real file path is: /System/APIs/advanced_read\
1121Setting up OS API\
1122Setting up Environment\
1123Trying to run System UI\
1124Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1125Trying to create background task for \"system\"\
1126Opening file - Real file path is: /System/Scripts/update_checker.lua\
1127[system] - Creating background task with access level: 1\
1128Trying to run app \"Launcher\"\
1129[Launcher] - Access level: 1\
1130[bg:UpdateService] - Running\
1131[bg:UpdateService] - Downloading last verion info\
1132[SystemUI] - Started\
1133[Launcher] - Trying to execute main file\
1134Trying to get access to the file system, access level: 1\
1135Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1136[Launcher] - Running\
1137Trying to get access to the file system, access level: 1\
1138Opening file - Real file path is: System/Apps/Launcher/App.info\
1139[Launcher] - Success\
1140[bg:UpdateService] - Checking updates\
1141[bg:UpdateService] - No updates available\
1142\
1143---------------New Boot----------------\
1144Starting...\
1145\
1146Clearing temporary directory\
1147Setting up FS API\
1148Opening file - Real file path is: /System/APIs/screenworks\
1149Opening file - Real file path is: /System/APIs/images\
1150Opening file - Real file path is: /System/APIs/advanced_read\
1151Setting up OS API\
1152Setting up Environment\
1153Trying to run System UI\
1154Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1155Trying to create background task for \"system\"\
1156Opening file - Real file path is: /System/Scripts/update_checker.lua\
1157[system] - Creating background task with access level: 1\
1158Trying to run app \"Launcher\"\
1159[Launcher] - Access level: 1\
1160[bg:UpdateService] - Running\
1161[bg:UpdateService] - Downloading last verion info\
1162[SystemUI] - Started\
1163[Launcher] - Trying to execute main file\
1164Trying to get access to the file system, access level: 1\
1165Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1166[Launcher] - Running\
1167Trying to get access to the file system, access level: 1\
1168Opening file - Real file path is: System/Apps/Launcher/App.info\
1169[Launcher] - Success\
1170[bg:UpdateService] - Checking updates\
1171[bg:UpdateService] - No updates available\
1172[SystemUI] - Trying to open Recent apps\
1173Trying to change app to \"Launcher\"\
1174\
1175---------------New Boot----------------\
1176Starting...\
1177\
1178Clearing temporary directory\
1179Setting up FS API\
1180Opening file - Real file path is: /System/APIs/screenworks\
1181Opening file - Real file path is: /System/APIs/images\
1182Opening file - Real file path is: /System/APIs/advanced_read\
1183Setting up OS API\
1184Setting up Environment\
1185Trying to run System UI\
1186Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1187Trying to create background task for \"system\"\
1188Opening file - Real file path is: /System/Scripts/update_checker.lua\
1189[system] - Creating background task with access level: 1\
1190Trying to run app \"Launcher\"\
1191[Launcher] - Access level: 1\
1192[bg:UpdateService] - Running\
1193[bg:UpdateService] - Downloading last verion info\
1194[SystemUI] - Started\
1195[Launcher] - Trying to execute main file\
1196Trying to get access to the file system, access level: 1\
1197Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1198[Launcher] - Running\
1199Trying to get access to the file system, access level: 1\
1200Opening file - Real file path is: System/Apps/Launcher/App.info\
1201[Launcher] - Success\
1202[bg:UpdateService] - Checking updates\
1203[bg:UpdateService] - No updates available\
1204\
1205---------------New Boot----------------\
1206Starting...\
1207\
1208Clearing temporary directory\
1209Setting up FS API\
1210Opening file - Real file path is: /System/APIs/screenworks\
1211Opening file - Real file path is: /System/APIs/images\
1212Opening file - Real file path is: /System/APIs/advanced_read\
1213Setting up OS API\
1214Setting up Environment\
1215Trying to run System UI\
1216Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1217Trying to create background task for \"system\"\
1218Opening file - Real file path is: /System/Scripts/update_checker.lua\
1219[system] - Creating background task with access level: 1\
1220Trying to run app \"Launcher\"\
1221[Launcher] - Access level: 1\
1222[bg:UpdateService] - Running\
1223[bg:UpdateService] - Downloading last verion info\
1224[SystemUI] - Started\
1225[Launcher] - Trying to execute main file\
1226Trying to get access to the file system, access level: 1\
1227Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1228[Launcher] - Running\
1229Trying to get access to the file system, access level: 1\
1230Opening file - Real file path is: System/Apps/Launcher/App.info\
1231[Launcher] - Success\
1232[bg:UpdateService] - Checking updates\
1233[bg:UpdateService] - No updates available\
1234Trying to run app \"Logger\"\
1235[Logger] - Access level: 1\
1236[Logger] - Trying to execute main file\
1237Trying to get access to the file system, access level: 1\
1238Opening file - Real file path is: /System/Apps/Logger/Start.x\
1239Trying to get access to the file system, access level: 1\
1240Opening file - Real file path is: System/APIs/screenworks\
1241Trying to create background task for \"Logger\"\
1242[Logger] - Creating background task with access level: 1\
1243[Logger] - Success\
1244Trying to change app to \"Launcher\"\
1245[SystemUI] - Trying to open Recent apps\
1246Trying to change app to \"Launcher\"\
1247[SystemUI] - Trying to open Recent apps\
1248Trying to change app to \"Launcher\"\
1249\
1250---------------New Boot----------------\
1251Starting...\
1252\
1253Clearing temporary directory\
1254Setting up FS API\
1255Opening file - Real file path is: /System/APIs/screenworks\
1256Opening file - Real file path is: /System/APIs/images\
1257Opening file - Real file path is: /System/APIs/advanced_read\
1258Setting up OS API\
1259Setting up Environment\
1260Trying to run System UI\
1261Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1262Trying to create background task for \"system\"\
1263Opening file - Real file path is: /System/Scripts/update_checker.lua\
1264[system] - Creating background task with access level: 1\
1265Trying to run app \"Launcher\"\
1266[Launcher] - Access level: 1\
1267[bg:UpdateService] - Running\
1268[bg:UpdateService] - Downloading last verion info\
1269[SystemUI] - Started\
1270[Launcher] - Trying to execute main file\
1271Trying to get access to the file system, access level: 1\
1272Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1273[Launcher] - Running\
1274Trying to get access to the file system, access level: 1\
1275Opening file - Real file path is: System/Apps/Launcher/App.info\
1276[Launcher] - Success\
1277[bg:UpdateService] - Checking updates\
1278[bg:UpdateService] - No updates available\
1279\
1280---------------New Boot----------------\
1281Starting...\
1282\
1283Clearing temporary directory\
1284Setting up FS API\
1285Opening file - Real file path is: /System/APIs/screenworks\
1286Opening file - Real file path is: /System/APIs/images\
1287Opening file - Real file path is: /System/APIs/advanced_read\
1288Setting up OS API\
1289Setting up Environment\
1290Trying to run System UI\
1291Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1292Trying to create background task for \"system\"\
1293Opening file - Real file path is: /System/Scripts/update_checker.lua\
1294[system] - Creating background task with access level: 1\
1295Trying to run app \"Launcher\"\
1296[Launcher] - Access level: 1\
1297[bg:UpdateService] - Running\
1298[bg:UpdateService] - Downloading last verion info\
1299[SystemUI] - Started\
1300[Launcher] - Trying to execute main file\
1301Trying to get access to the file system, access level: 1\
1302Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1303[Launcher] - Running\
1304Trying to get access to the file system, access level: 1\
1305Opening file - Real file path is: System/Apps/Launcher/App.info\
1306[Launcher] - Success\
1307[bg:UpdateService] - Checking updates\
1308[bg:UpdateService] - No updates available\
1309Trying to run app \"Logger\"\
1310[Logger] - Access level: 1\
1311[Logger] - Trying to execute main file\
1312Trying to get access to the file system, access level: 1\
1313Opening file - Real file path is: /System/Apps/Logger/Start.x\
1314Trying to get access to the file system, access level: 1\
1315Opening file - Real file path is: System/APIs/screenworks\
1316Trying to create background task for \"Logger\"\
1317[Logger] - Creating background task with access level: 1\
1318[Logger] - Success\
1319Trying to change app to \"Launcher\"\
1320Trying to run app \"Logger\"\
1321App \"Logger\" already running\
1322Trying to change app to \"Logger\"\
1323[SystemUI] - Trying to open Recent apps\
1324\
1325---------------New Boot----------------\
1326Starting...\
1327\
1328Clearing temporary directory\
1329Setting up FS API\
1330Opening file - Real file path is: /System/APIs/screenworks\
1331Opening file - Real file path is: /System/APIs/images\
1332Opening file - Real file path is: /System/APIs/advanced_read\
1333Setting up OS API\
1334Setting up Environment\
1335Trying to run System UI\
1336Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1337Trying to create background task for \"system\"\
1338Opening file - Real file path is: /System/Scripts/update_checker.lua\
1339[system] - Creating background task with access level: 1\
1340Trying to run app \"Launcher\"\
1341[Launcher] - Access level: 1\
1342[bg:UpdateService] - Running\
1343[bg:UpdateService] - Downloading last verion info\
1344[SystemUI] - Started\
1345[Launcher] - Trying to execute main file\
1346Trying to get access to the file system, access level: 1\
1347Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1348[Launcher] - Running\
1349Trying to get access to the file system, access level: 1\
1350Opening file - Real file path is: System/Apps/Launcher/App.info\
1351[Launcher] - Success\
1352[bg:UpdateService] - Checking updates\
1353[bg:UpdateService] - No updates available\
1354\
1355---------------New Boot----------------\
1356Starting...\
1357\
1358Clearing temporary directory\
1359Setting up FS API\
1360Opening file - Real file path is: /System/APIs/screenworks\
1361Opening file - Real file path is: /System/APIs/images\
1362Opening file - Real file path is: /System/APIs/advanced_read\
1363Setting up OS API\
1364Setting up Environment\
1365Trying to run System UI\
1366Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1367Trying to create background task for \"system\"\
1368Opening file - Real file path is: /System/Scripts/update_checker.lua\
1369[system] - Creating background task with access level: 1\
1370Trying to run app \"Launcher\"\
1371[Launcher] - Access level: 1\
1372[bg:UpdateService] - Running\
1373[bg:UpdateService] - Downloading last verion info\
1374[SystemUI] - Started\
1375[Launcher] - Trying to execute main file\
1376Trying to get access to the file system, access level: 1\
1377Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1378[Launcher] - Running\
1379Trying to get access to the file system, access level: 1\
1380Opening file - Real file path is: System/Apps/Launcher/App.info\
1381[Launcher] - Success\
1382[bg:UpdateService] - Checking updates\
1383[bg:UpdateService] - No updates available\
1384[SystemUI] - Trying to open Recent apps\
1385Trying to change app to \"Launcher\"\
1386\
1387---------------New Boot----------------\
1388Starting...\
1389\
1390Clearing temporary directory\
1391Setting up FS API\
1392Opening file - Real file path is: /System/APIs/screenworks\
1393Opening file - Real file path is: /System/APIs/images\
1394Opening file - Real file path is: /System/APIs/advanced_read\
1395Setting up OS API\
1396Setting up Environment\
1397Trying to run System UI\
1398Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1399Trying to create background task for \"system\"\
1400Opening file - Real file path is: /System/Scripts/update_checker.lua\
1401[system] - Creating background task with access level: 1\
1402Trying to run app \"Launcher\"\
1403[Launcher] - Access level: 1\
1404[bg:UpdateService] - Running\
1405[bg:UpdateService] - Downloading last verion info\
1406[SystemUI] - Started\
1407[Launcher] - Trying to execute main file\
1408Trying to get access to the file system, access level: 1\
1409Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1410[Launcher] - Running\
1411Trying to get access to the file system, access level: 1\
1412Opening file - Real file path is: System/Apps/Launcher/App.info\
1413[Launcher] - Success\
1414[bg:UpdateService] - Checking updates\
1415[bg:UpdateService] - No updates available\
1416[SystemUI] - Trying to open Recent apps\
1417Trying to change app to \"Launcher\"\
1418[SystemUI] - Trying to open Recent apps\
1419Trying to change app to \"Launcher\"\
1420Trying to run app \"Logger\"\
1421[Logger] - Access level: 1\
1422[Logger] - Trying to execute main file\
1423Trying to get access to the file system, access level: 1\
1424Opening file - Real file path is: /System/Apps/Logger/Start.x\
1425Trying to get access to the file system, access level: 1\
1426Opening file - Real file path is: System/APIs/screenworks\
1427Trying to create background task for \"Logger\"\
1428[Logger] - Creating background task with access level: 1\
1429[Logger] - Success\
1430Trying to change app to \"Launcher\"\
1431\
1432---------------New Boot----------------\
1433Starting...\
1434\
1435Clearing temporary directory\
1436Setting up FS API\
1437Opening file - Real file path is: /System/APIs/screenworks\
1438Opening file - Real file path is: /System/APIs/images\
1439Opening file - Real file path is: /System/APIs/advanced_read\
1440Setting up OS API\
1441Setting up Environment\
1442Trying to run System UI\
1443Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1444Trying to create background task for \"system\"\
1445Opening file - Real file path is: /System/Scripts/update_checker.lua\
1446[system] - Creating background task with access level: 1\
1447Trying to run app \"Launcher\"\
1448[Launcher] - Access level: 1\
1449[bg:UpdateService] - Running\
1450[bg:UpdateService] - Downloading last verion info\
1451[SystemUI] - Started\
1452[Launcher] - Trying to execute main file\
1453Trying to get access to the file system, access level: 1\
1454Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1455[Launcher] - Running\
1456Trying to get access to the file system, access level: 1\
1457Opening file - Real file path is: System/Apps/Launcher/App.info\
1458[Launcher] - Success\
1459[bg:UpdateService] - Checking updates\
1460[bg:UpdateService] - No updates available\
1461[SystemUI] - Trying to open Recent apps\
1462Trying to change app to \"Launcher\"\
1463\
1464---------------New Boot----------------\
1465Starting...\
1466\
1467Clearing temporary directory\
1468Setting up FS API\
1469Opening file - Real file path is: /System/APIs/screenworks\
1470Opening file - Real file path is: /System/APIs/images\
1471Opening file - Real file path is: /System/APIs/advanced_read\
1472Setting up OS API\
1473Setting up Environment\
1474Trying to run System UI\
1475Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1476Trying to create background task for \"system\"\
1477Opening file - Real file path is: /System/Scripts/update_checker.lua\
1478[system] - Creating background task with access level: 1\
1479Trying to run app \"Launcher\"\
1480[Launcher] - Access level: 1\
1481[bg:UpdateService] - Running\
1482[bg:UpdateService] - Downloading last verion info\
1483[SystemUI] - Started\
1484[Launcher] - Trying to execute main file\
1485Trying to get access to the file system, access level: 1\
1486Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1487[Launcher] - Running\
1488Trying to get access to the file system, access level: 1\
1489Opening file - Real file path is: System/Apps/Launcher/App.info\
1490[Launcher] - Success\
1491[bg:UpdateService] - Checking updates\
1492[bg:UpdateService] - No updates available\
1493\
1494---------------New Boot----------------\
1495Starting...\
1496\
1497Clearing temporary directory\
1498Setting up FS API\
1499Opening file - Real file path is: /System/APIs/screenworks\
1500Opening file - Real file path is: /System/APIs/images\
1501Opening file - Real file path is: /System/APIs/advanced_read\
1502Setting up OS API\
1503Setting up Environment\
1504Trying to run System UI\
1505Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1506Trying to create background task for \"system\"\
1507Opening file - Real file path is: /System/Scripts/update_checker.lua\
1508[system] - Creating background task with access level: 1\
1509Trying to run app \"Launcher\"\
1510[Launcher] - Access level: 1\
1511[bg:UpdateService] - Running\
1512[bg:UpdateService] - Downloading last verion info\
1513[SystemUI] - Started\
1514[Launcher] - Trying to execute main file\
1515Trying to get access to the file system, access level: 1\
1516Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1517[Launcher] - Running\
1518Trying to get access to the file system, access level: 1\
1519Opening file - Real file path is: System/Apps/Launcher/App.info\
1520[Launcher] - Success\
1521[bg:UpdateService] - Checking updates\
1522[bg:UpdateService] - No updates available\
1523[SystemUI] - Trying to open Recent apps\
1524Trying to change app to \"Launcher\"\
1525\
1526---------------New Boot----------------\
1527Starting...\
1528\
1529Clearing temporary directory\
1530Setting up FS API\
1531Opening file - Real file path is: /System/APIs/screenworks\
1532Opening file - Real file path is: /System/APIs/images\
1533Opening file - Real file path is: /System/APIs/advanced_read\
1534Setting up OS API\
1535Setting up Environment\
1536\
1537---------------New Boot----------------\
1538Starting...\
1539\
1540Clearing temporary directory\
1541Setting up FS API\
1542Opening file - Real file path is: /System/APIs/screenworks\
1543Opening file - Real file path is: /System/APIs/images\
1544Opening file - Real file path is: /System/APIs/advanced_read\
1545Setting up OS API\
1546Setting up Environment\
1547Trying to run System UI\
1548Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1549Trying to create background task for \"system\"\
1550Opening file - Real file path is: /System/Scripts/update_checker.lua\
1551[system] - Creating background task with access level: 1\
1552Trying to run app \"Launcher\"\
1553[Launcher] - Access level: 1\
1554[bg:UpdateService] - Running\
1555[bg:UpdateService] - Downloading last verion info\
1556[SystemUI] - Started\
1557[Launcher] - Trying to execute main file\
1558Trying to get access to the file system, access level: 1\
1559Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1560[Launcher] - Running\
1561Trying to get access to the file system, access level: 1\
1562Opening file - Real file path is: System/Apps/Launcher/App.info\
1563[Launcher] - Success\
1564[bg:UpdateService] - Checking updates\
1565[bg:UpdateService] - No updates available\
1566[SystemUI] - Trying to open Recent apps\
1567Trying to change app to \"Launcher\"\
1568\
1569---------------New Boot----------------\
1570Starting...\
1571\
1572Clearing temporary directory\
1573Setting up FS API\
1574Opening file - Real file path is: /System/APIs/screenworks\
1575Opening file - Real file path is: /System/APIs/images\
1576Opening file - Real file path is: /System/APIs/advanced_read\
1577Setting up OS API\
1578Setting up Environment\
1579Trying to run System UI\
1580Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1581Trying to create background task for \"system\"\
1582Opening file - Real file path is: /System/Scripts/update_checker.lua\
1583[system] - Creating background task with access level: 1\
1584Trying to run app \"Launcher\"\
1585[Launcher] - Access level: 1\
1586[bg:UpdateService] - Running\
1587[bg:UpdateService] - Downloading last verion info\
1588[SystemUI] - Started\
1589[Launcher] - Trying to execute main file\
1590Trying to get access to the file system, access level: 1\
1591Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1592[Launcher] - Running\
1593Trying to get access to the file system, access level: 1\
1594Opening file - Real file path is: System/Apps/Launcher/App.info\
1595[Launcher] - Success\
1596[bg:UpdateService] - Checking updates\
1597[bg:UpdateService] - No updates available\
1598[SystemUI] - Trying to open Recent apps\
1599Trying to change app to \"Launcher\"\
1600Trying to run app \"Logger\"\
1601[Logger] - Access level: 1\
1602[Logger] - Trying to execute main file\
1603Trying to get access to the file system, access level: 1\
1604Opening file - Real file path is: /System/Apps/Logger/Start.x\
1605Trying to get access to the file system, access level: 1\
1606Opening file - Real file path is: System/APIs/screenworks\
1607Trying to create background task for \"Logger\"\
1608[Logger] - Creating background task with access level: 1\
1609[Logger] - Success\
1610[SystemUI] - Trying to open Recent apps\
1611Trying to change app to \"Logger\"\
1612Trying to change app to \"Launcher\"\
1613\
1614---------------New Boot----------------\
1615Starting...\
1616\
1617Clearing temporary directory\
1618Setting up FS API\
1619Opening file - Real file path is: /System/APIs/screenworks\
1620Opening file - Real file path is: /System/APIs/images\
1621Opening file - Real file path is: /System/APIs/advanced_read\
1622Setting up OS API\
1623Setting up Environment\
1624Trying to run System UI\
1625Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1626Trying to create background task for \"system\"\
1627Opening file - Real file path is: /System/Scripts/update_checker.lua\
1628[system] - Creating background task with access level: 1\
1629Trying to run app \"Launcher\"\
1630[Launcher] - Access level: 1\
1631[bg:UpdateService] - Running\
1632[bg:UpdateService] - Downloading last verion info\
1633[SystemUI] - Started\
1634[Launcher] - Trying to execute main file\
1635Trying to get access to the file system, access level: 1\
1636Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1637[Launcher] - Running\
1638Trying to get access to the file system, access level: 1\
1639Opening file - Real file path is: System/Apps/Launcher/App.info\
1640[Launcher] - Success\
1641[bg:UpdateService] - Checking updates\
1642[bg:UpdateService] - No updates available\
1643[SystemUI] - Trying to open Recent apps\
1644Trying to change app to \"Launcher\"\
1645[SystemUI] - Trying to open Recent apps\
1646Trying to change app to \"Launcher\"\
1647[SystemUI] - Trying to open Recent apps\
1648Trying to change app to \"Launcher\"\
1649Trying to run app \"Logger\"\
1650[Logger] - Access level: 1\
1651[Logger] - Trying to execute main file\
1652Trying to get access to the file system, access level: 1\
1653Opening file - Real file path is: /System/Apps/Logger/Start.x\
1654Trying to get access to the file system, access level: 1\
1655Opening file - Real file path is: System/APIs/screenworks\
1656Trying to create background task for \"Logger\"\
1657[Logger] - Creating background task with access level: 1\
1658[Logger] - Success\
1659Trying to change app to \"Launcher\"\
1660[SystemUI] - Trying to open Recent apps\
1661Trying to change app to \"Launcher\"\
1662[SystemUI] - Trying to open Recent apps\
1663Trying to change app to \"Launcher\"\
1664[SystemUI] - Trying to open Recent apps\
1665Trying to change app to \"Launcher\"\
1666\
1667---------------New Boot----------------\
1668Starting...\
1669\
1670Clearing temporary directory\
1671Setting up FS API\
1672Opening file - Real file path is: /System/APIs/screenworks\
1673Opening file - Real file path is: /System/APIs/images\
1674Opening file - Real file path is: /System/APIs/advanced_read\
1675Setting up OS API\
1676Setting up Environment\
1677Trying to run System UI\
1678Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1679Trying to create background task for \"system\"\
1680Opening file - Real file path is: /System/Scripts/update_checker.lua\
1681[system] - Creating background task with access level: 1\
1682Trying to run app \"Launcher\"\
1683[Launcher] - Access level: 1\
1684[bg:UpdateService] - Running\
1685[bg:UpdateService] - Downloading last verion info\
1686[SystemUI] - Started\
1687[Launcher] - Trying to execute main file\
1688Trying to get access to the file system, access level: 1\
1689Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1690[Launcher] - Running\
1691Trying to get access to the file system, access level: 1\
1692Opening file - Real file path is: System/Apps/Launcher/App.info\
1693[Launcher] - Success\
1694[bg:UpdateService] - Checking updates\
1695[bg:UpdateService] - No updates available\
1696[SystemUI] - Trying to open Recent apps\
1697Trying to change app to \"Launcher\"\
1698\
1699---------------New Boot----------------\
1700Starting...\
1701\
1702Clearing temporary directory\
1703Setting up FS API\
1704Opening file - Real file path is: /System/APIs/screenworks\
1705Opening file - Real file path is: /System/APIs/images\
1706Opening file - Real file path is: /System/APIs/advanced_read\
1707Setting up OS API\
1708Setting up Environment\
1709Trying to run System UI\
1710Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1711Trying to create background task for \"system\"\
1712Opening file - Real file path is: /System/Scripts/update_checker.lua\
1713[system] - Creating background task with access level: 1\
1714Trying to run app \"Launcher\"\
1715[Launcher] - Access level: 1\
1716[bg:UpdateService] - Running\
1717[bg:UpdateService] - Downloading last verion info\
1718[SystemUI] - Started\
1719[Launcher] - Trying to execute main file\
1720Trying to get access to the file system, access level: 1\
1721Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1722[Launcher] - Running\
1723Trying to get access to the file system, access level: 1\
1724Opening file - Real file path is: System/Apps/Launcher/App.info\
1725[Launcher] - Success\
1726[bg:UpdateService] - Checking updates\
1727[bg:UpdateService] - No updates available\
1728[SystemUI] - Trying to open Recent apps\
1729Trying to change app to \"Launcher\"\
1730\
1731---------------New Boot----------------\
1732Starting...\
1733\
1734Clearing temporary directory\
1735Setting up FS API\
1736Opening file - Real file path is: /System/APIs/screenworks\
1737Opening file - Real file path is: /System/APIs/images\
1738Opening file - Real file path is: /System/APIs/advanced_read\
1739Setting up OS API\
1740Setting up Environment\
1741Trying to run System UI\
1742Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1743Trying to create background task for \"system\"\
1744Opening file - Real file path is: /System/Scripts/update_checker.lua\
1745[system] - Creating background task with access level: 1\
1746Trying to run app \"Launcher\"\
1747[Launcher] - Access level: 1\
1748[bg:UpdateService] - Running\
1749[bg:UpdateService] - Downloading last verion info\
1750[SystemUI] - Started\
1751[Launcher] - Trying to execute main file\
1752Trying to get access to the file system, access level: 1\
1753Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1754[Launcher] - Running\
1755Trying to get access to the file system, access level: 1\
1756Opening file - Real file path is: System/Apps/Launcher/App.info\
1757[Launcher] - Success\
1758[bg:UpdateService] - Checking updates\
1759[bg:UpdateService] - No updates available\
1760[SystemUI] - Trying to open Recent apps\
1761Trying to change app to \"Launcher\"\
1762[SystemUI] - Trying to open Recent apps\
1763Trying to change app to \"Launcher\"\
1764Trying to run app \"Logger\"\
1765[Logger] - Access level: 1\
1766[Logger] - Trying to execute main file\
1767Trying to get access to the file system, access level: 1\
1768Opening file - Real file path is: /System/Apps/Logger/Start.x\
1769Trying to get access to the file system, access level: 1\
1770Opening file - Real file path is: System/APIs/screenworks\
1771Trying to create background task for \"Logger\"\
1772[Logger] - Creating background task with access level: 1\
1773[Logger] - Success\
1774Trying to change app to \"Launcher\"\
1775Trying to run app \"Logger\"\
1776App \"Logger\" already running\
1777Trying to change app to \"Logger\"\
1778Trying to change app to \"Launcher\"\
1779[SystemUI] - Trying to open Recent apps\
1780\
1781---------------New Boot----------------\
1782Starting...\
1783\
1784Clearing temporary directory\
1785Setting up FS API\
1786Opening file - Real file path is: /System/APIs/screenworks\
1787Opening file - Real file path is: /System/APIs/images\
1788Opening file - Real file path is: /System/APIs/advanced_read\
1789Setting up OS API\
1790Setting up Environment\
1791Trying to run System UI\
1792Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1793Trying to create background task for \"system\"\
1794Opening file - Real file path is: /System/Scripts/update_checker.lua\
1795[system] - Creating background task with access level: 1\
1796Trying to run app \"Launcher\"\
1797[Launcher] - Access level: 1\
1798[bg:UpdateService] - Running\
1799[bg:UpdateService] - Downloading last verion info\
1800[SystemUI] - Started\
1801[Launcher] - Trying to execute main file\
1802Trying to get access to the file system, access level: 1\
1803Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1804[Launcher] - Running\
1805Trying to get access to the file system, access level: 1\
1806Opening file - Real file path is: System/Apps/Launcher/App.info\
1807[Launcher] - Success\
1808[bg:UpdateService] - Checking updates\
1809[bg:UpdateService] - No updates available\
1810[SystemUI] - Trying to open Recent apps\
1811Trying to change app to \"Launcher\"\
1812[SystemUI] - Trying to open Recent apps\
1813Trying to change app to \"Launcher\"\
1814[SystemUI] - Trying to open Recent apps\
1815Trying to change app to \"Launcher\"\
1816\
1817---------------New Boot----------------\
1818Starting...\
1819\
1820Clearing temporary directory\
1821Setting up FS API\
1822Opening file - Real file path is: /System/APIs/screenworks\
1823Opening file - Real file path is: /System/APIs/images\
1824Opening file - Real file path is: /System/APIs/advanced_read\
1825Setting up OS API\
1826Setting up Environment\
1827Trying to run System UI\
1828Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1829Trying to create background task for \"system\"\
1830Opening file - Real file path is: /System/Scripts/update_checker.lua\
1831[system] - Creating background task with access level: 1\
1832Trying to run app \"Launcher\"\
1833[Launcher] - Access level: 1\
1834[bg:UpdateService] - Running\
1835[bg:UpdateService] - Downloading last verion info\
1836[SystemUI] - Started\
1837[Launcher] - Trying to execute main file\
1838Trying to get access to the file system, access level: 1\
1839Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1840[Launcher] - Running\
1841Trying to get access to the file system, access level: 1\
1842Opening file - Real file path is: System/Apps/Launcher/App.info\
1843[Launcher] - Success\
1844[bg:UpdateService] - Checking updates\
1845[bg:UpdateService] - No updates available\
1846[SystemUI] - Trying to open Recent apps\
1847Trying to change app to \"Launcher\"\
1848\
1849---------------New Boot----------------\
1850Starting...\
1851\
1852Clearing temporary directory\
1853Setting up FS API\
1854Opening file - Real file path is: /System/APIs/screenworks\
1855Opening file - Real file path is: /System/APIs/images\
1856Opening file - Real file path is: /System/APIs/advanced_read\
1857Setting up OS API\
1858Setting up Environment\
1859Trying to run System UI\
1860Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1861Trying to create background task for \"system\"\
1862Opening file - Real file path is: /System/Scripts/update_checker.lua\
1863[system] - Creating background task with access level: 1\
1864Trying to run app \"Launcher\"\
1865[Launcher] - Access level: 1\
1866[bg:UpdateService] - Running\
1867[bg:UpdateService] - Downloading last verion info\
1868[SystemUI] - Started\
1869[Launcher] - Trying to execute main file\
1870Trying to get access to the file system, access level: 1\
1871Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1872[Launcher] - Running\
1873Trying to get access to the file system, access level: 1\
1874Opening file - Real file path is: System/Apps/Launcher/App.info\
1875[Launcher] - Success\
1876[bg:UpdateService] - Checking updates\
1877[bg:UpdateService] - No updates available\
1878[SystemUI] - Trying to open Recent apps\
1879Trying to change app to \"Launcher\"\
1880[SystemUI] - Trying to open Recent apps\
1881Trying to change app to \"Launcher\"\
1882\
1883---------------New Boot----------------\
1884Starting...\
1885\
1886Clearing temporary directory\
1887Setting up FS API\
1888Opening file - Real file path is: /System/APIs/screenworks\
1889Opening file - Real file path is: /System/APIs/images\
1890Opening file - Real file path is: /System/APIs/advanced_read\
1891Setting up OS API\
1892Setting up Environment\
1893Trying to run System UI\
1894Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1895Trying to create background task for \"system\"\
1896Opening file - Real file path is: /System/Scripts/update_checker.lua\
1897[system] - Creating background task with access level: 1\
1898Trying to run app \"Launcher\"\
1899[Launcher] - Access level: 1\
1900[bg:UpdateService] - Running\
1901[bg:UpdateService] - Downloading last verion info\
1902[SystemUI] - Started\
1903[Launcher] - Trying to execute main file\
1904Trying to get access to the file system, access level: 1\
1905Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1906[Launcher] - Running\
1907Trying to get access to the file system, access level: 1\
1908Opening file - Real file path is: System/Apps/Launcher/App.info\
1909[Launcher] - Success\
1910[bg:UpdateService] - Checking updates\
1911[bg:UpdateService] - No updates available\
1912[SystemUI] - Trying to open Recent apps\
1913Trying to change app to \"Launcher\"\
1914[SystemUI] - Trying to open Recent apps\
1915Trying to change app to \"Launcher\"\
1916[SystemUI] - Trying to open Recent apps\
1917Trying to change app to \"Launcher\"\
1918[SystemUI] - Clearing notifications\
1919\
1920---------------New Boot----------------\
1921Starting...\
1922\
1923Clearing temporary directory\
1924Setting up FS API\
1925Opening file - Real file path is: /System/APIs/screenworks\
1926Opening file - Real file path is: /System/APIs/images\
1927Opening file - Real file path is: /System/APIs/advanced_read\
1928Setting up OS API\
1929Setting up Environment\
1930Trying to run System UI\
1931Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1932Trying to create background task for \"system\"\
1933Opening file - Real file path is: /System/Scripts/update_checker.lua\
1934[system] - Creating background task with access level: 1\
1935Trying to run app \"Launcher\"\
1936[Launcher] - Access level: 1\
1937[bg:UpdateService] - Running\
1938[bg:UpdateService] - Downloading last verion info\
1939[SystemUI] - Started\
1940[Launcher] - Trying to execute main file\
1941Trying to get access to the file system, access level: 1\
1942Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1943[Launcher] - Running\
1944Trying to get access to the file system, access level: 1\
1945Opening file - Real file path is: System/Apps/Launcher/App.info\
1946[Launcher] - Success\
1947[bg:UpdateService] - Checking updates\
1948[bg:UpdateService] - No updates available\
1949\
1950---------------New Boot----------------\
1951Starting...\
1952\
1953Clearing temporary directory\
1954Setting up FS API\
1955Opening file - Real file path is: /System/APIs/screenworks\
1956Opening file - Real file path is: /System/APIs/images\
1957Opening file - Real file path is: /System/APIs/advanced_read\
1958Setting up OS API\
1959Setting up Environment\
1960Trying to run System UI\
1961Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1962Trying to create background task for \"system\"\
1963Opening file - Real file path is: /System/Scripts/update_checker.lua\
1964[system] - Creating background task with access level: 1\
1965Trying to run app \"Launcher\"\
1966[Launcher] - Access level: 1\
1967[bg:UpdateService] - Running\
1968[bg:UpdateService] - Downloading last verion info\
1969[SystemUI] - Started\
1970[Launcher] - Trying to execute main file\
1971Trying to get access to the file system, access level: 1\
1972Opening file - Real file path is: /System/Apps/Launcher/Start.x\
1973[Launcher] - Running\
1974Trying to get access to the file system, access level: 1\
1975Opening file - Real file path is: System/Apps/Launcher/App.info\
1976[Launcher] - Success\
1977[bg:UpdateService] - Checking updates\
1978[bg:UpdateService] - No updates available\
1979[SystemUI] - Trying to open Recent apps\
1980Trying to change app to \"Launcher\"\
1981\
1982---------------New Boot----------------\
1983Starting...\
1984\
1985Clearing temporary directory\
1986Setting up FS API\
1987Opening file - Real file path is: /System/APIs/screenworks\
1988Opening file - Real file path is: /System/APIs/images\
1989Opening file - Real file path is: /System/APIs/advanced_read\
1990Setting up OS API\
1991Setting up Environment\
1992Trying to run System UI\
1993Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
1994Trying to create background task for \"system\"\
1995Opening file - Real file path is: /System/Scripts/update_checker.lua\
1996[system] - Creating background task with access level: 1\
1997Trying to run app \"Launcher\"\
1998[Launcher] - Access level: 1\
1999[bg:UpdateService] - Running\
2000[bg:UpdateService] - Downloading last verion info\
2001[SystemUI] - Started\
2002[Launcher] - Trying to execute main file\
2003Trying to get access to the file system, access level: 1\
2004Opening file - Real file path is: /System/Apps/Launcher/Start.x\
2005[Launcher] - Running\
2006Trying to get access to the file system, access level: 1\
2007Opening file - Real file path is: System/Apps/Launcher/App.info\
2008[Launcher] - Success\
2009[bg:UpdateService] - Checking updates\
2010[bg:UpdateService] - No updates available\
2011[SystemUI] - Trying to open Recent apps\
2012Trying to change app to \"Launcher\"\
2013[SystemUI] - Trying to open Recent apps\
2014Trying to change app to \"Launcher\"\
2015\
2016---------------New Boot----------------\
2017Starting...\
2018\
2019Clearing temporary directory\
2020Setting up FS API\
2021Opening file - Real file path is: /System/APIs/screenworks\
2022Opening file - Real file path is: /System/APIs/images\
2023Opening file - Real file path is: /System/APIs/advanced_read\
2024Setting up OS API\
2025Setting up Environment\
2026Trying to run System UI\
2027Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
2028Trying to create background task for \"system\"\
2029Opening file - Real file path is: /System/Scripts/update_checker.lua\
2030[system] - Creating background task with access level: 1\
2031Trying to run app \"Launcher\"\
2032[Launcher] - Access level: 1\
2033[bg:UpdateService] - Running\
2034[bg:UpdateService] - Downloading last verion info\
2035[SystemUI] - Started\
2036[Launcher] - Trying to execute main file\
2037Trying to get access to the file system, access level: 1\
2038Opening file - Real file path is: /System/Apps/Launcher/Start.x\
2039[Launcher] - Running\
2040Trying to get access to the file system, access level: 1\
2041Opening file - Real file path is: System/Apps/Launcher/App.info\
2042[Launcher] - Success\
2043[bg:UpdateService] - Checking updates\
2044[bg:UpdateService] - No updates available\
2045[SystemUI] - Trying to open Recent apps\
2046\
2047---------------New Boot----------------\
2048Starting...\
2049\
2050Clearing temporary directory\
2051Setting up FS API\
2052Opening file - Real file path is: /System/APIs/screenworks\
2053Opening file - Real file path is: /System/APIs/images\
2054Opening file - Real file path is: /System/APIs/advanced_read\
2055Setting up OS API\
2056Setting up Environment\
2057Trying to run System UI\
2058Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
2059Trying to create background task for \"system\"\
2060Opening file - Real file path is: /System/Scripts/update_checker.lua\
2061[system] - Creating background task with access level: 1\
2062Trying to run app \"Launcher\"\
2063[Launcher] - Access level: 1\
2064[bg:UpdateService] - Running\
2065[bg:UpdateService] - Downloading last verion info\
2066[SystemUI] - Started\
2067[Launcher] - Trying to execute main file\
2068Trying to get access to the file system, access level: 1\
2069Opening file - Real file path is: /System/Apps/Launcher/Start.x\
2070[Launcher] - Running\
2071Trying to get access to the file system, access level: 1\
2072Opening file - Real file path is: System/Apps/Launcher/App.info\
2073[Launcher] - Success\
2074[bg:UpdateService] - Checking updates\
2075[bg:UpdateService] - No updates available\
2076[SystemUI] - Trying to open Recent apps\
2077Trying to change app to \"Launcher\"\
2078[SystemUI] - Trying to open Recent apps\
2079Trying to change app to \"Launcher\"\
2080[SystemUI] - Trying to open Recent apps\
2081Trying to change app to \"Launcher\"\
2082\
2083---------------New Boot----------------\
2084Starting...\
2085\
2086Clearing temporary directory\
2087Setting up FS API\
2088Opening file - Real file path is: /System/APIs/screenworks\
2089Opening file - Real file path is: /System/APIs/images\
2090Opening file - Real file path is: /System/APIs/advanced_read\
2091Setting up OS API\
2092Setting up Environment\
2093Trying to run System UI\
2094Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
2095Trying to create background task for \"system\"\
2096Opening file - Real file path is: /System/Scripts/update_checker.lua\
2097[system] - Creating background task with access level: 1\
2098Trying to run app \"Launcher\"\
2099[Launcher] - Access level: 1\
2100[bg:UpdateService] - Running\
2101[bg:UpdateService] - Downloading last verion info\
2102[SystemUI] - Started\
2103[Launcher] - Trying to execute main file\
2104Trying to get access to the file system, access level: 1\
2105Opening file - Real file path is: /System/Apps/Launcher/Start.x\
2106[Launcher] - Running\
2107Trying to get access to the file system, access level: 1\
2108Opening file - Real file path is: System/Apps/Launcher/App.info\
2109[Launcher] - Success\
2110[bg:UpdateService] - Checking updates\
2111[bg:UpdateService] - No updates available\
2112\
2113---------------New Boot----------------\
2114Starting...\
2115\
2116Clearing temporary directory\
2117Setting up FS API\
2118Opening file - Real file path is: /System/APIs/screenworks\
2119Opening file - Real file path is: /System/APIs/images\
2120Opening file - Real file path is: /System/APIs/advanced_read\
2121Setting up OS API\
2122Setting up Environment\
2123Trying to run System UI\
2124Opening file - Real file path is: /System/Apps/LegacyUI/Start.x\
2125Trying to create background task for \"system\"\
2126Opening file - Real file path is: /System/Scripts/update_checker.lua\
2127[system] - Creating background task with access level: 1\
2128Trying to run app \"Launcher\"\
2129[Launcher] - Access level: 1\
2130[bg:UpdateService] - Running\
2131[bg:UpdateService] - Downloading last verion info\
2132[SystemUI] - Started\
2133[Launcher] - Trying to execute main file\
2134Trying to get access to the file system, access level: 1\
2135Opening file - Real file path is: /System/Apps/Launcher/Start.x\
2136[Launcher] - Running\
2137Trying to get access to the file system, access level: 1\
2138Opening file - Real file path is: System/Apps/Launcher/App.info\
2139[Launcher] - Success\
2140[bg:UpdateService] - Checking updates\
2141[bg:UpdateService] - No updates available\
2142Trying to get access to the file system, access level: 1\
2143Opening file - Real file path is: rom/programs/clear.lua\
2144Trying to get access to the file system, access level: 1\
2145Opening file - Real file path is: rom/programs/http/wget.lua\
2146Trying to get access to the file system, access level: 1\
2147Opening file - Real file path is: rawterm.lua\
2148Trying to get access to the file system, access level: 1\
2149Opening file - Real file path is: /rom/modules/main/cc/expect.lua\
2150Trying to get access to the file system, access level: 1\
2151Opening file - Real file path is: rom/programs/shell.lua\
2152Trying to get access to the file system, access level: 1\
2153Opening file - Real file path is: rom/modules/main/cc/expect.lua\
2154Trying to get access to the file system, access level: 1\
2155Opening file - Real file path is: rom/modules/main/cc/require.lua\
2156Trying to get access to the file system, access level: 1\
2157Opening file - Real file path is: rom/modules/main/cc/expect.lua\
2158Trying to get access to the file system, access level: 1\
2159Opening file - Real file path is: rom/programs/lua.lua\
2160Trying to get access to the file system, access level: 1\
2161Opening file - Real file path is: /rom/modules/main/cc/pretty.lua\
2162Trying to get access to the file system, access level: 1\
2163Opening file - Real file path is: /rom/modules/main/cc/expect.lua\
2164Trying to get access to the file system, access level: 1\
2165Opening file - Real file path is: rom/programs/clear.lua\
2166Trying to get access to the file system, access level: 1\
2167Opening file - Real file path is: rom/programs/list.lua\
2168Trying to get access to the file system, access level: 1\
2169Opening file - Real file path is: rom/programs/edit.lua\
2170Trying to get access to the file system, access level: 1\
2171Opening file - Real file path is: rawterm.lua",
2172 [ "Build.info" ] = "{\
2173 family = \"LegacyOS\",\
2174 name = \"Legacy\",\
2175 core_path = \"/System/Core.x\",\
2176\
2177 OSversion = \"0.0.6\",\
2178 APIversion = \"0.3\",\
2179\
2180 build = \"Alpha#6\",\
2181 build_date = \"09.05.19\",\
2182}",
2183 Media = {
2184 ScreenSettings = {
2185 [ "TrueWhiteBlack.info" ] = "{\
2186 name = \"True white & black\",\
2187\
2188 newColors = {\
2189 white = {1, 1, 1},\
2190 black = {0, 0, 0},\
2191 }\
2192}",
2193 [ "1.info" ] = "{\
2194 name = \"Default\",\
2195\
2196 newColors = {\
2197 white = {0.94, 0.94, 0.94},\
2198 orange = {0.949, 0.698, 0.2},\
2199 magenta = {0.9, 0.5, 0.85},\
2200 lightBlue = {0.6,0.7,0.95},\
2201 yellow = {0.87,0.87,0.42},\
2202 lime = {0.5,0.8,0.1},\
2203 pink = {0.95,0.7,0.8},\
2204 gray = {0.3,0.3,0.3},\
2205 lightGray = {0.6,0.6,0.6},\
2206 cyan = {0.3,0.6,0.7},\
2207 purple = {0.7,0.4,0.9},\
2208 blue = {0.2,0.4,0.8},\
2209 brown = {0.5,0.4,0.3},\
2210 green = {0.34,0.65,0.31},\
2211 red = {0.8,0.3,0.3},\
2212 black = {0.1,0.1,0.1},\
2213 }\
2214}",
2215 [ "Advanced.info" ] = "{\
2216 name = \"Legacy\",\
2217\
2218 newColors = {\
2219 white = {1, 1, 1},\
2220 orange = {1, 0.64, 0.21},\
2221 magenta = {0.91, 0.42, 0.95},\
2222 lightBlue = {0.31, 0.75, 0.93},\
2223 yellow = {0.97, 0.92, 0.34},\
2224 lime = {0.38, 0.98, 0.39},\
2225 pink = {0.96, 0.79, 0.8},\
2226 gray = {0.35, 0.35, 0.35},\
2227 lightGray = {0.74, 0.74, 0.74},\
2228 cyan = {0.24,0.75,0.77},\
2229 purple = {0.58, 0.47, 0.96},\
2230 blue = {0.17, 0.39, 0.88},\
2231 brown = {0.5, 0.34, 0.16},\
2232 green = {0.15, 0.77, 0.29},\
2233 red = {0.94, 0.19, 0.2},\
2234 black = {0, 0, 0},\
2235 }\
2236}",
2237 [ "ShadesOfGray.info" ] = "{\
2238 name = \"Shades of gray\",\
2239\
2240 newColors = {\
2241 white = {1, 1, 1},\
2242 orange = {0.932, 0.932, 0.932},\
2243 magenta = {0.865, 0.865, 0.865},\
2244 lightBlue = {0.799, 0.799, 0.799},\
2245 yellow = {0.732, 0.732, 0.732},\
2246 lime = {0.666, 0.666, 0.666},\
2247 pink = {0.599, 0.599, 0.599},\
2248 gray = {0.532, 0.532, 0.532},\
2249 lightGray = {0.466, 0.466, 0.466},\
2250 cyan = {0.399, 0.399, 0.399},\
2251 purple = {0.333, 0.333, 0.333},\
2252 blue = {0.266, 0.266, 0.266},\
2253 brown = {0.199, 0.199, 0.199},\
2254 green = {0.133, 0.133, 0.133},\
2255 red = {0.066, 0.066, 0.066},\
2256 black = {0, 0, 0},\
2257 }\
2258}",
2259 },
2260 [ "shutanimation.lua" ] = "local xSize, ySize = term.getSize()\
2261local centerX = math.floor(xSize/2)\
2262local centerY = math.floor(ySize/2)\
2263local origin = term.native()\
2264\
2265local clear = function(color)\
2266 term.setBackgroundColor(color)\
2267 term.clear()\
2268 term.setCursorPos(1,1)\
2269end\
2270\
2271local text = function(string,xPos,yPos,trm)\
2272 if not trm then\
2273 trm = term\
2274 end\
2275 trm.setCursorPos(xPos,yPos)\
2276 trm.write(string)\
2277end\
2278\
2279function init()\
2280 term.redirect(term.native())\
2281 clear(colors.white)\
2282 term.setTextColor(colors.cyan)\
2283 text(\"Legacy\",centerX-2,centerY)\
2284end\
2285\
2286function loop()\
2287 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2288 sleep(0)\
2289\
2290 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2291 sleep(0)\
2292\
2293 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2294 sleep(0)\
2295\
2296 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2297 sleep(0)\
2298\
2299 origin.setPaletteColor(colors.cyan, 0.43, 0.67, 0.76) -- 9\
2300 sleep(0)\
2301\
2302 origin.setPaletteColor(colors.cyan, 0.29, 0.6, 0.69) -- original\
2303 sleep(0.3)\
2304\
2305 origin.setPaletteColor(colors.cyan, 0.36, 0.63, 0.72) -- 10\
2306 sleep(0.1)\
2307\
2308 origin.setPaletteColor(colors.cyan, 0.43, 0.67, 0.76) -- 9\
2309 sleep(0.1)\
2310\
2311 origin.setPaletteColor(colors.cyan, 0.5, 0.72, 0.78) -- 8\
2312 sleep(0.1)\
2313\
2314 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2315 sleep(0)\
2316\
2317 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2318 sleep(0)\
2319\
2320 origin.setPaletteColor(colors.cyan, 0.78, 0.87, 0.9) -- 4\
2321 sleep(0)\
2322\
2323 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2324 sleep(0)\
2325\
2326 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2327 sleep(0.3)\
2328\
2329 term.redirect(term.native())\
2330 clear(colors.white)\
2331 text(\"| ^ - ^ |\",centerX-4,centerY)\
2332\
2333 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2334 sleep(0)\
2335\
2336 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2337 sleep(0)\
2338\
2339 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2340 sleep(0)\
2341\
2342 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2343 sleep(0.1)\
2344\
2345 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2346 sleep(0)\
2347\
2348 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2349 sleep(0)\
2350\
2351 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2352 sleep(0)\
2353\
2354 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2355 sleep(0.3)\
2356end",
2357 [ "bootanimation.lua" ] = "local xSize, ySize = term.getSize()\
2358local centerX = math.floor(xSize/2)\
2359local centerY = math.floor(ySize/2)\
2360local origin = peripheral.wrap(\"top\")\
2361\
2362local clear = function(color)\
2363 term.setBackgroundColor(color)\
2364 term.clear()\
2365 term.setCursorPos(1,1)\
2366end\
2367\
2368local text = function(string,xPos,yPos,trm)\
2369 if not trm then\
2370 trm = origin\
2371 end\
2372 trm.setCursorPos(xPos,yPos)\
2373 trm.write(string)\
2374end\
2375\
2376function init()\
2377 term.redirect(origin)\
2378 clear(colors.white)\
2379 term.setTextColor(colors.cyan)\
2380 text(\"Legacy\",centerX-2,centerY)\
2381end\
2382\
2383function loop()\
2384 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2385 sleep(0)\
2386\
2387 origin.setPaletteColor(colors.cyan, 0.92, 0.96, 0.96) -- 2\
2388 sleep(0)\
2389\
2390 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2391 sleep(0)\
2392\
2393 origin.setPaletteColor(colors.cyan, 0.78, 0.87, 0.9) -- 4\
2394 sleep(0)\
2395\
2396 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2397 sleep(0)\
2398\
2399 origin.setPaletteColor(colors.cyan, 0.65, 0.8, 0.85) -- 6\
2400 sleep(0)\
2401\
2402 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2403 sleep(0)\
2404\
2405 origin.setPaletteColor(colors.cyan, 0.5, 0.72, 0.78) -- 8\
2406 sleep(0)\
2407\
2408 origin.setPaletteColor(colors.cyan, 0.43, 0.67, 0.76) -- 9\
2409 sleep(0)\
2410\
2411 origin.setPaletteColor(colors.cyan, 0.36, 0.63, 0.72) -- 10\
2412 sleep(0.1)\
2413\
2414 origin.setPaletteColor(colors.cyan, 0.29, 0.6, 0.69) -- original\
2415 sleep(0.3)\
2416\
2417 origin.setPaletteColor(colors.cyan, 0.36, 0.63, 0.72) -- 10\
2418 sleep(0.1)\
2419\
2420 origin.setPaletteColor(colors.cyan, 0.43, 0.67, 0.76) -- 9\
2421 sleep(0.1)\
2422\
2423 origin.setPaletteColor(colors.cyan, 0.5, 0.72, 0.78) -- 8\
2424 sleep(0.1)\
2425\
2426 origin.setPaletteColor(colors.cyan, 0.58, 0.76, 0.81) -- 7\
2427 sleep(0)\
2428\
2429 origin.setPaletteColor(colors.cyan, 0.65, 0.8, 0.85) -- 6\
2430 sleep(0)\
2431\
2432 origin.setPaletteColor(colors.cyan, 0.72, 0.83, 0.87) -- 5\
2433 sleep(0)\
2434\
2435 origin.setPaletteColor(colors.cyan, 0.78, 0.87, 0.9) -- 4\
2436 sleep(0)\
2437\
2438 origin.setPaletteColor(colors.cyan, 0.85, 0.92, 0.94) -- 3\
2439 sleep(0)\
2440\
2441 origin.setPaletteColor(colors.cyan, 0.92, 0.96, 0.96) -- 2\
2442 sleep(0)\
2443\
2444 origin.setPaletteColor(colors.cyan, 0.97, 0.97, 0.97) -- 1\
2445 sleep(0)\
2446end",
2447 Images = {
2448 [ "exec_icon.png" ] = " 0f 0f 0f 0f 0f 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
2449 1f>1f_1f 1f 1f 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00######\
2450 0f 0f 0f 0f 0f 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00#########\
2451 0f 0f 0f 0f 0f 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00#########\
2452 00 0f 0f 00 0f 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00#########\
2453 00 0f 0f 00 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00############\
2454### 0f 0f 00###### 00 00 00 00 00 00 00 00 00 00 00 00 00###############\
2455 00 00 00######### 00 00 00 00 00 00 00 00 00 00 00 00 00###############\
2456################################################### 00##################\
2457########################################################################\
2458########################################################################\
2459########################################################################",
2460 [ "load_icon.png" ] = "00000008800000000000000000####################################\
246100000008800000000000000000####################################\
246200000008800000000000000000####################################\
246300800808800880000000000000####################################\
246400008008808000000000000000####################################\
246500808080808080000000000000####################################\
2466###########################################################################\
2467###########################################################################\
2468###########################################################################\
2469###########################################################################\
2470###########################################################################\
2471###########################################################################\
2472###################################################\
2473###################################################\
2474###################################################\
2475###################################################\
2476###################################################\
2477###################################################",
2478 [ "dialog_middle.png" ] = "70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 7007",
2479 [ "dialog_top.png" ] = " 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07\
2480 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07\
248170 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 7007",
2482 [ "noicon.png" ] = "909090909090\
2483 9090909090 90\
2484 90i90c90o90n90 90\
2485909090909090",
2486 [ "code_icon.png" ] = "f37o37r37 07i87=87######################################################\
2487 b7t07e07r07m07.07######################################################\
2488 07x07 07=07 07i07######################################################\
2489e37n37d37 07 07 07######################################################\
2490########################################################################\
2491########################################################################\
2492########################################################################\
2493########################################################################\
2494########################################################################\
2495########################################################################\
2496########################################################################\
2497########################################################################",
2498 [ "dialog_bottom.png" ] = "70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 7007\
2499070707070707070707070707070707070707070707070707070707
07",
2500 },
2501 },
2502 [ "Core.x" ] = "local arg = {...}\
2503\
2504local mon = peripheral.wrap(\"top\")\
2505\
2506local xSize, ySize = term.getSize()\
2507local centerX = math.floor(xSize/2)\
2508local centerY = math.floor(ySize/2)\
2509local backgroundTasks = {}\
2510local backgroundTasksPerApp = 3\
2511local tasks = {}\
2512local tAPIsLoading = {}\
2513local currentTask = 0\
2514local currentRunningTask\
2515local currentRunningBackTask\
2516local allowBarDrawing = true\
2517local first = mon\
2518local origin = window.create(mon,1,1,xSize,ySize)\
2519term.redirect(origin)\
2520\
2521local showSplash = true\
2522local saveLog = true\
2523local withoutDebug = false\
2524local verbose = false\
2525local delay = 0\
2526\
2527local defaultLauncher = settings.get(\"os.defaultLauncher\", 'Launcher')\
2528local defaultUI = settings.get(\"os.defaultUI\", \"LegacyUI\")\
2529\
2530local floatingEnabled = settings.get(\"os.floatingEnabled\", true)\
2531local floatingTime = tonumber(settings.get(\"os.floatingTime\", 4.0))\
2532\
2533local ui_state, appPosX, appPosY, appSizeX, appSizeY = 1, 1, xSize, ySize-1\
2534local ui_routine\
2535local did_mod = false\
2536local press_mod\
2537\
2538local file = fs.open(\"/System/Media/ScreenSettings/1.info\", \"r\")\
2539local stockPalette = textutils.unserialize(file.readAll()).newColors\
2540file.close()\
2541local currentPalette = settings.get(\"os.currentPalette\", stockPalette)\
2542\
2543local logBuffer = {}\
2544local lastLogMsg = \"\"\
2545\
2546os.applyColorPalette = function(palette, trm)\
2547 if stockPalette and term.setPaletteColor then\
2548 local palette = palette or stockPalette\
2549 local trm = trm or term.native()\
2550 for name, stockColor in pairs(stockPalette) do\
2551 if palette[name] then\
2552 trm.setPaletteColor(colors[name], palette[name][1], palette[name][2], palette[name][3])\
2553 else\
2554 trm.setPaletteColor(colors[name], stockColor[1], stockColor[2], stockColor[3])\
2555 end\
2556 end\
2557 currentPalette = palette\
2558 end\
2559end\
2560\
2561os.applyColorPalette(currentPalette)\
2562\
2563local errorBuffer\
2564\
2565-- env = {}\
2566\
2567oldOpen = fs.open\
2568oldDel = fs.delete\
2569oldCopy = fs.copy\
2570oldMove = fs.move\
2571oldMkdir = fs.makeDir\
2572oldList = fs.list\
2573oldSize = fs.getSize\
2574oldDir = fs.isDir\
2575oldExist = fs.exists\
2576oldName = fs.getName\
2577oldGDir = fs.getDir\
2578oldReadOnly = fs.isReadOnly\
2579oldPath = shell.path()\
2580oldLoadAPI = os.loadAPI\
2581\
2582notifications = {}\
2583\
2584if arg then\
2585 for i=1,#arg do\
2586 if arg[i] == '--no-splash' then\
2587 showSplash = false\
2588 elseif arg[i] == '--no-debug' then\
2589 withoutDebug = true\
2590 elseif arg[i] == '--use-launcher' then\
2591 defaultLauncher = (arg[i+1] or defaultLauncher)\
2592 elseif arg[i] == '--use-ui' then\
2593 defaultUI = (arg[i+1] or defaultUI)\
2594 elseif arg[i] == \"-l\" or arg[i] == \"--save-log\" then\
2595 saveLog = true\
2596 verbose = true\
2597 elseif arg[i] == \"--no-bar\" then\
2598 allowBarDrawing = false\
2599 elseif arg[i] == \"-v\" or arg[i] == \"--verbose\" then\
2600 verbose = true\
2601 elseif arg[i] == \"--set-delay\" then\
2602 delay = (tonumber(arg[i+1]) or delay)\
2603 end\
2604 end\
2605end\
2606\
2607function os.run( _tEnv, _sPath, ... )\
2608 local tArgs = { ... }\
2609 local tEnv = _tEnv\
2610\
2611 local env = os.getEnvironment()\
2612\
2613 if env then\
2614 for val, name in pairs(env) do\
2615 if not tEnv[name] then\
2616 tEnv[name] = val\
2617 end\
2618 end\
2619 end\
2620\
2621 setmetatable( tEnv, { __index = _G } )\
2622 local fnFile, err = loadfile( _sPath, tEnv )\
2623 if fnFile then\
2624 local ok, err = pcall( function()\
2625 fnFile( table.unpack( tArgs ) )\
2626 end )\
2627 if not ok then\
2628 if err and err ~= \"\" then\
2629 return err\
2630 end\
2631 end\
2632 return nil\
2633 end\
2634 if err and err ~= \"\" then\
2635 return err\
2636 end\
2637end\
2638\
2639local function printLog(txt, color)\
2640 lastLogMsg = txt\
2641 if not showSplash and (not tasks or #tasks == 0) then\
2642 if not color then\
2643 color = colors.white\
2644 end\
2645 term.setTextColor(color)\
2646 print(txt)\
2647 term.setTextColor(colors.white)\
2648 end\
2649 if saveLog then\
2650 local file = oldOpen(\"/System/boot_log.txt\",\"a\")\
2651 file.writeLine(txt)\
2652 file.close()\
2653 end\
2654 if verbose then\
2655 logBuffer[#logBuffer+1] = {text = txt, color = (color or colors.white)}\
2656 end\
2657end\
2658\
2659if saveLog then\
2660 local file = nil\
2661 if fs.exists(\"/System/boot_log.txt\") then\
2662 file = oldOpen(\"/System/boot_log.txt\",\"a\")\
2663 else\
2664 file = oldOpen(\"/System/boot_log.txt\",\"w\")\
2665 end\
2666 file.writeLine(\"\")\
2667 file.writeLine(\"---------------New Boot----------------\")\
2668 file.close()\
2669end\
2670\
2671\
2672printLog(\"Starting...\")\
2673printLog(\"\")\
2674oldLoadAPI(\"/System/Media/bootanimation.lua\")\
2675oldLoadAPI(\"/System/Media/shutanimation.lua\")\
2676\
2677local bootScreen = function()\
2678 if showSplash then\
2679 bootanimation.init()\
2680 end\
2681end\
2682\
2683local function bootAnimation()\
2684 if term.setPaletteColor and showSplash then\
2685 bootanimation.loop()\
2686 end\
2687end\
2688\
2689local shutAnimation = function()\
2690 allowBarDrawing = false\
2691 if term.setPaletteColor and showSplash then\
2692 origin.setCursorBlink(false)\
2693 shutanimation.init()\
2694 shutanimation.loop()\
2695 end\
2696end\
2697\
2698local nativeReboot = os.reboot\
2699os.reboot = function()\
2700 shutAnimation()\
2701 nativeReboot()\
2702 while true do\
2703 coroutine.yield()\
2704 end\
2705end\
2706\
2707local nativeShutdown = os.shutdown\
2708os.shutdown = function()\
2709 shutAnimation()\
2710 nativeShutdown()\
2711 while true do\
2712 coroutine.yield()\
2713 end\
2714end\
2715\
2716local function splash()\
2717 while true do\
2718 if showSplash then\
2719 bootAnimation()\
2720 end\
2721 sleep(0.2)\
2722 end\
2723end\
2724\
2725function boot()\
2726 -------------------------------------------------------------------\
2727 printLog(\"Clearing temporary directory\")\
2728 fs.delete(\"/Temp\")\
2729 fs.makeDir(\"/Temp\")\
2730\
2731 printLog(\"Setting up FS API\")\
2732\
2733 local function checkStoragePath(path)\
2734 if (string.sub(path,1,8) == \"#Storage\" or string.sub(path,1,9) == \"/#Storage\" or string.sub(path,1,10) == \"//#Storage\") then\
2735 return true\
2736 end\
2737 end\
2738\
2739 local function checkResourcesPath(path)\
2740 if (string.sub(path,1,7) == \"#SysRes\" or string.sub(path,1,8) == \"/#SysRes\" or string.sub(path,1,9) == \"//#SysRes\") then\
2741 return true\
2742 end\
2743 end\
2744\
2745 local function checkTempPath(path)\
2746 if (string.sub(path,1,4) == \"#tmp\" or string.sub(path,1,5) == \"/#tmp\" or string.sub(path,1,6) == \"//#tmp\") then\
2747 return true\
2748 end\
2749 end\
2750\
2751 fs.open = function(path,mode)\
2752 if (string.sub(path,1,4) == \"#API\" or string.sub(path,1,5) == \"/#API\" or string.sub(path,1,6) == \"//#API\") and mode == \"r\" then\
2753 path = string.sub(path,string.find(path,\"#API\")+4)\
2754 if oldExist(fs.combine(\"/User/APIs/\", path)) then\
2755 path = fs.combine(\"/User/APIs/\", path)\
2756 elseif oldExist(fs.combine(\"/System/APIs/\", path)) then\
2757 path = fs.combine(\"/System/APIs/\", path)\
2758 end\
2759 elseif checkResourcesPath(path) and mode == \"r\" then\
2760 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2761 elseif checkStoragePath(path) then\
2762 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2763 elseif checkTempPath(path) then\
2764 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2765 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2766 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2767 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2768 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2769 end\
2770 if not currentRunningBackTask and tasks[currentTask] then\
2771 printLog(\"Trying to get access to the file system, access level: \"..tasks[currentTask].access)\
2772 if tasks[currentTask].running then\
2773 tasks[currentTask].running = nil\
2774 end\
2775 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] then\
2776 printLog(\"Trying to get access to the file system from background task, access level: \"..backgroundTasks[currentRunningBackTask].access)\
2777 end\
2778 printLog(\"Opening file - Real file path is: \"..path)\
2779 return oldOpen(path,mode)\
2780 end\
2781\
2782 fs.delete = function(path)\
2783 if checkStoragePath(path) then\
2784 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2785 elseif checkTempPath(path) then\
2786 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2787 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2788 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2789 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2790 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2791 end\
2792 printLog(\"Deleting file - Real file path is: \"..path)\
2793 return oldDel(path)\
2794 end\
2795\
2796 fs.copy = function(path1,path2)\
2797 -- if checkStoragePath(path1) or checkStoragePath(path2) then\
2798 -- if checkStoragePath(path1) then\
2799 -- path1 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path1,\"#Storage\")+8))\
2800 -- end\
2801 -- if checkStoragePath(path2) then\
2802 -- path2 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path2,\"#Storage\")+8))\
2803 -- end\
2804 -- elseif tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2805 -- path1 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path1)\
2806 -- path2 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path2)\
2807 -- end\
2808\
2809 if checkStoragePath(path1) then\
2810 path1 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path1,\"#Storage\")+8))\
2811 elseif checkTempPath(path1) then\
2812 path1 = fs.combine(\"/Temp\",string.sub(path,string.find(path1,\"#tmp\")+4))\
2813 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2814 path1 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path1)\
2815 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2816 path1 = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path1)\
2817 end\
2818\
2819 if checkStoragePath(path2) then\
2820 path2 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path2,\"#Storage\")+8))\
2821 elseif checkTempPath(path2) then\
2822 path2 = fs.combine(\"/Temp\",string.sub(path,string.find(path2,\"#tmp\")+4))\
2823 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2824 path2 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path2)\
2825 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2826 path2 = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path2)\
2827 end\
2828\
2829 return oldCopy(path1,path2)\
2830 end\
2831\
2832 fs.move = function(path1,path2)\
2833 -- if checkStoragePath(path1) or checkStoragePath(path2) then\
2834 -- if checkStoragePath(path1) then\
2835 -- path1 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path1,\"#Storage\")+8))\
2836 -- end\
2837 -- if checkStoragePath(path2) then\
2838 -- path2 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path2,\"#Storage\")+8))\
2839 -- end\
2840 -- elseif tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2841 -- path1 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path1)\
2842 -- path2 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path2)\
2843 -- end\
2844\
2845 if checkStoragePath(path1) then\
2846 path1 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path1,\"#Storage\")+8))\
2847 elseif checkTempPath(path1) then\
2848 path1 = fs.combine(\"/Temp\",string.sub(path,string.find(path1,\"#tmp\")+4))\
2849 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2850 path1 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path1)\
2851 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2852 path1 = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path1)\
2853 end\
2854\
2855 if checkStoragePath(path2) then\
2856 path2 = fs.combine(\"/User/Storage\",string.sub(path2,string.find(path2,\"#Storage\")+8))\
2857 elseif checkTempPath(path2) then\
2858 path2 = fs.combine(\"/Temp\",string.sub(path,string.find(path2,\"#tmp\")+4))\
2859 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2860 path2 = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path2)\
2861 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2862 path2 = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path2)\
2863 end\
2864 return oldMove(path1,path2)\
2865 end\
2866\
2867 fs.makeDir = function(path)\
2868 if checkStoragePath(path) then\
2869 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2870 elseif checkTempPath(path) then\
2871 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2872 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2873 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2874 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2875 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2876 end\
2877 return oldMkdir(path)\
2878 end\
2879\
2880 fs.list = function(path)\
2881 if checkStoragePath(path) then\
2882 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2883 elseif checkResourcesPath(path) then\
2884 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2885 elseif checkTempPath(path) then\
2886 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2887 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2888 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2889 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2890 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2891 end\
2892 return oldList(path)\
2893 end\
2894\
2895 fs.getSize = function(path)\
2896 if checkStoragePath(path) then\
2897 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2898 elseif checkResourcesPath(path) then\
2899 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2900 elseif checkTempPath(path) then\
2901 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2902 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2903 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2904 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2905 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2906 end\
2907 return oldSize(path)\
2908 end\
2909\
2910 fs.isDir = function(path)\
2911 if checkStoragePath(path) then\
2912 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2913 elseif checkResourcesPath(path) then\
2914 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2915 elseif checkTempPath(path) then\
2916 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2917 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2918 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2919 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2920 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2921 end\
2922 return oldDir(path)\
2923 end\
2924\
2925 fs.exists = function(path)\
2926 if checkStoragePath(path) then\
2927 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2928 elseif checkResourcesPath(path) then\
2929 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2930 elseif checkTempPath(path) then\
2931 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2932 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2933 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2934 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2935 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2936 end\
2937 return oldExist(path)\
2938 end\
2939\
2940 fs.getName = function(path)\
2941 if checkStoragePath(path) then\
2942 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2943 elseif checkResourcesPath(path) then\
2944 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2945 elseif checkTempPath(path) then\
2946 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2947 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2948 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2949 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2950 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2951 end\
2952 return oldName(path)\
2953 end\
2954\
2955 fs.getDir = function(path)\
2956 if checkStoragePath(path) then\
2957 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2958 elseif checkResourcesPath(path) then\
2959 path = fs.combine(\"/System/Media\",string.sub(path,string.find(path,\"#SysRes\")+7))\
2960 elseif checkTempPath(path) then\
2961 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2962 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2963 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2964 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2965 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2966 end\
2967 return oldGDir(path)\
2968 end\
2969\
2970 fs.isReadOnly = function(path)\
2971 if checkStoragePath(path) then\
2972 path = fs.combine(\"/User/Storage\",string.sub(path,string.find(path,\"#Storage\")+8))\
2973 elseif checkResourcesPath(path) then\
2974 path = \"/rom/startup.lua\"\
2975 elseif checkTempPath(path) then\
2976 path = fs.combine(\"/Temp\",string.sub(path,string.find(path,\"#tmp\")+4))\
2977 elseif not currentRunningBackTask and tasks[currentTask] and not tasks[currentTask].running and tasks[currentTask].access > 1 then\
2978 path = fs.combine(\"User/Apps/\"..tasks[currentTask].path..\"/Data\",path)\
2979 elseif currentRunningBackTask and backgroundTasks[currentRunningBackTask] and backgroundTasks[currentRunningBackTask].access > 1 then\
2980 path = fs.combine(\"User/Apps/\"..backgroundTasks[currentRunningBackTask].parent..\"/Data\",path)\
2981 end\
2982 return oldReadOnly(path)\
2983 end\
2984\
2985 os.loadAPI = function(_sPath)\
2986 if not _sPath:sub(1,1) ~= \"/\" and not (_sPath:sub(1,4) == \"#API\" or _sPath:sub(1,5) == \"/#API\" or _sPath:sub(1,6) == \"//#API\") then\
2987 _sPath = fs.combine(\"#API\", _sPath)\
2988 end\
2989\
2990 if type( _sPath ) ~= \"string\" then\
2991 error( \"bad argument #1 (expected string, got \" .. type( _sPath ) .. \")\", 2 )\
2992 end\
2993 local sName = fs.getName( _sPath )\
2994 if sName:sub(-4) == \".lua\" or sName:sub(-4) == \".api\" or sName:sub(-4) == \".dll\" or sName:sub(-4) == \".lib\" then\
2995 sName = sName:sub(1,-5)\
2996 end\
2997 if tAPIsLoading[sName] == true then\
2998 printLog( \"API \"..sName..\" is already being loaded\" )\
2999 return false\
3000 end\
3001 tAPIsLoading[sName] = true\
3002\
3003 local tEnv = os.getEnvironment()\
3004 setmetatable( tEnv, { __index = _G } )\
3005 local fnAPI, err = loadfile( _sPath, tEnv )\
3006 if fnAPI then\
3007 local ok, err = pcall( fnAPI )\
3008 if not ok then\
3009 tAPIsLoading[sName] = nil\
3010 printLog(\"API \"..sName..\" error: \"..err..\" | \".._sPath)\
3011 error( err )\
3012 return false\
3013 end\
3014 else\
3015 tAPIsLoading[sName] = nil\
3016 printLog(\"API \"..sName..\" error: \"..err..\" | \".._sPath)\
3017 error( err )\
3018 return false\
3019 end\
3020\
3021 local tAPI = {}\
3022 for k,v in pairs( tEnv ) do\
3023 if k ~= \"_ENV\" then\
3024 tAPI[k] = v\
3025 end\
3026 end\
3027\
3028 _G[sName] = tAPI\
3029 tAPIsLoading[sName] = nil\
3030 return true\
3031 end\
3032\
3033 os.unloadAPI = function( _sName )\
3034 if type( _sName ) ~= \"string\" then\
3035 error( \"bad argument #1 (expected string, got \" .. type( _sName ) .. \")\", 2 )\
3036 end\
3037 if _sName ~= \"_G\" and type(_G[_sName]) == \"table\" then\
3038 _G[_sName] = nil\
3039 end\
3040 end\
3041\
3042 oldLoadAPI(\"/System/APIs/screenworks\")\
3043 oldLoadAPI(\"/System/APIs/images\")\
3044 oldLoadAPI(\"/System/APIs/advanced_read\")\
3045\
3046 os.getSystemAPIs = function()\
3047 return oldList(\"/System/APIs\")\
3048 end\
3049\
3050 os.getUserAPIs = function()\
3051 return oldList(\"User/APIs\")\
3052 end\
3053\
3054 os.getAPIInfo = function(api)\
3055 local info = {}\
3056 local path\
3057 if oldExist(\"/User/APIs/\"..api) then\
3058 path = \"/User/APIs/\"..api\
3059 elseif oldExist(\"/System/APIs/\"..api) then\
3060 path = \"/System/APIs/\"..api\
3061 info.systemAPI = true\
3062 end\
3063 if path then\
3064 --local API = require(path)\
3065 local API = oldOpen(path,\"r\")\
3066 local line = API.readLine()\
3067 if string.sub(line,1,2) == \"--\" then\
3068 info.name = string.sub(line,3)\
3069 else\
3070 info.name = api\
3071 end\
3072 line = API.readLine()\
3073 if string.sub(line,1,2) == \"--\" then\
3074 info.version = string.sub(line,3)\
3075 end\
3076 API.close()\
3077 info.size = oldSize(path)\
3078 API = nil\
3079\
3080 return info\
3081 end\
3082 end\
3083\
3084 os.getOSinfo = function()\
3085 local file = oldOpen(\"/System/Build.info\", \"r\")\
3086 local about = textutils.unserialize(file.readAll())\
3087 file.close()\
3088 return about\
3089 end\
3090\
3091 -----------------------------------------------------------------\
3092 printLog(\"Setting up OS API\")\
3093\
3094 os.setBarColor = function(color)\
3095 if tasks[currentTask] then\
3096 tasks[currentTask].style = color\
3097 end\
3098 end\
3099\
3100 os.sort = function(tbl)\
3101 local tbl = tbl or {}\
3102 table.sort(tbl)\
3103 return tbl\
3104 end\
3105\
3106 local function getSize(path)\
3107 local size = 0\
3108 if oldDir(path) then\
3109 local files = oldList(path)\
3110 for i=1,#files do\
3111 size = size + getSize(fs.combine(path, files[i]))\
3112 end\
3113 else\
3114 size = size + oldSize(path)\
3115 end\
3116 return size\
3117 end\
3118\
3119 os.getAppInfo = function(app, get_Size)\
3120 local path\
3121 local system\
3122 if oldExist(\"/User/Apps/\"..app) then\
3123 path = \"/User/Apps/\"..app..\"/App.info\"\
3124 elseif oldExist(\"/System/Apps/\"..app) then\
3125 path = \"/System/Apps/\"..app..\"/App.info\"\
3126 system = true\
3127 end\
3128 if path then\
3129 local file = oldOpen(path, \"r\")\
3130 local info\
3131 if file then\
3132 info = file.readAll()\
3133 file.close()\
3134 info = textutils.unserialize(info)\
3135 if not info.name then\
3136 info.name = app\
3137 end\
3138 else\
3139 info = {}\
3140 info.name = app\
3141 end\
3142 if not info.version then\
3143 info.version = \"X.0\"\
3144 end\
3145 if not info.developer then\
3146 info.developer = \"Unknown\"\
3147 end\
3148 if get_Size then\
3149 info.size = getSize(string.sub(path,1,#path-8))\
3150 if oldExist(fs.combine(string.sub(path,1,#path-8), \"Data\")) then\
3151 info.dataSize = getSize(fs.combine(string.sub(path,1,#path-8), \"Data\"))\
3152 else\
3153 info.dataSize = 0\
3154 end\
3155 end\
3156 info.systemApp = system\
3157 return info\
3158 end\
3159 end\
3160\
3161 local function getApps(path)\
3162 local apps = oldList(path)\
3163 local i = 1\
3164 while apps[i] do\
3165 local appInfo = os.getAppInfo(apps[i])\
3166 if appInfo and appInfo.hidden then\
3167 table.remove(apps,i)\
3168 else\
3169 i=i+1\
3170 end\
3171 end\
3172 return apps\
3173 end\
3174\
3175 os.getSystemApps = function(withHidden)\
3176 local apps\
3177 if not withHidden then\
3178 withHidden = true\
3179 else\
3180 withHidden = false\
3181 end\
3182 if withHidden then\
3183 return getApps(\"/System/Apps\")\
3184 else\
3185 return oldList(\"/System/Apps\")\
3186 end\
3187 end\
3188\
3189 os.getUserApps = function(withHidden)\
3190 local apps\
3191 if not withHidden then\
3192 apps = getApps(\"/User/Apps\")\
3193 else\
3194 apps = oldList(\"/User/Apps\")\
3195 end\
3196 return apps\
3197 end\
3198\
3199 os.getAppsList = function(withHidden)\
3200 local sysApps = os.getSystemApps(withHidden)\
3201 local usrApps = os.getUserApps(withHidden)\
3202\
3203 local pos = #sysApps\
3204 local inc = 1\
3205 local find\
3206 for i=1,#usrApps do\
3207 find = false\
3208 for j=1,pos do\
3209 if sysApps[j] == usrApps[i] then\
3210 find = true\
3211 break\
3212 end\
3213 end\
3214 local appInfo = os.getAppInfo(usrApps[i])\
3215 if find == false then\
3216 sysApps[pos+inc] = usrApps[i]\
3217 inc = inc + 1\
3218 end\
3219 end\
3220\
3221 return os.sort(sysApps)\
3222 end\
3223\
3224 os.getRunningTasks = function()\
3225 return tasks\
3226 end\
3227\
3228 os.getCurrentTask = function()\
3229 return currentTask\
3230 end\
3231\
3232 os.getFloatingEnabled = function()\
3233 return floatingEnabled\
3234 end\
3235\
3236 os.setFloatingEnabled = function(state)\
3237 floatingEnabled = state\
3238 settings.set(\"os.floatingEnabled\", state)\
3239 settings.save(\"/.settings\")\
3240 end\
3241\
3242 os.getFloatingTime = function()\
3243 return tonumber(floatingTime)\
3244 end\
3245\
3246 os.setFloatingTime = function(time)\
3247 floatingTime = time\
3248 settings.set(\"os.floatingTime\", time)\
3249 settings.save(\"/.settings\")\
3250 end\
3251\
3252 os.pullEvent = function()\
3253 local ev, side, x, y = os.pullEventRaw()\
3254 if ev ~= \"terminate\" then\
3255 return ev, side, x, y\
3256 end\
3257 end\
3258\
3259 local function encrypt(password)\
3260 local new_password = \"\"\
3261 local step = 0\
3262 for i=1,#password do\
3263 step = step+string.byte(string.sub(password,i,i))\
3264 end\
3265 step = math.floor(step/#password)\
3266 local char = \"\"\
3267\
3268 for i=1,#password do\
3269 char = string.sub(password,i,i)\
3270 new_password = new_password..string.char(string.byte(char)+step)\
3271 end\
3272\
3273 return new_password\
3274 end\
3275\
3276 local function decrypt(password,code)\
3277 local new_password = \"\"\
3278 local step = 0\
3279 for i=1,#code do\
3280 step = step+string.byte(string.sub(code,i,i))\
3281 end\
3282 step = math.floor(step/#code)\
3283 local char = \"\"\
3284\
3285 for i=1,#password do\
3286 char = string.sub(password,i,i)\
3287 new_password = new_password..string.char(string.byte(char)-step)\
3288 end\
3289\
3290 return new_password\
3291 end\
3292\
3293 os.printLog = function(txt, app)\
3294 if not app then\
3295 printLog(\"[\"..tasks[currentTask].path..\"] - \"..txt)\
3296 else\
3297 printLog(\"[\"..app..\"] - \"..txt)\
3298 end\
3299 end\
3300\
3301 os.getLastLogMessage = function()\
3302 return lastLogMsg\
3303 end\
3304\
3305 os.getSystemDelay = function()\
3306 return ((delay > 0.05 and delay) or 0.05)\
3307 end\
3308\
3309 os.createAccount = function(userName,password)\
3310 if not oldExist(\"/User/User.info\") and userName and password then\
3311 printLog('Trying to create account \"'..userName..'\"')\
3312 local user = {}\
3313 user.name = userName\
3314 os.setComputerLabel(userName)\
3315 user.password = encrypt(password)\
3316 local file = oldOpen(\"/User/User.info\", \"w\")\
3317 file.write(textutils.serialize(user))\
3318 file.close()\
3319 return true\
3320 end\
3321 end\
3322\
3323 os.changePassword = function(oldPassword,newPassword)\
3324 if oldExist(\"/User/User.info\") and oldPassword and newPassword then\
3325 printLog('Trying to change account password')\
3326 local user = {}\
3327 user.name = \"\"\
3328 user.password = encrypt(newPassword)\
3329\
3330 local file = oldOpen(\"/User/User.info\", \"r\")\
3331 file = textutils.unserialize(file.readAll())\
3332\
3333 if decrypt(file.password,oldPassword) == oldPassword then\
3334 user.name = file.name\
3335 file = oldOpen(\"/User/User.info\", \"w\")\
3336 file.write(textutils.serialize(user))\
3337 file.close()\
3338 printLog(\"Success\")\
3339 return true\
3340 end\
3341 end\
3342 end\
3343\
3344 os.changeName = function(password,newName)\
3345 if oldExist(\"/User/User.info\") and password and newName then\
3346 printLog('Trying to change account name to \"'..newName..'\"')\
3347 local user = {}\
3348 user.name = newName\
3349 os.setComputerLabel(newName)\
3350 user.password = \"\"\
3351\
3352 local file = oldOpen(\"/User/User.info\", \"r\")\
3353 file = textutils.unserialize(file.readAll())\
3354\
3355 if decrypt(file.password,password) == password then\
3356 user.password = file.password\
3357 file = oldOpen(\"/User/User.info\", \"w\")\
3358 file.write(textutils.serialize(user))\
3359 file.close()\
3360 printLog(\"Success\")\
3361 return true\
3362 end\
3363 end\
3364 end\
3365\
3366 os.verifyAccaunt = function(password)\
3367 if oldExist(\"/User/User.info\") and password then\
3368 printLog('Trying to verify account')\
3369 local file = oldOpen(\"/User/User.info\", \"r\")\
3370 local inf = textutils.unserialize(file.readAll())\
3371 file.close()\
3372\
3373 if decrypt(inf.password,password) == password then\
3374 printLog(\"Success\")\
3375 return true\
3376 end\
3377 end\
3378 end\
3379\
3380 os.getImageSize = function(path)\
3381 local file = fs.open(path, \"r\")\
3382 local image = file.readLine()\
3383 local sizeX, sizeY = 0, 0\
3384 while image do\
3385 sizeY = sizeY+1\
3386 if sizeX < #image then\
3387 sizeX = #image\
3388 end\
3389 image = file.readLine()\
3390 end\
3391 file.close()\
3392 return sizeX, sizeY\
3393 end\
3394\
3395 os.advancedRead = advanced_read.read\
3396\
3397 read = function(char)\
3398 local trm = term.current()\
3399 local xSize = trm.getSize()\
3400 local posX, posY = trm.getCursorPos()\
3401 return os.advancedRead(trm, posX, posY, xSize-posX, nil, char)\
3402 end\
3403\
3404 os.getAppIcon = function(app)\
3405 local path\
3406 local img\
3407 if oldExist(\"/User/Apps/\"..app) then\
3408 path = \"/User/Apps/\"..app..\"/App.ico\"\
3409 elseif oldExist(\"/System/Apps/\"..app) then\
3410 path = \"/System/Apps/\"..app..\"/App.ico\"\
3411 else\
3412 path = \"/System/Media/Images/noicon.png\"\
3413 end\
3414 if path then\
3415 local info = oldOpen(path, \"r\")\
3416 if info then\
3417 img = images.loadImage(info)\
3418 --info.close()\
3419 return img\
3420 end\
3421 end\
3422 end\
3423\
3424 os.drawImage = images.draw\
3425\
3426 os.sendNotification = function(icon,header,text,text2,btn_script)\
3427 if tasks[currentRunningTask] and not tasks[currentRunningTask].silentMode then\
3428 notifications[#notifications+1] = {\
3429 icon = (icon or string.char(7)),\
3430 header = (header or tasks[currentRunningTask].name),\
3431 text = (text or \"\"),\
3432 text2 = (text2 or \"\"),\
3433 btn_script = btn_script,\
3434 app = tasks[currentRunningTask].path,\
3435 }\
3436 os.queueEvent(\"system.sendNotification\", notifications[#notifications])\
3437 else\
3438 notifications[#notifications+1] = {\
3439 icon = (icon or string.char(7)),\
3440 header = (header or \"SystemUI\"),\
3441 text = (text or \"\"),\
3442 text2 = (text2 or \"\"),\
3443 btn_script = btn_script,\
3444 app = \"SystemUI\",\
3445 }\
3446 os.queueEvent(\"system.sendNotification\", notifications[#notifications])\
3447 end\
3448 end\
3449\
3450 os.getNotifications = function()\
3451 return (notifications or {})\
3452 end\
3453\
3454 os.removeNotification = function(num)\
3455 if notifications[num] then\
3456 os.queueEvent(\"system.removeNotification\", notifications[num], num)\
3457 table.remove(notifications, num)\
3458 end\
3459 end\
3460\
3461 os.clearNotifications = function()\
3462 if #notifications > 0 then\
3463 notifications = {}\
3464 os.queueEvent(\"system.clearNotifications\")\
3465 end\
3466 end\
3467\
3468 -----------------------------------------------------------------\
3469 printLog(\"Setting up Environment\")\
3470\
3471 shell.getRunningProgram = function()\
3472 if tasks[currentTask].access > 1 then\
3473 return tasks[currentTask].path..\"/Start.x\"\
3474 else\
3475 return \"/System/Apps/\"..tasks[currentTask].path..\"/Start.x\"\
3476 end\
3477 end\
3478\
3479 shell.resolve = function(path)\
3480 if tasks[currentTask].access > 1 then\
3481 return fs.combine(\"/\",path)\
3482 elseif tasks[currentTask].access <= 1 then\
3483 return fs.combine(\"/System/Apps/\"..tasks[currentTask].path,path)\
3484 end\
3485 end\
3486\
3487 shell.path = function()\
3488 return oldPath\
3489 end\
3490\
3491 local securedEnv = {\
3492 oldOpen = oldOpen,\
3493 oldExist = oldExist,\
3494 oldDel = oldDel,\
3495 shell = shell,\
3496 os = os,\
3497 read = read,\
3498 notifications = notifications,\
3499 }\
3500\
3501 sleep(2)\
3502end\
3503\
3504os.getLog = function()\
3505 return logBuffer\
3506end\
3507\
3508os.getErrorBuffer = function()\
3509 return errorBuffer\
3510end\
3511\
3512os.clearErrorBuffer = function()\
3513 errorBuffer = nil\
3514end\
3515\
3516local shellS = shell\
3517\
3518os.getEnvironment = function()\
3519 local nShell = shellS\
3520 local nFS = fs\
3521 local nOS = os\
3522 local nRead = read\
3523 local nNotif = notifications\
3524\
3525 local env = {\
3526 [\"shell\"] = nShell,\
3527 fs = nFS,\
3528 os = nOS,\
3529 read = nRead,\
3530 notifications = nNotif,\
3531 }\
3532 return env\
3533end\
3534\
3535\
3536bootScreen()\
3537parallel.waitForAny(splash,boot)\
3538origin.setPaletteColor(colors.cyan, 0.29, 0.6, 0.69)\
3539\
3540term.redirect(origin)\
3541origin.setBackgroundColor(colors.black)\
3542origin.clear()\
3543\
3544\
3545\
3546os.changeApp = function(name)\
3547 if type(name) == \"string\" then\
3548 for i=1,#tasks do\
3549 if tasks[i].path == name then\
3550 name = i\
3551 break\
3552 end\
3553 end\
3554 end\
3555\
3556 os.queueEvent(\"system.changeApp\", name)\
3557end\
3558\
3559local function changeApp(name)\
3560 if stockPalette then\
3561 tasks[currentTask].palette = {}\
3562 for name, color in pairs(stockPalette) do\
3563 tasks[currentTask].palette[name] = {}\
3564 tasks[currentTask].palette[name][1], tasks[currentTask].palette[name][2], tasks[currentTask].palette[name][3] = tasks[currentTask].screen.getPaletteColor(colors[name])\
3565 end\
3566 end\
3567 tasks[currentTask].screen.setVisible(false)\
3568\
3569 if tasks[name] then\
3570 currentTask = name\
3571 printLog('Trying to change app to \"'..tasks[name].path..'\"')\
3572 os.applyColorPalette(tasks[currentTask].palette, tasks[currentTask].screen)\
3573\
3574 tasks[currentTask].screen.redraw()\
3575 term.redirect(tasks[currentTask].screen)\
3576 tasks[currentTask].error = coroutine.resume(tasks[currentTask].coroutine, \"resume\")\
3577 os.applyColorPalette(tasks[currentTask].palette, tasks[currentTask].screen)\
3578 end\
3579end\
3580\
3581os.closeApp = function(name)\
3582 if type(name)==\"string\" then\
3583 for i=1,#tasks do\
3584 if tasks[i].path == name then\
3585 name = i\
3586 break\
3587 end\
3588 end\
3589 end\
3590\
3591 printLog('Trying to close app \"'..tasks[name].path..'\"')\
3592 os.queueEvent(\"system.closeApp\", name)\
3593 os.applyColorPalette(currentPalette)\
3594end\
3595\
3596local function closeApp(name)\
3597 if name > 1 and tasks[name] then\
3598 local appPath = tasks[name].path\
3599\
3600 os.applyColorPalette(currentPalette)\
3601 if tasks[name].screen then\
3602 tasks[name].screen.setVisible(false)\
3603 end\
3604 tasks[name].screen = nil\
3605\
3606 local i = 1\
3607 while i <= #backgroundTasks do\
3608 if backgroundTasks[i].parent == appPath then\
3609 printLog('[bg:'..appPath..\"#\"..backgroundTasks[i].id..']'..' - Terminated')\
3610 table.remove(backgroundTasks, i)\
3611 else\
3612 i = i+1\
3613 end\
3614 end\
3615\
3616 table.remove(tasks, name)\
3617 if currentTask >= name then\
3618 currentTask = currentTask - 1\
3619 end\
3620 os.applyColorPalette(currentPalette)\
3621 -- tasks[#tasks] = nil\
3622\
3623 printLog('App \"'..appPath..'\" closed')\
3624 else\
3625 printLog('Error, app \"'..appPath..'\" not found or attempt to close Launcher')\
3626 end\
3627end\
3628\
3629os.terminateBackgroundTask = function(id, parent)\
3630 local parent = parent\
3631 if not parent then\
3632 parent = (tasks[currentTask] and tasks[currentTask].path) or \"system\"\
3633 end\
3634 if type(id) == \"string\" then\
3635 for i=1,#backgroundTasks do\
3636 if backgroundTasks[i].parent == parent and backgroundTasks[i].name == id then\
3637 local bid = backgroundTasks[i].id\
3638 table.remove(backgroundTasks, i)\
3639 printLog('[bg:'..parent..\"#\"..bid..']'..' - Terminated')\
3640 break\
3641 end\
3642 end\
3643 elseif type(id) == \"number\" then\
3644 for i=1,#backgroundTasks do\
3645 if backgroundTasks[i].parent == parent and backgroundTasks[i].id == id then\
3646 table.remove(backgroundTasks, i)\
3647 printLog('[bg:'..parent..\"#\"..id..']'..' - Terminated')\
3648 break\
3649 end\
3650 end\
3651 end\
3652end\
3653\
3654os.newBackgroundTask = function(func, name, args)\
3655 local parent\
3656 local access\
3657 local dname\
3658 local func = func\
3659 if tasks[currentTask] then\
3660 parent = tasks[currentTask].path\
3661 access = tasks[currentTask].access\
3662 dname = name or (tasks[currentTask].path..\" process\")\
3663 else\
3664 parent = \"system\"\
3665 access = 1\
3666 dname = name or \"System process\"\
3667 end\
3668\
3669 printLog('Trying to create background task for \"'..parent..'\"')\
3670\
3671 local finded = 0\
3672 for i=1,#backgroundTasks do\
3673 if backgroundTasks[i].parent == parent then\
3674 finded = finded + 1\
3675 end\
3676 end\
3677\
3678 local id = finded+1\
3679\
3680 if type(func) == \"string\" then\
3681 if oldExist(func) then\
3682 local tEnv = os.getEnvironment()\
3683 setmetatable( tEnv, { __index = _G } )\
3684 local newFn, err = loadfile(func, tEnv)\
3685 if newFn then\
3686 func = newFn\
3687 else\
3688 printLog('[bg:'..parent..\"#\"..id..']'..' - Error: '..err)\
3689 return\
3690 end\
3691 else\
3692 printLog('[bg:'..parent..\"#\"..id..']'..' - Unable to find background function')\
3693 return\
3694 end\
3695 end\
3696\
3697 if parent ~= \"system\" and finded > backgroundTasksPerApp then\
3698 printLog('['..parent..']'..' - Number of allowed background tasks exceeded')\
3699 return\
3700 end\
3701\
3702 printLog('['..parent..']'..' - Creating background task with access level: '..access)\
3703\
3704 local bgid = #backgroundTasks+1\
3705 backgroundTasks[bgid] = {\
3706 parent = parent,\
3707 access = access,\
3708 id = id,\
3709 name = dname,\
3710 coroutine = coroutine.create(function()\
3711 -- func(unpack(args or {}))\
3712 local ok, err = pcall(func)\
3713 if not ok then\
3714 printLog('[bg:'..parent..\"#\"..id..']'..' - Error: '..err)\
3715 end\
3716 for i=1,#backgroundTasks do\
3717 if backgroundTasks[i].parent == info.parent and backgroundTasks[i].id == info.id then\
3718 table.remove(backgroundTasks, i)\
3719 break\
3720 end\
3721 end\
3722 printLog('[bg:'..parent..\"#\"..id..']'..' - Terminated')\
3723 coroutine.yield()\
3724 end)\
3725 }\
3726end\
3727\
3728os.runApp = function(name, args)\
3729 if not name then\
3730 return nil\
3731 end\
3732\
3733 local findApp\
3734 local path\
3735 local name = name\
3736\
3737 printLog('Trying to run app \"'..name..'\"')\
3738 if oldExist(\"User/Apps/\"..name) and oldDir(\"/User/Apps/\"..name) then\
3739 findApp = 2\
3740 path = \"/User/Apps/\"..name..\"/Start.x\"\
3741 elseif oldExist(\"/System/Apps/\"..name) and oldDir(\"/System/Apps/\"..name) then\
3742 findApp = 1\
3743 path = \"/System/Apps/\"..name..\"/Start.x\"\
3744 else\
3745 printLog('['..name..']'..' - App not found')\
3746 end\
3747\
3748 for i=1,#tasks do\
3749 if tasks[i].path == name then\
3750 printLog('App \"'..name..'\" already running')\
3751 os.changeApp(i)\
3752 return nil\
3753 end\
3754 end\
3755\
3756 printLog('['..name..']'..' - Access level: '..findApp)\
3757 os.queueEvent(\"system.runApp\", {path = path, access = findApp, name = name}, args)\
3758end\
3759\
3760local function runApp(info, args)\
3761 local error\
3762 local path = info.path\
3763 local findApp = info.access\
3764 local name = info.name\
3765\
3766 if findApp ~= nil then\
3767 local function run()\
3768 if not args then\
3769 args = {}\
3770 end\
3771 term.redirect(tasks[currentTask].screen)\
3772 tasks[currentTask].palette = currentPalette\
3773\
3774 local taskNum = currentTask\
3775 os.applyColorPalette(currentPalette, tasks[currentTask].screen)\
3776\
3777 local env = os.getEnvironment()\
3778 printLog('['..name..']'..\" - Trying to execute main file\")\
3779 error = os.run(env, path, unpack(args))\
3780\
3781 if error then\
3782 printLog('Error in app \"'..name..'\": '..error)\
3783 errorBuffer = {app = name, error = error}\
3784 end\
3785 printLog('App \"'..name..'\" had been terminated')\
3786 for i=1,#tasks do\
3787 if tasks[i].path == path then\
3788 os.closeApp(i)\
3789 break\
3790 end\
3791 end\
3792 coroutine.yield()\
3793 end\
3794\
3795 local info = os.getAppInfo(name)\
3796\
3797 tasks[#tasks+1] = {}\
3798 currentTask = #tasks\
3799 tasks[currentTask].name = info.name\
3800 tasks[currentTask].path = name\
3801\
3802 tasks[currentTask].screen = window.create(first, appPosX, appPosY, appSizeX, appSizeY)\
3803\
3804 term.redirect(tasks[currentTask].screen)\
3805 tasks[currentTask].coroutine = coroutine.create(run)\
3806\
3807 tasks[currentTask].access = findApp\
3808 tasks[currentTask].running = true\
3809 term.redirect(tasks[currentTask].screen)\
3810 tasks[currentTask].error = coroutine.resume(tasks[currentTask].coroutine, \"resume\")\
3811 tasks[currentTask].running = nil\
3812 if tasks[currentTask].coroutine and not error then\
3813 printLog('['..name..']'..\" - Success\")\
3814 term.redirect(tasks[currentTask].screen)\
3815 if not tasks[currentTask].style then\
3816 tasks[currentTask].style = term.getBackgroundColor()\
3817 end\
3818 tasks[currentTask].access = findApp\
3819 end\
3820 os.applyColorPalette(currentPalette, tasks[currentTask].screen)\
3821 else\
3822 printLog(\"Can't \"..'find app \"'..name..'\"')\
3823 end\
3824end\
3825\
3826local function resetAppCursor()\
3827 if tasks[currentTask] and tasks[currentTask].screen then\
3828 local _x, _y\
3829 local txColor, bgColor\
3830\
3831 _x, _y = tasks[currentTask].screen.getCursorPos()\
3832 txColor, bgColor = tasks[currentTask].screen.getTextColor(), tasks[currentTask].screen.getBackgroundColor()\
3833\
3834 if _x and _y then\
3835 origin.setCursorPos(_x, _y)\
3836 origin.setTextColor(txColor)\
3837 origin.setBackgroundColor(bgColor)\
3838 end\
3839 end\
3840end\
3841\
3842local function input()\
3843 local event, side, x, y, z\
3844\
3845 while true do\
3846 currentRunningTask = nil\
3847 press_mod = nil\
3848 term.redirect(origin)\
3849 event, side, x, y, z = os.pullEvent()\
3850\
3851 for i=1,#backgroundTasks do\
3852 if backgroundTasks[i] and backgroundTasks[i].coroutine then\
3853 currentRunningBackTask = i\
3854 coroutine.resume(backgroundTasks[i].coroutine, event, side, x, y, z)\
3855 end\
3856 end\
3857 currentRunningBackTask = nil\
3858\
3859 if event == \"system.closeApp\" then\
3860 if side ~= \"System UI\" and side > 1 then\
3861 closeApp(side)\
3862 term.redirect(origin)\
3863 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3864 end\
3865 elseif event == \"system.runApp\" then\
3866 runApp(side, x)\
3867 term.redirect(origin)\
3868 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3869 elseif event == \"system.changeApp\" then\
3870 changeApp(side)\
3871 term.redirect(origin)\
3872 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3873 elseif event == \"system.sendNotification\" then\
3874 term.redirect(origin)\
3875 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3876 elseif event == \"system.removeNotification\" then\
3877 term.redirect(origin)\
3878 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3879 elseif event == \"system.clearNotifications\" then\
3880 term.redirect(origin)\
3881 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3882 elseif event == \"system.newBackgroundTask\" then\
3883 term.redirect(origin)\
3884 ui_state = coroutine.resume(ui_routine, event, side, x, y, z)\
3885 else\
3886 term.redirect(origin)\
3887 ui_state, press_mod = coroutine.resume(ui_routine, event, side, x, y, z)\
3888 if ui_state and not did_mod and not press_mod and tasks[currentTask] and tasks[currentTask].screen then\
3889 currentRunningTask = currentTask\
3890 tasks[currentTask].screen.setVisible(true)\
3891 term.redirect(tasks[currentTask].screen)\
3892 coroutine.resume(tasks[currentTask].coroutine, event, side, x, y, z)\
3893 resetAppCursor()\
3894 end\
3895 end\
3896 end\
3897end\
3898\
3899local function updateApps()\
3900 while allowBarDrawing do\
3901 currentRunningTask = nil\
3902 currentRunningBackTask = nil\
3903\
3904 for i=1,#backgroundTasks do\
3905 if backgroundTasks[i] and backgroundTasks[i].coroutine then\
3906 currentRunningBackTask = i\
3907 coroutine.resume(backgroundTasks[i].coroutine)\
3908 -- local status = coroutine.status(backgroundTasks[i].coroutine)\
3909 -- printLog(\"[Background] - \"..status)\
3910 -- coroutine.yield()\
3911 -- sleep(delay)\
3912 end\
3913 end\
3914 currentRunningBackTask = nil\
3915\
3916 term.redirect(origin)\
3917 ui_state = coroutine.resume(ui_routine, \"resume\")\
3918 -- sleep(delay)\
3919 if ui_state and not did_mod and tasks[currentTask] and tasks[currentTask].screen then\
3920 currentRunningTask = currentTask\
3921 if tasks[currentTask].coroutine and coroutine.status(tasks[currentTask].coroutine) ~= \"dead\" then\
3922 tasks[currentTask].screen.setVisible(true)\
3923 term.redirect(tasks[currentTask].screen)\
3924 coroutine.resume(tasks[currentTask].coroutine, \"resume\")\
3925 else\
3926 os.closeApp(currentTask)\
3927 end\
3928 end\
3929 resetAppCursor()\
3930 sleep(delay)\
3931 end\
3932end\
3933\
3934ui_routine = coroutine.create(function()\
3935 local path\
3936 if oldExist(\"/User/Apps/\"..defaultUI) then\
3937 path = \"/User/Apps/\"..defaultUI\
3938 elseif oldExist(\"/System/Apps/\"..defaultUI) then\
3939 path = \"/System/Apps/\"..defaultUI\
3940 else\
3941 printLog(\"Cant't boot. Unable to find System UI app\")\
3942 errorBuffer = {app = \"System UI\", error = \"Unable to find System UI app\"}\
3943 os.queueEvent(\"system.closeApp\", \"System UI\")\
3944 end\
3945 local err = os.run({setDidState = function(state) did_mod = state end}, path..\"/Start.x\")\
3946 if err then\
3947 if err then\
3948 printLog('Error in app System UI: '..err)\
3949 errorBuffer = {app = \"System UI\", error = err}\
3950 os.queueEvent(\"system.closeApp\", \"System UI\")\
3951 end\
3952 printLog(\"System UI had been terminated\")\
3953 end\
3954end)\
3955\
3956printLog(\"Trying to run System UI\")\
3957ui_state, appPosX, appPosY, appSizeX, appSizeY = coroutine.resume(ui_routine)\
3958appPosX, appPosY, appSizeX, appSizeY = appPosX or 1, appPosY or 1, appSizeX or xSize, appSizeY or ySize\
3959os.runApp(defaultLauncher)\
3960\
3961parallel.waitForAny(input,updateApps)",
3962 Scripts = {
3963 [ "update_checker.lua" ] = "local delay = 60 * 30\
3964local longMult = 2\
3965local currentOS = os.getOSinfo()\
3966local lastInfo\
3967os.printLog(\"Running\", \"bg:UpdateService\")\
3968\
3969local runSettings = function()\
3970 os.runApp(\"Settings\", {\"updates\"})\
3971end\
3972\
3973local sent = false\
3974while true do\
3975 if not sent then\
3976 os.printLog(\"Downloading last verion info\", \"bg:UpdateService\")\
3977 http.request(\"https://pastebin.com/raw/e59XLpie\")\
3978 sent = true\
3979 else\
3980 local event, url, text = os.pullEvent()\
3981 if event == \"http_success\" then\
3982 os.printLog(\"Checking updates\", \"bg:UpdateService\")\
3983 if text then\
3984 local lastInfo = text.readAll()\
3985 text.close()\
3986 if lastInfo then\
3987 lastInfo = textutils.unserialize(lastInfo)\
3988 if currentOS.OSversion < lastInfo.OSversion then\
3989 os.printLog(\"New verion of OS available \", \"bg:UpdateService\")\
3990 os.sendNotification(string.char(25), \"OS update\", \"Cur ver: \"..currentOS.OSversion, \"Last ver: \"..lastInfo.OSversion, runSettings)\
3991 else\
3992 os.printLog(\"No updates available\", \"bg:UpdateService\")\
3993 end\
3994 else\
3995 os.printLog(\"Reading info error\", \"bg:UpdateService\")\
3996 end\
3997 else\
3998 os.printLog(\"Unable to connect to the Internet\", \"bg:UpdateService\")\
3999 end\
4000 sleep(delay)\
4001 sent = false\
4002 elseif event == \"http_failure\" then\
4003 os.printLog(\"Unable to connect to the Internet\", \"bg:UpdateService\")\
4004 sleep(delay * longMult)\
4005 sent = false\
4006 end\
4007 end\
4008end",
4009 [ "rm.lua" ] = "local args = {...}\
4010\
4011if args[1] then\
4012 if fs.exists(args[1]) then\
4013 if args[1]:sub(1,6) == \"System\" or args[1]:sub(1,7) == \"/System\" or args[1]:sub(1,8) == \"//System\" then\
4014 print(\" This action may cause system failure. Are you sure you want to proceed?\")\
4015 term.write(\"[y/N]: \")\
4016 local ans = read()\
4017 if ans ~= \"y\" and ans ~= \"Y\" then\
4018 print(\" \")\
4019 print(\" \")\
4020 return nil\
4021 end\
4022 end\
4023 fs.delete(args[1])\
4024 print(args[1]..\" deleted\")\
4025 print(\" \")\
4026 else\
4027 print(\"No such file or directory\")\
4028 end\
4029else\
4030 print(\"Usage: rm <path>\")\
4031end",
4032 [ "createSystemImage.lua" ] = "local args = {...}\
4033print(\"System image creator\")\
4034\
4035local check = 1\
4036local final_path = \"#tmp/sysimage.info\"\
4037\
4038local function backup(chto,vochto)\
4039 print(\"Creating system image in \"..vochto)\
4040\
4041 local Massiv2 = {}\
4042 local function FileList(path)\
4043 local Massiv = fs.list(path)\
4044 print(path)\
4045 if #Massiv==0 then\
4046 local Massiv2Id = #Massiv2 + 1\
4047 Massiv2[Massiv2Id] = {}\
4048 Massiv2[Massiv2Id][\"path\"] = path\
4049 else\
4050 if check == 0 then\
4051 for i=1,#Massiv do\
4052 if fs.isDir(fs.combine(path, Massiv[i])) and (fs.combine(path, Massiv[i]) == \"Temp\" or fs.combine(path, Massiv[i]) == \"User/APIs\" or fs.combine(path, Massiv[i]) == \"User/Apps\" or fs.combine(path, Massiv[i]) == \"User/Storage\") then\
4053 local Massiv2Id = #Massiv2 + 1\
4054 Massiv2[Massiv2Id] = {}\
4055 Massiv2[Massiv2Id][\"path\"] = fs.combine(path, Massiv[i])\
4056 elseif fs.isDir(fs.combine(path, Massiv[i])) and fs.combine(path, Massiv[i]) ~= \"rom\" then\
4057 FileList(fs.combine(path, Massiv[i]))\
4058 elseif not fs.isDir(fs.combine(path, Massiv[i])) and fs.combine(path, Massiv[i]) ~= final_path then\
4059 local Massiv2Id = #Massiv2 + 1\
4060 Massiv2[Massiv2Id] = {}\
4061 Massiv2[Massiv2Id][\"path\"] = fs.combine(path, Massiv[i])\
4062 local file = fs.open(fs.combine(path, Massiv[i]),\"r\")\
4063 Massiv2[Massiv2Id][\"text\"] = file.readAll()\
4064 file.close()\
4065 end\
4066 end\
4067 elseif check == 1 then\
4068 for i=1,#Massiv do\
4069 if fs.isDir(fs.combine(path, Massiv[i])) and fs.combine(path, Massiv[i]) == \"Temp\" then\
4070 local Massiv2Id = #Massiv2 + 1\
4071 Massiv2[Massiv2Id] = {}\
4072 Massiv2[Massiv2Id][\"path\"] = fs.combine(path, Massiv[i])\
4073 elseif fs.isDir(fs.combine(path, Massiv[i])) and fs.combine(path, Massiv[i]) ~= \"rom\"then\
4074 FileList(fs.combine(path, Massiv[i]))\
4075 elseif not fs.isDir(fs.combine(path, Massiv[i])) and fs.combine(path, Massiv[i]) ~= final_path then\
4076 local Massiv2Id = #Massiv2 + 1\
4077 Massiv2[Massiv2Id] = {}\
4078 Massiv2[Massiv2Id][\"path\"] = fs.combine(path, Massiv[i])\
4079 local file = fs.open(fs.combine(path, Massiv[i]),\"r\")\
4080 Massiv2[Massiv2Id][\"text\"] = file.readAll()\
4081 file.close()\
4082 end\
4083 end\
4084 end\
4085 end\
4086 end\
4087\
4088 FileList(chto)\
4089 file=fs.open(vochto,\"w\")\
4090 file.write(textutils.serialise(Massiv2))\
4091 file.close()\
4092 return Massiv2\
4093end\
4094\
4095if args then\
4096 for i=1,#args do\
4097 if args[i] == '--system-only' or args[i] == '-s' then\
4098 check = 0\
4099 elseif args[i] == '--all-data' or args[i] == '-a' then\
4100 check = 1\
4101 else\
4102 final_path = args[i]\
4103 end\
4104 end\
4105\
4106 backup(\"/\", final_path)\
4107else\
4108 print(\" Arguments: --system-only (-s), --all-data (-a)\")\
4109 print(\" Usage: <output path> [arguments]\")\
4110end",
4111 [ "account.lua" ] = "local args = {...}\
4112\
4113if args[1] == \"changeName\" then\
4114 term.write(\"Password: \")\
4115 local name = \"\"\
4116 local pass = read(\"*\")\
4117 if os.verifyAccaunt(pass) then\
4118 term.write(\"New name: \")\
4119 name = read()\
4120 print(\"\")\
4121 local change = os.changeName(pass,name)\
4122 if change then\
4123 term.setTextColor(colors.green)\
4124 print(\"Done\")\
4125 else\
4126 term.setTextColor(colors.red)\
4127 print(\"Error\")\
4128 end\
4129 else\
4130 term.setTextColor(colors.red)\
4131 print(\"Incorrect password\")\
4132 end\
4133 sleep(0.5)\
4134end",
4135 [ "ls.lua" ] = "local args = {...}\
4136\
4137local path = place()\
4138local canRun = true\
4139\
4140local function getType(txt)\
4141 local i = #txt\
4142 while string.sub(txt,i,i) ~= \".\" and i > 0 do\
4143 i=i-1\
4144 end\
4145 if i > 0 then\
4146 txt = string.sub(txt,i+1)\
4147 return txt\
4148 else\
4149 return \"nope#\"\
4150 end\
4151end\
4152\
4153if args[1] then\
4154 if string.sub(args[1],1,1) == \"/\" then\
4155 path = args[1]\
4156 elseif string.sub(args[1],1,2) == \"..\" then\
4157 local i = #path\
4158 while string.sub(path,i,i) ~= \"/\" and i > 0 do\
4159 i=i-1\
4160 end\
4161 if i > 1 then\
4162 path = string.sub(path,0,i)\
4163 else\
4164 path = \"/\"\
4165 end\
4166 args[1] = string.sub(args[1],3)\
4167 path = fs.combine(path,args[1])\
4168 else\
4169 path = fs.combine(path,args[1])\
4170 end\
4171\
4172 if not fs.exists(path) then\
4173 term.setTextColor(colors.red)\
4174 print(\"Can't find \"..path)\
4175 canRun = false\
4176 elseif fs.exists(path) and not fs.isDir(path) then\
4177 term.setTextColor(colors.red)\
4178 print(path..\" not a directory\")\
4179 canRun = false\
4180 end\
4181end\
4182\
4183if canRun then\
4184 local list = os.sort(fs.list(path))\
4185 local sort = {}\
4186 sort.dir = {}\
4187 local sortWords = {}\
4188\
4189 for i=1,#list do\
4190 if fs.isDir(fs.combine(path,list[i])) then\
4191 --term.setTextColor(colors.cyan)\
4192 sort.dir[#sort.dir+1] = list[i]\
4193 else\
4194 --term.setTextColor(colors.white)\
4195 local type = getType(list[i])\
4196 if not sort[type] then\
4197 sort[type] = {}\
4198 end\
4199 sort[type][#sort[type]+1] = list[i]\
4200 local find = false\
4201 for i=1,#sortWords do\
4202 if sortWords[i] == type then\
4203 find = true\
4204 break\
4205 end\
4206 end\
4207 if not find then\
4208 sortWords[#sortWords+1] = type\
4209 end\
4210 end\
4211 --print(list[i])\
4212 end\
4213\
4214 sortWords = os.sort(sortWords)\
4215 sort.dir = os.sort(sort.dir)\
4216\
4217 for i=1,#sortWords do\
4218 sort[sortWords[i]] = os.sort(sort[sortWords[i]])\
4219 end\
4220\
4221 term.setTextColor(colors.cyan)\
4222 for i=1,#sort.dir do\
4223 print(sort.dir[i])\
4224 end\
4225\
4226 for i=1,#sortWords do\
4227 if sortWords[i] == \"x\" or sortWords[i] == \"lua\" or sortWords[i] == \"exe\" or sortWords[i] == \"sh\" then\
4228 term.setTextColor(colors.orange)\
4229 elseif sortWords[i] == \"txt\" or sortWords[i] == \"info\" or sortWords[i] == \"cfg\" or sortWords[i] == \"m\" or sortWords[i] == \"ini\" or sortWords[i] == \"inf\" then\
4230 term.setTextColor(colors.yellow)\
4231 elseif sortWords[i] == \"png\" or sortWords[i] == \"skch\" or sortWords[i] == \"nfp\" or sortWords[i] == \"nft\" or sortWords[i] == \"ico\" then\
4232 term.setTextColor(colors.lightBlue)\
4233 elseif sortWords[i] == \"mp3\" or sortWords[i] == \"wav\" or sortWords[i] == \"ogg\" or sortWords[i] == \"flac\" or sortWords[i] == \"sspro\" then\
4234 term.setTextColor(colors.brown)\
4235 else\
4236 term.setTextColor(colors.white)\
4237 end\
4238\
4239 for j=1,#sort[sortWords[i]] do\
4240 print(sort[sortWords[i]][j])\
4241 end\
4242 end\
4243\
4244end",
4245 [ "run.lua" ] = "local args = {...}\
4246\
4247if args[1] then\
4248 local app = args[1]\
4249 for i=1, #args do\
4250 args[i] = args[i+1]\
4251 end\
4252 os.runApp(app, args)\
4253else\
4254 print(\"Usage: run <app name> [argument1] [argument2] ...\")\
4255end",
4256 [ "dmesg.lua" ] = "local logBuffer = os.getLog()\
4257local startFrom = 1\
4258if #logBuffer > 100 then\
4259 startFrom = #logBuffer-99\
4260end\
4261\
4262term.setTextColor(colors.white)\
4263print(\"Log output:\")\
4264print(\"\")\
4265\
4266for i=startFrom, #logBuffer do\
4267 term.setTextColor(colors.white)\
4268 term.write(\"[\"..i..\"] \")\
4269 term.setTextColor(logBuffer[i].color or colors.white)\
4270 print(logBuffer[i].text)\
4271end",
4272 [ "pcm.lua" ] = "local args = {...}\
4273\
4274if args[1] then\
4275 os.runApp(\"PacketManager\", args)\
4276else\
4277 local info = os.getAppInfo(\"PacketManager\")\
4278 if info then\
4279 print(\" \")\
4280 print(info.name..\" version: \"..info.version)\
4281 print(\" \")\
4282 print(\"Arguments:\")\
4283 print(\" install <path>\")\
4284 print(\" remove <packet name>\")\
4285 print(\" create <project folder> <output folder> <packet name>\")\
4286 print(\" \")\
4287 else\
4288 print(\"Packet Manager not installed\")\
4289 end\
4290end",
4291 },
4292 Apps = {
4293 Logger = {
4294 [ "Start.x" ] = "local xSize, ySize = term.getSize()\
4295os.loadAPI(\"#API/screenworks\")\
4296\
4297os.setBarColor(colors.black)\
4298\
4299local screen = screenworks.newScreen(colors.lightGray,colors.black, colors.cyan,colors.gray, \"Logger\")\
4300\
4301local num = 0\
4302\
4303local function events()\
4304 while true do\
4305 local event, side, x, y = os.pullEvent()\
4306\
4307 if event == \"mouse_scroll\" then\
4308 screen.scroll(-side)\
4309 end\
4310 end\
4311end\
4312\
4313local logging = function()\
4314 local msg = \"\"\
4315 local i = 1\
4316 local pos = 2\
4317\
4318 while true do\
4319 local event = os.pullEvent()\
4320 if os.getLastLogMessage() ~= msg then\
4321 msg = os.getLastLogMessage()\
4322\
4323 if pos > ySize-4 then\
4324 screen.resize(pos+4)\
4325 end\
4326\
4327 term.redirect(screen.body)\
4328 term.setCursorPos(2, pos)\
4329 term.write(\"[\"..i..\"] \")\
4330 print(msg)\
4331\
4332 _, pos = term.getCursorPos()\
4333 -- pos = pos+1\
4334 i = i + 1\
4335 end\
4336 end\
4337end\
4338\
4339os.newBackgroundTask(logging, \"Log grubber\")\
4340events()\
4341-- wait()\
4342-- parallel.waitForAll(events, wait)",
4343 [ "App.info" ] = "{\
4344 name = \"Logger\",\
4345 version = \"0.1\",\
4346 developer = \"DECE\",\
4347}",
4348 [ "App.ico" ] = " 90 90 90 90 90 90\
4349 9000909000 90\
4350 90 90O90S90 90 90\
4351 90 90 90 90 90 90",
4352 },
4353 Launcher = {
4354 [ "Start.x" ] = "os.printLog(\"Running\")\
4355\
4356local mon = peripheral.wrap(\"top\")\
4357\
4358local xSize, ySize = term.getSize()\
4359local selector = 1\
4360\
4361local clear = function(color)\
4362 term.setBackgroundColor(color)\
4363 term.clear()\
4364 term.setCursorPos(1,1)\
4365end\
4366\
4367local text = function(string,xPos,yPos)\
4368 term.setCursorPos(xPos,yPos)\
4369 term.write(string)\
4370end\
4371\
4372local about = fs.open(shell.resolve(\"App.info\"), \"r\")\
4373about = textutils.unserialize(about.readAll())\
4374\
4375local apps = os.getAppsList()\
4376local appsInfo = {}\
4377for i,app in ipairs(apps) do\
4378 appsInfo[i] = os.getAppInfo(app)\
4379end\
4380\
4381local function redraw()\
4382 clear(colors.white)\
4383\
4384 for i=1,#apps do\
4385 if i == selector then\
4386 term.setTextColor(colors.cyan)\
4387 else\
4388 term.setTextColor(colors.lightGray)\
4389 end\
4390 -- appInfo = os.getAppInfo(apps[i])\
4391 if appsInfo[i] and appsInfo[i].name then\
4392 text(i..' '..appsInfo[i].name,2,i+1)\
4393 else\
4394 text(i..' '..apps[i],2,i+1)\
4395 end\
4396 end\
4397\
4398 term.setTextColor(colors.lightGray)\
4399 text(about.name..\" v\"..about.version,2,ySize)\
4400end\
4401\
4402redraw()\
4403\
4404while true do\
4405 local event, side, x, y = os.pullEvent()\
4406\
4407 if event == \"char\" then\
4408 if side >= '1' and side <= '9' then\
4409 os.runApp(apps[tonumber(side)])\
4410 elseif side == \"r\" then\
4411 apps = os.getAppsList()\
4412 appsInfo = {}\
4413 for i,app in ipairs(apps) do\
4414 appsInfo[i] = os.getAppInfo(app)\
4415 end\
4416 redraw()\
4417 end\
4418 elseif event == \"key\" then\
4419 if side == keys.up and selector > 1 then\
4420 selector = selector - 1\
4421 redraw()\
4422 elseif side == keys.down and selector < #apps then\
4423 selector = selector + 1\
4424 redraw()\
4425 elseif side == keys.enter then\
4426 os.runApp(apps[tonumber(selector)])\
4427 end\
4428 elseif event == \"mouse_click\" then\
4429 os.runApp(apps[tonumber(selector)])\
4430 elseif event == \"mouse_scroll\" then\
4431 if side == -1 and selector > 1 then\
4432 selector = selector - 1\
4433 redraw()\
4434 elseif side == 1 and selector < #apps then\
4435 selector = selector + 1\
4436 redraw()\
4437 end\
4438 end\
4439\
4440 --redraw()\
4441end",
4442 [ "App.info" ] = "{\
4443 name = \"Simple Launcher\",\
4444 version = \"0.2\",\
4445 developer = \"DECE\",\
4446 hidden = true,\
4447}",
4448 [ "App.ico" ] = " 90 90 90 90 90 90\
4449 9000909000 90\
4450 90 90O90S90 90 90\
4451 90 90 90 90 90 90",
4452 },
4453 ScriptRunner = {
4454 [ "App.info" ] = "{\
4455 name = \"Script runner\",\
4456 version = \"0.1\",\
4457 developer = \"DECE\",\
4458 hidden = true,\
4459}",
4460 [ "Start.x" ] = "local args = {...}\
4461\
4462local xSize, ySize = term.getSize()\
4463\
4464term.setBackgroundColor(colors.black)\
4465term.setTextColor(colors.white)\
4466term.clear()\
4467term.setCursorPos(1,1)\
4468\
4469local path = args[1]\
4470local scriptArgs\
4471\
4472local function strToTable(str)\
4473 local tbl = {}\
4474 local wrd = \"\"\
4475 for i=1,#str do\
4476 local chr = string.sub(str,i,i)\
4477 if chr == \" \" then\
4478 tbl[#tbl+1] = wrd\
4479 wrd = \"\"\
4480 else\
4481 wrd = wrd..chr\
4482 end\
4483 end\
4484 tbl[#tbl+1] = wrd\
4485 return tbl\
4486end\
4487\
4488local function execute(path, args)\
4489 local errors = os.run(os.getEnvironment(), path, args and unpack(args))\
4490\
4491 term.setBackgroundColor(colors.black)\
4492 term.setTextColor(colors.white)\
4493 term.setCursorPos(xSize,ySize)\
4494 print(\"\")\
4495 print(\"Execution completed\")\
4496 if errors then\
4497 print(\"\")\
4498 term.setTextColor(colors.red)\
4499 print(\"Error: \"..errors)\
4500 end\
4501\
4502 while true do\
4503 local event = os.pullEvent()\
4504 if event == \"key\" or event == \"mouse_click\" or event == \"suspend\" then\
4505 break\
4506 end\
4507 end\
4508end\
4509\
4510if path then\
4511\
4512 if #args > 1 then\
4513 scriptArgs = {}\
4514 for i=1, #args do\
4515 scriptArgs[#scriptArgs+1] = args[i]\
4516 end\
4517 end\
4518\
4519 execute(path, scriptArgs)\
4520else\
4521 local text\
4522 while not text or #text < 1 or text ~= {} do\
4523 print(\"Input script path and arguments:\")\
4524 term.setCursorPos(2,2)\
4525 text = strToTable(read())\
4526 local path = text[1]\
4527 if path then\
4528 if #text > 1 then\
4529 scriptArgs = {}\
4530 for i=1, #text do\
4531 scriptArgs[#scriptArgs+1] = text[i]\
4532 end\
4533 end\
4534\
4535 execute(path, scriptArgs)\
4536 break\
4537 end\
4538 end\
4539end",
4540 },
4541 PacketManager = {
4542 [ "App.info" ] = "{\
4543 name = \"Packet Manager\",\
4544 version = \"0.1\",\
4545 developer = \"DECE\",\
4546 hidden = true,\
4547}",
4548 [ "Start.x" ] = "local args = {...}\
4549os.loadAPI(\"#API/screenworks\")\
4550\
4551local screen = screenworks.newScreen(colors.black, colors.white, colors.cyan, colors.white, \"Packet Manager\")\
4552local xSize, ySize = screen.body.getSize()\
4553\
4554local function getPackInfo(path)\
4555 local file = fs.open(path, \"r\")\
4556 if file then\
4557 local info = file.readAll()\
4558 info = textutils.unserialize(info)\
4559 file.close()\
4560\
4561 return info\
4562 end\
4563end\
4564\
4565local function unpackApp(packInfo)\
4566 local Massiv = packInfo.files\
4567 local progressBar = screen.newProgressBar(xSize/4+2, ySize/2+3, xSize/2, 0, colors.cyan)\
4568 local path = \"/User/Apps/\"..packInfo.path\
4569 for i=1,#Massiv do\
4570 if Massiv[i][\"text\"] == \"@empty@empty\" then\
4571 fs.makeDir(path..\"/\"..Massiv[i][\"path\"])\
4572 else\
4573 local file = fs.open(path..\"/\"..Massiv[i][\"path\"],\"w\")\
4574 file.write(Massiv[i][\"text\"])\
4575 file.close()\
4576 end\
4577 progressBar.setPercent((i/#Massiv)*100)\
4578 sleep(0)\
4579 end\
4580 local file = fs.open(path..\"/\"..\"App.info\", \"w\")\
4581 file.write(textutils.serialize(packInfo.info))\
4582 file.close()\
4583end\
4584\
4585local function packApp(path, output, name)\
4586 local file = fs.open(path..\"/App.info\", \"r\")\
4587\
4588 if file then\
4589 local info = file.readAll()\
4590 info = textutils.unserialize(info)\
4591 file.close()\
4592\
4593 local progressBar = screen.newProgressBar(xSize/4+2, ySize/2+3, xSize/2, 0, colors.cyan)\
4594\
4595 local out = {}\
4596 out.info = info\
4597\
4598 local Massiv2 = {}\
4599 local function FileList(path, fPath)\
4600 local Massiv = fs.list(path)\
4601 if #Massiv==0 then\
4602 local Massiv2Id = #Massiv2 + 1\
4603 Massiv2[Massiv2Id] = {}\
4604 Massiv2[Massiv2Id][\"path\"] = path\
4605 Massiv2[Massiv2Id][\"text\"] = \"@empty@empty\"\
4606 else\
4607 for i=1,#Massiv do\
4608 if fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" and Massiv[i] ~= \"Data\" then\
4609 FileList(path..\"/\"..Massiv[i], fPath..\"/\"..Massiv[i])\
4610 elseif not fs.isDir(path..\"/\"..Massiv[i]) and Massiv[i] ~= \"/rom\" and Massiv[i] ~= \"rom\" and Massiv[i] ~= \"App.info\" then\
4611 local Massiv2Id = #Massiv2 + 1\
4612 Massiv2[Massiv2Id] = {}\
4613 Massiv2[Massiv2Id][\"path\"] = fPath..\"/\"..Massiv[i]\
4614 local file = fs.open(path..\"/\"..Massiv[i],\"r\")\
4615 Massiv2[Massiv2Id][\"text\"] = file.readAll()\
4616 file.close()\
4617 end\
4618 progressBar.setPercent((i/#Massiv)*100)\
4619 sleep(0)\
4620 end\
4621 end\
4622 end\
4623 FileList(path, \"\")\
4624\
4625 out.files = Massiv2\
4626 out.path = name\
4627\
4628 file=fs.open(output..\"/\"..name..\".lca\",\"w\")\
4629 file.write(textutils.serialise(out))\
4630 file.close()\
4631 end\
4632end\
4633\
4634local function getAppInfo(packInfo)\
4635 return packInfo.info\
4636end\
4637\
4638if not args[1] then\
4639 screen.writeText(\"Unknown command\", 1,ySize/3+1, xSize, \"center\")\
4640elseif string.lower(args[1]) == \"install\" and args[2] then\
4641 screen.setHeader(\"Installing app\")\
4642\
4643 local pack = getPackInfo(args[2])\
4644 local info = pack and getAppInfo(pack)\
4645\
4646 if fs.exists(args[2]) and pack and info then\
4647 screen.writeText(\"\"..info.name, 1,ySize/3+1, xSize, \"center\")\
4648 screen.writeText(\"Version: \"..info.version, 1,ySize/3+2, xSize, \"center\", colors.lightGray)\
4649 unpackApp(pack)\
4650 screen.writeText(\"Complete\", 1,ySize/2+3, xSize, \"center\", colors.cyan)\
4651 else\
4652 screen.writeText(\"Packet not found\", 1,ySize/3+1, xSize, \"center\")\
4653 end\
4654\
4655elseif string.lower(args[1]) == \"create\" and args[2] and args[3] and args[4] then\
4656 screen.setHeader(\"Creating app packet\")\
4657\
4658 if fs.exists(args[2]) then\
4659 screen.writeText(\"\"..args[4], 1, ySize/3+1, xSize, \"center\")\
4660 packApp(args[2], args[3], args[4])\
4661 screen.writeText(\"Complete\", 1,ySize/2+3, xSize, \"center\", colors.cyan)\
4662 else\
4663 screen.writeText(\"Project not found\", 1,ySize/3+1, xSize, \"center\")\
4664 end\
4665\
4666elseif string.lower(args[1]) == \"remove\" and args[2] then\
4667 screen.setHeader(\"Removing app\")\
4668\
4669 if fs.exists(\"/User/Apps/\"..args[2]) then\
4670 local app = os.getAppInfo(args[2])\
4671 screen.writeText(\"\"..app.name, 1,ySize/3+1, xSize, \"center\")\
4672 screen.writeText(\"Version: \"..app.version, 1,ySize/3+2, xSize, \"center\", colors.lightGray)\
4673 fs.delete(\"/User/Apps/\"..args[2])\
4674 screen.writeText(\"Complete\", 1,ySize/2+3, xSize, \"center\", colors.cyan)\
4675 else\
4676 screen.writeText(\"App not found\", 1,ySize/3+1, xSize, \"center\")\
4677 end\
4678\
4679else\
4680 screen.writeText(\"Unknown command\", 1,ySize/3+1, xSize, \"center\")\
4681end\
4682\
4683local exitBtn = screen.newButton(xSize-6, ySize-1, 6, 1, colors.cyan, colors.white, \"Exit\")\
4684\
4685while true do\
4686 local event, side, x, y = os.pullEvent()\
4687 if event == \"mouse_click\" then\
4688 if exitBtn.check(x,y) then\
4689 break\
4690 end\
4691 end\
4692end",
4693 },
4694 Settings = {
4695 [ "Start.x" ] = "local xSize, ySize = term.getSize()\
4696os.loadAPI(\"#API/screenworks\")\
4697\
4698os.setBarColor(colors.white)\
4699\
4700local about = fs.open(shell.resolve(\"App.info\"), \"r\")\
4701about = textutils.unserialize(about.readAll())\
4702\
4703local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Settings\")\
4704\
4705if ySize-3 < 17 then\
4706 screen.resize(17)\
4707end\
4708\
4709local btn_apps = screen.newButton(2,2,24,1, colors.gray,colors.white, \"Applications\", \"left\")\
4710local btn_notifications = screen.newButton(2,4,24,1, colors.gray,colors.white, \"Notifications\", \"left\")\
4711local btn_security = screen.newButton(2,6,24,1, colors.gray,colors.white, \"Security\", \"left\")\
4712local btn_storage = screen.newButton(2,8,24,1, colors.gray,colors.white, \"Storage\", \"left\")\
4713local btn_updates = screen.newButton(2,10,24,1, colors.gray,colors.white, \"Updates\", \"left\")\
4714local btn_screen = screen.newButton(2,12,24,1, colors.gray,colors.white, \"Screen\", \"left\")\
4715local btn_API = screen.newButton(2,14,24,1, colors.gray,colors.white, \"APIs\", \"left\")\
4716local btn_about = screen.newButton(2,16,24,1, colors.gray,colors.white, \"About\", \"left\")\
4717\
4718-- local sSwitch = screen.newSwitch(xSize-6,2)\
4719\
4720while true do\
4721 local event, side, x, y = os.pullEvent()\
4722\
4723 if event == \"mouse_click\" then\
4724 if btn_about.check(x,y) then\
4725 local err = os.run({},shell.resolve(\"Resources/about.x\"))\
4726 if err then\
4727 local message = screenworks.alert(\"Error\", err)\
4728 message.show()\
4729 end\
4730 screen.redraw()\
4731 elseif btn_notifications.check(x,y) then\
4732 local err = os.run(os.getEnvironment(),shell.resolve(\"Resources/notifications.x\"))\
4733 if err then\
4734 local message = screenworks.alert(\"Error\", err)\
4735 message.show()\
4736 end\
4737 screen.redraw()\
4738 elseif btn_API.check(x,y) then\
4739 local err = os.run(os.getEnvironment(),shell.resolve(\"Resources/apis.x\"))\
4740 if err then\
4741 local message = screenworks.alert(\"Error\", err)\
4742 message.show()\
4743 end\
4744 screen.redraw()\
4745 elseif btn_storage.check(x,y) then\
4746 local err = os.run({},shell.resolve(\"Resources/storage.x\"))\
4747 if err then\
4748 local message = screenworks.alert(\"Error\", err)\
4749 message.show()\
4750 end\
4751 screen.redraw()\
4752 elseif btn_apps.check(x,y) then\
4753 local err = os.run(os.getEnvironment(),shell.resolve(\"Resources/apps.x\"))\
4754 if err then\
4755 local message = screenworks.alert(\"Error\", err)\
4756 message.show()\
4757 end\
4758 screen.redraw()\
4759 elseif btn_updates.check(x,y) then\
4760 local err = os.run(os.getEnvironment(),shell.resolve(\"Resources/updates.x\"))\
4761 if err then\
4762 local message = screenworks.alert(\"Error\", err)\
4763 message.show()\
4764 end\
4765 screen.redraw()\
4766 elseif btn_screen.check(x,y) then\
4767 local err = os.run({},shell.resolve(\"Resources/screen.x\"))\
4768 if err then\
4769 local message = screenworks.alert(\"Error\", err)\
4770 message.show()\
4771 end\
4772 screen.redraw()\
4773 elseif btn_security.check(x,y) then\
4774 local err = os.run(os.getEnvironment(),shell.resolve(\"Resources/security.x\"))\
4775 if err then\
4776 local message = screenworks.alert(\"Error\", err)\
4777 message.show()\
4778 end\
4779 screen.redraw()\
4780 end\
4781 elseif event == \"mouse_scroll\" then\
4782 screen.scroll(-side)\
4783 end\
4784\
4785end",
4786 Resources = {
4787 [ "notifications.x" ] = "local xSize, ySize = term.getSize()\
4788os.loadAPI(\"/System/APIs/screenworks\")\
4789\
4790local time = tonumber(os.getFloatingTime())\
4791local maxTime = 12\
4792\
4793local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Notifications\")\
4794local backBtn = screen.createBackBtn()\
4795\
4796screen.writeLine(\"Floating notifications\", 2, 2, colors.gray)\
4797local float_switch = screen.newSwitch(xSize-6,2, nil, os.getFloatingEnabled())\
4798\
4799screen.writeLine(\"Indicator time\", 2, 5, colors.lightGray)\
4800local time_range = screen.newRange(2,6, xSize-2, (time/maxTime)*100)\
4801local time_input = screen.newInput(xSize-10,5,6,tostring(time),\"Time\", \"center\", nil, true)\
4802screen.writeLine(\"sec\", xSize-3, 5, colors.lightGray)\
4803\
4804local function checkTime()\
4805 if not time then\
4806 time = 4.0\
4807 time_input.set(time)\
4808 elseif time < 0.05 then\
4809 time = 0.05\
4810 time_input.set(time)\
4811 elseif time > maxTime then\
4812 time = maxTime\
4813 time_input.set(time)\
4814 end\
4815 time_range.set((time/maxTime)*100)\
4816 os.setFloatingTime(tostring(time))\
4817end\
4818\
4819while true do\
4820 local event, side, x, y = os.pullEvent()\
4821 if event == \"mouse_click\" then\
4822 if backBtn.check(x,y) then\
4823 screen.remove()\
4824 break\
4825 elseif float_switch.check(x,y) then\
4826 os.setFloatingEnabled(float_switch.state)\
4827 elseif time_input.check(x,y) then\
4828 time = tonumber(time_input.text)\
4829 checkTime()\
4830 elseif time_range.check(x,y) then\
4831 time = (time_range.percent/100)*maxTime\
4832 time_input.set(time)\
4833 checkTime()\
4834 end\
4835 elseif event == \"mouse_drag\" then\
4836 if time_range.check(x,y) then\
4837 time = (time_range.percent/100)*maxTime\
4838 time_input.set(time)\
4839 checkTime()\
4840 end\
4841 end\
4842end",
4843 [ "about.x" ] = "local xSize, ySize = term.getSize()\
4844os.loadAPI(\"/System/APIs/screenworks\")\
4845\
4846local clear = function(color)\
4847 term.setBackgroundColor(color)\
4848 term.clear()\
4849 term.setCursorPos(1,1)\
4850end\
4851\
4852local text = function(string,xPos,yPos)\
4853 term.setCursorPos(xPos,yPos)\
4854 term.write(string)\
4855end\
4856\
4857clear(colors.white)\
4858\
4859local about = fs.open(\"/System/Build.info\", \"r\")\
4860about = textutils.unserialize(about.readAll())\
4861\
4862local osver = about.OSversion\
4863local build = about.build\
4864local build_date = about.build_date\
4865\
4866local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, about.name..\" OS\", nil, nil, nil, nil, nil, 8)\
4867local backBtn = screen.createBackBtn()\
4868\
4869if ySize-3 < 17 then\
4870 screen.resize(9)\
4871end\
4872\
4873-- btn_os = screen.newButton(1,-1,xSize,7, colors.white,colors.cyan, about.name..\" OS\")\
4874\
4875screen.writeLine(\"Computer label: \",2,2)\
4876screen.writeLine(\"Computer ID: \",2,3)\
4877screen.writeLine(\"OS version: \",2,5)\
4878screen.writeLine(\"Build name: \",2,7)\
4879screen.writeLine(\"Build date: \",2,8)\
4880\
4881screen.writeLine(os.getComputerLabel() or \"not set\",xSize-#(os.getComputerLabel() or \"not set\")-1,2)\
4882screen.writeLine(os.getComputerID(),xSize-#tostring(os.getComputerID())-1,3)\
4883screen.writeLine(osver,xSize-#osver-1,5)\
4884screen.writeLine(build,xSize-#build-1,7)\
4885screen.writeLine(build_date,xSize-#build_date-1,8)\
4886\
4887while true do\
4888 local event, side, x, y = os.pullEvent()\
4889\
4890 if event == \"mouse_click\" then\
4891 if backBtn.check(x,y) then\
4892 screen.remove()\
4893 break\
4894 end\
4895 elseif event == \"mouse_scroll\" then\
4896 screen.scroll(-side)\
4897 end\
4898\
4899end",
4900 [ "account_form.x" ] = "local xSize, ySize = term.getSize()\
4901os.loadAPI(\"/System/APIs/screenworks\")\
4902\
4903local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.lightGray,colors.white, \"Create account\")\
4904// local backBtn = screen.createBackBtn()\
4905local btn_cancel = screen.newButton(2,ySize-3,8,1,colors.white,colors.gray,\"Cancel\")\
4906local btn_create\
4907screen.writeLine(\"Create\",xSize-7,ySize-3,colors.gray)\
4908\
4909local nameInput = screen.newInput(math.floor(xSize/2)-11,ySize/2-5,24,\"Username\")\
4910local passInput = screen.newInput(math.floor(xSize/2)-11,ySize/2-1,24,\"Password\",string.char(7))\
4911\
4912while true do\
4913 local event, side, x, y = os.pullEvent()\
4914 if event == \"mouse_click\" then\
4915 if btn_cancel.check(x,y) then\
4916 screen.remove()\
4917 break\
4918 elseif nameInput.check(x,y) then\
4919 elseif passInput.check(x,y) then\
4920 elseif btn_create and btn_create.check(x,y) then\
4921 local err = os.createAccount(nameInput.text,passInput.text)\
4922 if err then\
4923 screen.remove()\
4924 break\
4925 end\
4926 end\
4927 end\
4928 if not btn_create and nameInput.text ~= \"\" and nameInput.text ~= \"Username\" and passInput.text ~= \"Password\" then\
4929 btn_create = screen.newButton(xSize-8,ySize-3,8,1,colors.white,colors.cyan,\"Create\")\
4930 end\
4931end",
4932 [ "updates.x" ] = "local xSize, ySize = term.getSize()\
4933os.loadAPI(\"#API/screenworks\")\
4934\
4935os.setBarColor(colors.white)\
4936\
4937local loadingScreen = screenworks.newScreen(colors.lightGray,colors.white, colors.lightGray,colors.white, \"\", false)\
4938local btnReboot\
4939loadingScreen.drawImage(math.floor(xSize/2)-3, 2, \"#SysRes/Images/load_icon.png\")\
4940loadingScreen.writeText(\"Downloading update\", math.floor(xSize/2)-11, 10, 24, \"center\", colors.lightGray)\
4941local loadingBar = loadingScreen.newProgressBar(math.floor(xSize/2)-11, 12, 24, 0, colors.cyan, true)\
4942\
4943local changesScreen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"What's new\", false)\
4944local logBackBtn = changesScreen.createBackBtn()\
4945local logBtnOK = changesScreen.newButton(math.floor(xSize/2)-11, ySize-3, 24, 1, colors.white, colors.lightGray, \"ok\")\
4946\
4947local changesList = screenworks.newScreen(colors.white,colors.gray, colors.white,colors.white, \"Changelog\", false, math.floor(xSize/2)-11, 3, 24, ySize-4, 0)\
4948\
4949local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Updates\")\
4950local backBtn = screen.createBackBtn()\
4951\
4952local file = http.get(\"https://pastebin.com/raw/e59XLpie\")\
4953local info = file.readAll()\
4954file.close()\
4955info = textutils.unserialize(info)\
4956\
4957local curinf = os.getOSinfo()\
4958\
4959screen.writeLine(\"Current OS version\", 2, 2)\
4960screen.writeLine(\"Last OS version\", 2, 4)\
4961\
4962local btnNews, btnUpdate\
4963if info and curinf then\
4964 screen.writeLine(curinf.OSversion, xSize - #curinf.OSversion-1, 2, (curinf.OSversion == info.OSversion and colors.green) or (curinf.OSversion <= info.OSversion and colors.red) or (curinf.OSversion >= info.OSversion and colors.cyan))\
4965 screen.writeLine(info.OSversion, xSize - #info.OSversion-1, 4, colors.green)\
4966\
4967 if curinf.OSversion < info.OSversion then\
4968 btnNews = screen.newButton(math.floor(xSize/2)-6, ySize-8, 14, 3, colors.lightGray, colors.white, \"What's new\")\
4969 btnUpdate = screen.newButton(math.floor(xSize/2)-6, ySize-5, 14, 3, colors.white, colors.cyan, \"Update\")\
4970 end\
4971else\
4972 screen.writeLine(\"error\", xSize - 6, 2, colors.red)\
4973 screen.writeLine(\"error\", xSize - 6, 4, colors.red)\
4974end\
4975\
4976\
4977while true do\
4978 local event, side, x, y = os.pullEvent()\
4979\
4980 if event == \"mouse_click\" then\
4981 if backBtn.check(x,y) then\
4982 screen.remove()\
4983 break\
4984 elseif btnNews and btnNews.check(x,y) then\
4985 screen.setActive(false)\
4986 changesScreen.setActive(true)\
4987 changesList.resize(ySize-4)\
4988 changesList.body.clear()\
4989 local size = changesList.writeText(info.changelog[info.OSversion], 2,2,22)\
4990 if size > ySize-4 then\
4991 changesList.resize(size+2)\
4992 changesList.writeText(info.changelog[info.OSversion], 1,2,24)\
4993 end\
4994 changesList.setActive(true)\
4995 elseif btnUpdate and btnUpdate.check(x,y) then\
4996 screen.setActive(false)\
4997 loadingScreen.setActive(true)\
4998\
4999 local function loading()\
5000 sleep(1)\
5001 local updater = http.get(\"https://pastebin.com/raw/MM7AKF2u\")\
5002 local file = fs.open(\"#tmp/updater.lua\",\"w\")\
5003 file.write(updater.readAll())\
5004 file.close()\
5005 updater.close()\
5006\
5007 local image = http.get(info.links[info.OSversion])\
5008 local file = fs.open(\"#tmp/img\"..info.OSversion..\".info\",\"w\")\
5009 file.write(image.readAll())\
5010 file.close()\
5011 image.close()\
5012 sleep(2)\
5013\
5014 settings.set(\"boot.addNewItem\", {name = \"LegacyOS update \"..info.OSversion, path = \"/Temp/updater.lua\", args = \"/Temp/img\"..info.OSversion..\".info\"})\
5015 settings.save(\".settings\")\
5016\
5017 os.sendNotification(string.char(25), \"OS update\", \"Update is ready.\", \"Reboot to continue\", function() os.reboot() end)\
5018\
5019 loadingBar.waiting = false\
5020 loadingBar.setPercent(100)\
5021\
5022 loadingScreen.writeText(\"Update is ready\", math.floor(xSize/2)-11, 10, 24, \"center\", colors.lightGray)\
5023 btnReboot = loadingScreen.newButton(math.floor(xSize/2)-6, ySize-5, 14, 3, colors.white, colors.cyan, \"Reboot\")\
5024\
5025 os.terminateBackgroundTask(\"Downloading update\", \"Settings\")\
5026 end\
5027\
5028 local function waiting()\
5029 local i = 1\
5030 while loadingBar.waiting do\
5031 if i > 142 then\
5032 i = 1\
5033 end\
5034 loadingBar.setPercent(i)\
5035 i = i + 1\
5036 sleep(0)\
5037 end\
5038 end\
5039\
5040 -- parallel.waitForAny(loading, waiting)\
5041 os.newBackgroundTask(loading, \"Downloading update\")\
5042 waiting()\
5043\
5044\
5045 elseif btnReboot and btnReboot.check(x,y) then\
5046 os.reboot()\
5047 elseif logBtnOK.check(x,y) or logBackBtn.check(x,y) then\
5048 changesList.setActive(false)\
5049 changesScreen.setActive(false)\
5050 screen.setActive(true)\
5051 end\
5052 elseif event == \"mouse_scroll\" then\
5053 if screen.active then\
5054 screen.scroll(-side)\
5055 elseif changesList.active then\
5056 changesList.scroll(-side)\
5057 end\
5058 end\
5059end",
5060 [ "screen.x" ] = "local xSize, ySize = term.getSize()\
5061os.loadAPI(\"/System/APIs/screenworks\")\
5062\
5063local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Screen\")\
5064local backBtn = screen.createBackBtn()\
5065screen.writeLine(\"Color palette\", 2, 2, colors.lightGray)\
5066\
5067local colorSettings = fs.list(\"#SysRes/ScreenSettings\")\
5068local colorButtons = {}\
5069local colorRadioBox\
5070\
5071local selectedPalette = settings.get(\"os.currentPalette_name\")\
5072\
5073local rebootMsg = screenworks.select(\"Reboot now?\", \"You should reboot to apply settings\", \"Yes\", \"No\", true)\
5074\
5075local function applyColorSet(num)\
5076 if num == 1 then\
5077 settings.unset(\"os.currentPalette\")\
5078 settings.unset(\"os.currentPalette_name\")\
5079 settings.save(\".settings\")\
5080 os.applyColorPalette()\
5081 else\
5082 if colorButtons[num] then\
5083 settings.set(\"os.currentPalette\", colorButtons[num].newColors)\
5084 settings.set(\"os.currentPalette_name\", colorButtons[num].name)\
5085 settings.save(\".settings\")\
5086 os.applyColorPalette(colorButtons[num].newColors)\
5087 end\
5088 end\
5089 local answer = rebootMsg.show()\
5090 if answer == \"Yes\" then\
5091 os.reboot()\
5092 end\
5093end\
5094\
5095if colorSettings and #colorSettings > 0 then\
5096 for i=1, #colorSettings do\
5097 local file = fs.open(\"#SysRes/ScreenSettings/\"..colorSettings[i], \"r\")\
5098 colorButtons[i] = textutils.unserialize(file.readAll())\
5099 colorSettings[i] = colorButtons[i].name\
5100 file.close()\
5101 end\
5102\
5103 local _, sizeY = screen.body.getSize()\
5104 if #colorSettings*2+4 > sizeY then\
5105 screen.resize(#colorSettings*2+4)\
5106 end\
5107 colorRadioBox = screen.newRadioSet(3, 4, colorSettings, 1, xSize-4, colors.black)\
5108 if selectedPalette then\
5109 colorRadioBox.set(selectedPalette)\
5110 end\
5111end\
5112\
5113while true do\
5114 local event, side, x, y = os.pullEvent()\
5115 if event == \"mouse_click\" then\
5116 if backBtn.check(x,y) then\
5117 screen.remove()\
5118 break\
5119 elseif colorRadioBox.check(x,y) then\
5120 applyColorSet(colorRadioBox.selectedNum)\
5121 end\
5122 end\
5123end",
5124 [ "apps.x" ] = "local xSize, ySize = term.getSize()\
5125os.loadAPI(\"#API/screenworks\")\
5126\
5127os.setBarColor(colors.white)\
5128\
5129local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"App list\")\
5130local backBtn = screen.createBackBtn()\
5131\
5132local sysApps = os.getSystemApps(true)\
5133local usrApps = os.getUserApps(true)\
5134local apps = {}\
5135\
5136screen.resize((#sysApps+#usrApps)*3+8)\
5137\
5138screen.newInput(1,1,xSize,\"System Apps\")\
5139\
5140for i=1,#sysApps do\
5141 local info = os.getAppInfo(sysApps[i], true)\
5142 if not info.name then\
5143 info.name = sysApps[i]\
5144 end\
5145 apps[#apps+1] = {}\
5146 apps[#apps].btn = screen.newButton(2, i*3+2, 22, 1, colors.gray, colors.white, info.name, \"left\")\
5147 apps[#apps].path = sysApps[i]\
5148 -- screen.writeLine(info.name,2,i*3+2,colors.gray)\
5149 if not info.version then\
5150 info.version = \"0.0\"\
5151 end\
5152 screen.writeLine(\"v\"..info.version, xSize-#info.version-2, i*3+2, colors.lightGray)\
5153 if not info.size then\
5154 info.size = \"unknown\"\
5155 else\
5156 if info.size > 1024 then\
5157 info.size = math.floor(info.size/1024)..\" KB\"\
5158 else\
5159 info.size = info.size..\" B\"\
5160 end\
5161 end\
5162 screen.writeLine(\"Size:\", 2, i*3+3 ,colors.lightGray)\
5163 screen.writeLine(info.size, xSize-#info.size-1, i*3+3 ,colors.lightGray)\
5164end\
5165\
5166if #usrApps > 0 then\
5167 screen.newInput(1,#sysApps*3+5,xSize,\"User Apps\")\
5168\
5169 for i=1,#usrApps do\
5170 local info = os.getAppInfo(usrApps[i], true)\
5171 apps[#apps+1] = {}\
5172 apps[#apps].btn = screen.newButton(2, i*3+#sysApps*3+6, 22, 1, colors.gray, colors.white, info.name, \"left\")\
5173 apps[#apps].path = usrApps[i]\
5174 -- screen.writeLine(info.name,2,i*3+#sysApps*3+6,colors.gray)\
5175 if not info.version then\
5176 info.version = \"0.0\"\
5177 end\
5178 screen.writeLine(\"v\"..info.version, xSize-#info.version-2, i*3+#sysApps*3+6, colors.lightGray)\
5179 if not info.size then\
5180 info.size = \"unknown\"\
5181 else\
5182 if info.size > 1024 then\
5183 info.size = math.floor(info.size/1024)..\" KB\"\
5184 else\
5185 info.size = info.size..\" B\"\
5186 end\
5187 end\
5188 screen.writeLine(\"Size:\", 2, i*3+#sysApps*3+7 ,colors.lightGray)\
5189 screen.writeLine(info.size, xSize-#info.size-1, i*3+#sysApps*3+7 ,colors.lightGray)\
5190 end\
5191end\
5192\
5193while true do\
5194 local event, side, x, y = os.pullEvent()\
5195\
5196 if event == \"mouse_click\" then\
5197 if backBtn.check(x,y) then\
5198 screen.remove()\
5199 break\
5200 else\
5201 for i=1,#apps do\
5202 if apps[i].btn.check(x,y) then\
5203 os.run({},shell.resolve(\"Resources/appinfo.x\"),apps[i].path)\
5204 screen.redraw()\
5205 end\
5206 end\
5207 end\
5208 elseif event == \"mouse_scroll\" then\
5209 screen.scroll(-side)\
5210 end\
5211end",
5212 [ "apis.x" ] = "local xSize, ySize = term.getSize()\
5213os.loadAPI(\"#API/screenworks\")\
5214\
5215os.setBarColor(colors.white)\
5216\
5217local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"API list\")\
5218\
5219local backBtn = screen.createBackBtn()\
5220local sysAPI = os.getSystemAPIs()\
5221local usrAPI = os.getUserAPIs()\
5222\
5223local apis = {}\
5224\
5225screen.resize((#sysAPI+#usrAPI)*3+8)\
5226\
5227screen.newInput(1,1,xSize,\"System APIs\")\
5228\
5229for i=1,#sysAPI do\
5230 local info = os.getAPIInfo(sysAPI[i])\
5231 -- screen.writeLine(info.name,2,i*3+2,colors.gray)\
5232 if not info.version then\
5233 info.version = \"X.0\"\
5234 end\
5235 apis[#apis+1] = {}\
5236 apis[#apis].btn = screen.newButton(2, i*3+2, 22, 1, colors.gray, colors.white, info.name, \"left\")\
5237 apis[#apis].path = sysAPI[i]\
5238 screen.writeLine(\"v\"..info.version, xSize-#info.version-2, i*3+2, colors.lightGray)\
5239 if not info.size then\
5240 info.size = \"unknown\"\
5241 else\
5242 if info.size > 1024 then\
5243 info.size = math.floor(info.size/1024)..\" KB\"\
5244 else\
5245 info.size = info.size..\" B\"\
5246 end\
5247 end\
5248 screen.writeLine(\"Size:\", 2, i*3+3 ,colors.lightGray)\
5249 screen.writeLine(info.size, xSize-#info.size-1, i*3+3 ,colors.lightGray)\
5250end\
5251\
5252if #usrAPI > 0 then\
5253 screen.newInput(1,#sysAPI*3+5,xSize,\"User APIs\")\
5254\
5255 for i=1,#usrAPI do\
5256 local info = os.getAPIInfo(usrAPI[i])\
5257 apis[#apis+1] = {}\
5258 apis[#apis].btn = screen.newButton(2, i*3+#sysAPI*3+6, 22, 1, colors.gray, colors.white, info.name, \"left\")\
5259 apis[#apis].path = usrAPI[i]\
5260 -- screen.writeLine(info.name,2,i*3+#sysAPI*3+6,colors.gray)\
5261 if not info.version then\
5262 info.version = \"X.0\"\
5263 end\
5264 screen.writeLine(\"v\"..info.version, xSize-#info.version-2, i*3+#sysAPI*3+6, colors.lightGray)\
5265 if not info.size then\
5266 info.size = \"unknown\"\
5267 else\
5268 if info.size > 1024 then\
5269 info.size = math.floor(info.size/1024)..\" KB\"\
5270 else\
5271 info.size = info.size..\" B\"\
5272 end\
5273 end\
5274 screen.writeLine(\"Size:\", 2, i*3+#sysAPI*3+7 ,colors.lightGray)\
5275 screen.writeLine(info.size, xSize-#info.size-1, i*3+#sysAPI*3+7 ,colors.lightGray)\
5276 end\
5277end\
5278\
5279while true do\
5280 local event, side, x, y = os.pullEvent()\
5281\
5282 if event == \"mouse_click\" then\
5283 if backBtn.check(x,y) then\
5284 screen.remove()\
5285 break\
5286 else\
5287 for i=1,#apis do\
5288 if apis[i].btn.check(x,y) then\
5289 local err = os.run({},shell.resolve(\"Resources/apiinfo.x\"),apis[i].path)\
5290 if err then\
5291 local message = screenworks.alert(\"Error\", err)\
5292 message.show()\
5293 end\
5294 screen.redraw()\
5295 end\
5296 end\
5297 end\
5298 elseif event == \"mouse_scroll\" then\
5299 screen.scroll(-side)\
5300 end\
5301end",
5302 [ "appinfo.x" ] = "local arg = {...}\
5303local xSize, ySize = term.getSize()\
5304os.loadAPI(\"#API/screenworks\")\
5305\
5306os.setBarColor(colors.white)\
5307\
5308local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"\")\
5309local backBtn = screen.createBackBtn()\
5310local btn = {}\
5311\
5312local info = os.getAppInfo(arg[1], true)\
5313if arg[1] and info then\
5314 screen.setHeader(info.name)\
5315 if not info.systemApp then\
5316 btn.menu = screen.createMenu(\"Remove\", \"Clear data\")\
5317 end\
5318\
5319 if not info.systemApp and fs.exists(\"/User/Apps/\"..arg[1]..\"/App.ico\") then\
5320 btn.icon = screen.drawImage(xSize/2-2,2, \"/User/Apps/\"..arg[1]..\"/App.ico\", 6,4)\
5321 elseif info.systemApp and fs.exists(\"/System/Apps/\"..arg[1]..\"/App.ico\") then\
5322 btn.icon = screen.drawImage(xSize/2-2,2, \"/System/Apps/\"..arg[1]..\"/App.ico\", 6,4)\
5323 else\
5324 btn.icon = screen.drawImage(xSize/2-2,2, \"#SysRes/Images/noicon.png\", 6,4)\
5325 end\
5326 screen.writeText(\"Version: \"..info.version, 1, 7, xSize, \"center\")\
5327\
5328 if info.size > 1024 then\
5329 info.size = math.floor(info.size/1024)..\" KB\"\
5330 else\
5331 info.size = info.size..\" B\"\
5332 end\
5333 if info.dataSize > 1024 then\
5334 info.dataSize = math.floor(info.dataSize/1024)..\" KB\"\
5335 else\
5336 info.dataSize = info.dataSize..\" B\"\
5337 end\
5338 screen.writeLine(\"Occupied size:\", 4, 10, colors.black)\
5339 screen.writeLine(info.size, xSize-#info.size-2, 10)\
5340 screen.writeLine(\"User data size:\", 4, 11, colors.black)\
5341 screen.writeLine(info.dataSize, xSize-#info.dataSize-2, 11)\
5342 screen.writeLine(\"Developer:\", 4, 13)\
5343 screen.writeLine(info.developer, xSize-#info.developer-2, 13)\
5344end\
5345\
5346while true do\
5347 local event, side, x, y = os.pullEvent()\
5348\
5349 if event == \"mouse_click\" then\
5350 if not info.systemApp and btn.menu.check(x,y) then\
5351 local ans = btn.menu.open()\
5352 if ans == \"Clear data\" then\
5353 if fs.exists(\"/User/Apps/\"..arg[1]..\"/Data\") then\
5354 local dialog = screenworks.select(\"Clear data\", \"Are you sure?\", \"Yes\", \"No\")\
5355 local answ = dialog.show()\
5356\
5357 if answ == \"Yes\" then\
5358 fs.delete(\"/User/Apps/\"..arg[1]..\"/Data\")\
5359 info = os.getAppInfo(arg[1], true)\
5360 if info.dataSize > 1024 then\
5361 info.dataSize = math.floor(info.dataSize/1024)..\" KB\"\
5362 else\
5363 info.dataSize = info.dataSize..\" B\"\
5364 end\
5365 screen.writeText(\"User data size:\", 4, 11, xSize-8, 1, colors.black)\
5366 screen.writeLine(info.dataSize, xSize-#info.dataSize-2, 11)\
5367 end\
5368 else\
5369 local dialog = screenworks.alert(\"Error\", \"User data not found\")\
5370 dialog.show()\
5371 end\
5372 elseif ans == \"Remove\" then\
5373 local dialog = screenworks.select(\"Remove app\", \"Are you sure?\", \"Yes\", \"No\")\
5374 local answ = dialog.show()\
5375 if answ == \"Yes\" then\
5376 os.runApp(\"PacketManager\", {\"remove\", arg[1]})\
5377 screen.remove()\
5378 break\
5379 end\
5380 end\
5381 elseif backBtn.check(x,y) then\
5382 screen.remove()\
5383 break\
5384 end\
5385 end\
5386end",
5387 [ "security.x" ] = "local xSize, ySize = term.getSize()\
5388local exist = false\
5389if fs.exists(\"/User/User.info\") then\
5390 exist = true\
5391end\
5392local acc\
5393local btn_rename\
5394local btn_newpass\
5395os.loadAPI(\"/System/APIs/screenworks\")\
5396\
5397\
5398local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Security\")\
5399local backBtn = screen.createBackBtn()\
5400\
5401if exist then\
5402 acc = fs.open(\"/User/User.info\",\"r\")\
5403 acc = textutils.unserialize(acc.readAll())\
5404\
5405 screen.writeText(acc.name,1,4,xSize,\"center\")\
5406 btn_rename = screen.newButton(math.floor(xSize/2)-7,7,17,3,colors.white,colors.gray,\"Rename\")\
5407 btn_newpass = screen.newButton(math.floor(xSize/2)-7,11,17,3,colors.white,colors.gray,\"Change password\")\
5408else\
5409 btn_create = screen.newButton(math.floor(xSize/2)-7,math.floor(ySize/2),16,3,colors.white,colors.gray,\"Create account\")\
5410end\
5411\
5412screen.writeLine(\"Account manager\",2,2)\
5413\
5414while true do\
5415 local event, side, x, y = os.pullEvent()\
5416 if event == \"mouse_click\" then\
5417 if backBtn.check(x,y) then\
5418 screen.remove()\
5419 break\
5420 elseif btn_create and btn_create.check(x,y) then\
5421 os.run({},shell.resolve(\"Resources/account_form.x\"))\
5422 screen.redraw()\
5423 end\
5424 end\
5425end",
5426 [ "storage.x" ] = "local xSize, ySize = term.getSize()\
5427os.loadAPI(\"/System/APIs/screenworks\")\
5428\
5429local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Storage\")\
5430local backBtn = screen.createBackBtn()\
5431local menu = screen.createMenu(\"Clear all data\")\
5432\
5433if ySize-3 < 17 then\
5434 screen.resize(17)\
5435end\
5436\
5437screen.writeLine(\"Applications\",2,8)\
5438local appDataBar = screen.newProgressBar(2,9,xSize-3,0)\
5439screen.writeLine(\"User data\",2,11)\
5440local userDataBar = screen.newProgressBar(2,12,xSize-3,0)\
5441\
5442local freeSpace = fs.getFreeSpace(\"/\")\
5443local freeSpaceKB = math.floor(freeSpace/1024)\
5444\
5445-- screen.writeLine(\"used from \"..freeSpaceKB..\" KB\",2,3)\
5446local allDataBar = screen.newProgressBar(2,4,xSize-3,0)\
5447\
5448local userStorage = 0\
5449\
5450local function getSizeOfAll()\
5451 local sizeOfAll1 = 0\
5452\
5453 local function files(path)\
5454 local massiv = fs.list(path)\
5455 for i=1,#massiv do\
5456 if fs.isDir(fs.combine(path,massiv[i])) and massiv[i] ~= \"rom\" then\
5457 files(fs.combine(path,massiv[i]))\
5458 elseif not fs.isDir(fs.combine(path,massiv[i])) then\
5459 sizeOfAll1 = sizeOfAll1 + fs.getSize(fs.combine(path,massiv[i]))\
5460 screen.writeText(tostring(math.floor(sizeOfAll1/1024))..\" KB\", 2, 2, 13, \"left\", colors.cyan)\
5461 allDataBar.setPercent( sizeOfAll1 / (freeSpace+sizeOfAll1) * 100 )\
5462\
5463 if path:sub(1,12) == \"User/Storage\" then\
5464 userStorage = userStorage + fs.getSize(fs.combine(path,massiv[i]))\
5465 userDataBar.setPercent( userStorage / (freeSpace+sizeOfAll1) * 100 )\
5466 end\
5467 end\
5468 end\
5469 end\
5470 files(\"\")\
5471 return sizeOfAll1\
5472end\
5473\
5474local occupiedSpace = getSizeOfAll()\
5475\
5476local allStorage = occupiedSpace+freeSpace\
5477local allStorageKB = math.floor(allStorage/1024)\
5478\
5479local function getSizeOfApps()\
5480 local size = 0\
5481 local massiv = os.getAppsList()\
5482\
5483 for i=1,#massiv do\
5484 local info = os.getAppInfo(massiv[i], true)\
5485 size = size + info.size\
5486 appDataBar.setPercent( size / allStorage * 100 )\
5487 end\
5488\
5489 return size\
5490end\
5491\
5492local appSize = getSizeOfApps()\
5493local appSizeKB = math.floor(appSize/1024)\
5494local occupiedSpaceKB = math.floor(occupiedSpace/1024)\
5495\
5496screen.writeLine(\"used from \"..math.floor((freeSpace+occupiedSpace)/1024)..\" KB\",2,3)\
5497\
5498local userStorageKB = math.floor(userStorage/1024)\
5499\
5500screen.writeText(tostring(appSizeKB)..\" KB\", xSize-14, 8, 13, \"right\")\
5501appDataBar.setPercent( appSize / allStorage * 100 )\
5502\
5503screen.writeText(tostring(userStorageKB)..\" KB\", xSize-14, 11, 13, \"right\")\
5504userDataBar.setPercent( userStorage / allStorage * 100 )\
5505\
5506screen.writeText(tostring(occupiedSpaceKB)..\" KB\", 2, 2, 13, \"left\", colors.cyan)\
5507allDataBar.setPercent( occupiedSpace / allStorage * 100 )\
5508\
5509while true do\
5510 local event, side, x, y = os.pullEvent()\
5511 if event == \"mouse_click\" then\
5512 if backBtn.check(x,y) then\
5513 screen.remove()\
5514 break\
5515 elseif menu.check(x,y) then\
5516 local ans = menu.open()\
5517 end\
5518 elseif event == \"mouse_scroll\" then\
5519 screen.scroll(-side)\
5520 end\
5521end",
5522 [ "apiinfo.x" ] = "local arg = {...}\
5523local xSize, ySize = term.getSize()\
5524os.loadAPI(\"#API/screenworks\")\
5525\
5526os.setBarColor(colors.white)\
5527\
5528local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"\")\
5529local backBtn = screen.createBackBtn()\
5530local btn = {}\
5531\
5532local info = os.getAPIInfo(arg[1])\
5533if arg[1] and info then\
5534 screen.setHeader(info.name)\
5535 if not info.systemAPI then\
5536 btn.menu = screen.createMenu(\"Remove\")\
5537 end\
5538\
5539 -- os.loadAPI(\"#API/\"..arg[1])\
5540 local funcs = {}\
5541 local function findFunctions(tbl, deep)\
5542 for name,func in pairs(tbl) do\
5543 if type(func) == \"function\" then\
5544 table.insert(funcs, {name, deep})\
5545 elseif type(func) == \"table\" then\
5546 findFunctions(func, deep+1)\
5547 end\
5548 end\
5549 end\
5550\
5551 local tEnv = {}\
5552 local fnAPI, err = loadfile( \"#API/\"..arg[1], tEnv )\
5553 if fnAPI then\
5554 local ok, err = pcall( fnAPI )\
5555 if ok then\
5556 local tAPI = {}\
5557 for k,v in pairs( tEnv ) do\
5558 if k ~= \"_ENV\" then\
5559 tAPI[k] = v\
5560 end\
5561 end\
5562 findFunctions(tAPI, 1)\
5563 end\
5564 end\
5565\
5566 btn.icon = screen.drawImage(xSize/2-2,2, \"#SysRes/Images/exec_icon.png\", 6,4)\
5567 screen.writeText(\"Version: \"..(info.version or \"X.0\"), 1, 7, xSize, \"center\")\
5568\
5569 if info.size > 1024 then\
5570 info.size = math.floor(info.size/1024)..\" KB\"\
5571 else\
5572 info.size = info.size..\" B\"\
5573 end\
5574\
5575 screen.writeLine(\"Occupied size:\", 4, 10, colors.black)\
5576 screen.writeLine(info.size, xSize-#info.size-2, 10)\
5577\
5578 screen.writeLine(\"Usage:\", 4, 11, colors.black)\
5579 screen.writeLine(arg[1], xSize-#arg[1]-2, 11)\
5580\
5581 if #funcs > 0 then\
5582 screen.writeLine(\"Functions:\", 4, 13, colors.black)\
5583\
5584 local sx, sy = screen.body.getSize()\
5585 for i,func in ipairs(funcs) do\
5586 if 13+i > sy then\
5587 screen.resize(13+i)\
5588 sy = 13+i\
5589 end\
5590 screen.writeLine(arg[1]..\".\"..func[1]..\"(..)\", 4+func[2], 13+i, colors.lightGray)\
5591 end\
5592 end\
5593end\
5594\
5595while true do\
5596 local event, side, x, y = os.pullEvent()\
5597\
5598 if event == \"mouse_click\" then\
5599 if not info.systemAPI and btn.menu.check(x,y) then\
5600 local ans = btn.menu.open()\
5601 if ans == \"Remove\" then\
5602 local dialog = screenworks.select(\"Remove API\", \"Are you sure? This may cause your system!\", \"Yes\", \"No\")\
5603 local answ = dialog.show()\
5604 if answ == \"Yes\" then\
5605 -- os.runApp(\"PacketManager\", {\"remove\", arg[1]})\
5606 screen.remove()\
5607 break\
5608 end\
5609 end\
5610 elseif backBtn.check(x,y) then\
5611 screen.remove()\
5612 break\
5613 end\
5614 elseif event == \"mouse_scroll\" then\
5615 screen.scroll(-side)\
5616 end\
5617end",
5618 },
5619 [ "App.info" ] = "{\
5620 name = \"Settings\",\
5621 version = \"0.1\",\
5622 developer = \"DECE\",\
5623}",
5624 [ "App.ico" ] = " 90 90 90 90 90 90\
5625 9000909000 90\
5626 90 90O90S90 90 90\
5627 90 90 90 90 90 90",
5628 },
5629 Shell = {
5630 [ "Start.x" ] = "local xSize, ySize = term.getSize()\
5631os.loadAPI(\"#API/screenworks\")\
5632\
5633local place = \"/\"\
5634shell.setDir(place)\
5635local command = \"\"\
5636local path = {}\
5637local textPath = shell.path()\
5638local env = os.getEnvironment()\
5639local memory = {}\
5640local memCursor = 0\
5641os.setBarColor(colors.black)\
5642env.place = function()\
5643 return place\
5644end\
5645env.shell = shell\
5646\
5647local screen = screenworks.newScreen(colors.white,colors.black, colors.cyan, colors.gray, \"Shell\")\
5648screen.resize(ySize*2)\
5649\
5650env.print = function(text)\
5651 local sizeX, sizeY = screen.body.getSize()\
5652 local cursorX, cursorY = screen.body.getCursorPos()\
5653 while #text > 0 do\
5654 term.write(text)\
5655 text = string.sub(text, sizeX - cursorX+2)\
5656 cursorX, cursorY = 1, cursorY+1\
5657 if cursorY > sizeY then\
5658 screen.resize(sizeY + 1)\
5659 sizeY = sizeY + 1\
5660 end\
5661 screen.body.setCursorPos(cursorX, cursorY)\
5662 end\
5663end\
5664\
5665local function updatePath()\
5666 path = {}\
5667 local pos = 0\
5668 path[pos] = \"\"\
5669 for i=1,#textPath do\
5670 if string.sub(textPath,i,i) == \":\" then\
5671 pos = pos+1\
5672 path[pos] = \"\"\
5673 else\
5674 path[pos] = path[pos]..string.sub(textPath,i,i)\
5675 end\
5676 end\
5677 path[#path+1] = \"/System/Scripts\"\
5678 path[#path+1] = place\
5679end\
5680\
5681local function stringToTable(str)\
5682 local pos = 1\
5683 local tbl = {}\
5684 tbl[pos] = \"\"\
5685 for i=1,#str do\
5686 if string.sub(str,i,i) == \" \" then\
5687 pos = pos+1\
5688 tbl[pos] = \"\"\
5689 else\
5690 tbl[pos] = tbl[pos]..string.sub(str,i,i)\
5691 end\
5692 end\
5693 return tbl\
5694end\
5695\
5696local function exec(command)\
5697 updatePath()\
5698 command = stringToTable(command)\
5699 local xPos,yPos = screen.body.getCursorPos()\
5700 -- local newTerm = window.create(screen.body,xPos,yPos,xSize-1,ySize)\
5701 -- local trm = term.redirect(newTerm)\
5702 local trm = term.redirect(screen.body)\
5703\
5704 if command[1] == \"cd\" then\
5705 if string.sub(command[2],1,2) == \"..\" then\
5706 local i = #place\
5707 while string.sub(place,i,i) ~= \"/\" and i > 0 do\
5708 i=i-1\
5709 end\
5710 if i > 1 then\
5711 place = string.sub(place,0,i)\
5712 else\
5713 place = \"/\"\
5714 end\
5715 command[2] = string.sub(command[2],3)\
5716 elseif string.sub(command[2],1,1) == \"/\" then\
5717 place = \"/\"\
5718 end\
5719 if fs.exists(fs.combine(place,command[2])) then\
5720 if fs.isDir(fs.combine(place,command[2])) then\
5721 place = fs.combine(place,command[2])\
5722 shell.setDir(place)\
5723 env.shell = shell\
5724 else\
5725 term.setTextColor(colors.red)\
5726 print(command[2]..\" not a directory\")\
5727 end\
5728 else\
5729 term.setTextColor(colors.red)\
5730 print(\"Can't find \"..command[2])\
5731 end\
5732 updatePath()\
5733 elseif command[1] == \"clear\" then\
5734 term.setCursorPos(1,1)\
5735 term.setBackgroundColor(colors.black)\
5736 term.clear()\
5737 screen.resize(ySize*2)\
5738 else\
5739 for i=1,#path do\
5740 if fs.exists(fs.combine(path[i],command[1]..\".lua\")) then\
5741 command[1] = fs.combine(path[i],command[1]..\".lua\")\
5742 break\
5743 elseif string.sub(command[1],1,1) ~= \"/\" and fs.exists(fs.combine(path[i],command[1])) then\
5744 command[1] = fs.combine(path[i],command[1])\
5745 break\
5746 elseif string.sub(command[1],1,1) == \"/\" and fs.exists(command[1]) then\
5747 break\
5748 end\
5749 end\
5750\
5751 local program = command[1]\
5752 for i=1,#command-1 do\
5753 command[i] = command[i+1]\
5754 end\
5755 command[#command] = nil\
5756\
5757 -- trm = term.redirect(newTerm)\
5758\
5759 --term.redirect(screen.body)\
5760 os.run(env,program,unpack(command))\
5761 --local xp, yp = newTerm.getCursorPos()\
5762 --local xp_, yp_ = trm.getCursorPos()\
5763 --trm.setCursorPos(1,yp_+yp)\
5764 end\
5765 term.redirect(trm)\
5766end\
5767\
5768local function preview(text)\
5769 local lFiles = fs.list(place)\
5770 local previewText = \"\"\
5771 local finded = false\
5772\
5773 local function find(tbl)\
5774 for i=1,#tbl do\
5775 if string.sub(tbl[i],1,#text) == text then\
5776 previewText = string.sub(tbl[i],#text+1)\
5777 finded = true\
5778 break\
5779 end\
5780 end\
5781 end\
5782\
5783 local comm = stringToTable(text)\
5784 text = comm[#comm]\
5785\
5786 local slPos\
5787 for i=1, #text do\
5788 if string.sub(text,i,i) == \"/\" then\
5789 slPos = i\
5790 end\
5791 end\
5792\
5793 if slPos then\
5794 lFiles = fs.list(fs.combine(place, string.sub(text,1,slPos-1)))\
5795 text = string.sub(text,slPos+1)\
5796 end\
5797\
5798 if text ~= \"\" then\
5799 find(lFiles)\
5800\
5801 if not finded and not slPos then\
5802 lFiles = fs.list(path[#path-1])\
5803 for i=1,#lFiles do\
5804 lFiles[i] = string.sub(lFiles[i],1,#lFiles[i]-4)\
5805 end\
5806 find(lFiles)\
5807 end\
5808 end\
5809\
5810 return previewText\
5811end\
5812\
5813local function input()\
5814 local args = \"\"\
5815 local prev = \"\"\
5816\
5817 while true do\
5818 local xPos,yPos = screen.body.getCursorPos()\
5819 local sizeX,sizeY = screen.body.getSize()\
5820 local posX,posY = screen.body.getPosition()\
5821 if yPos >= sizeY-ySize/2 then\
5822 screen.resize(sizeY+20)\
5823 end\
5824 local ev, sd = os.pullEvent()\
5825 if ev == 'key' then\
5826 if sd == keys.enter then\
5827 screen.body.write(\" ->\")\
5828 screen.body.setCursorPos(1,yPos+1)\
5829 exec(args)\
5830 memCursor = #memory+2\
5831 memory[#memory+1] = args\
5832 args = \"\"\
5833 xPos,yPos = screen.body.getCursorPos()\
5834 elseif sd == keys.backspace then\
5835 args = string.sub(args,1,#args-1)\
5836 elseif sd == keys.up then\
5837 if memCursor > 1 then\
5838 memCursor = memCursor-1\
5839 args = memory[memCursor]\
5840 end\
5841 elseif sd == keys.down then\
5842 if memCursor < #memory then\
5843 memCursor = memCursor+1\
5844 args = memory[memCursor]\
5845 end\
5846 elseif sd == keys.tab then\
5847 args = args..prev\
5848 end\
5849 elseif ev == 'char' and sd ~= nil then\
5850 args = args..sd\
5851 elseif ev == \"mouse_scroll\" then\
5852 screen.scroll(-sd)\
5853 elseif ev == \"resume\" then\
5854 term.redirect(screen.body)\
5855 end\
5856 --term.redirect(screen.body)\
5857 --term.setCursorBlink(true)\
5858 --screen.body.setCursorBlink(true)\
5859 prev = preview(args)\
5860 screen.body.setCursorPos(1,yPos+1)\
5861 screen.writeLine(\" \",1,yPos)\
5862 screen.writeLine(\">\",2,yPos,colors.cyan)\
5863 screen.body.setTextColor(colors.white)\
5864 screen.body.setCursorPos(4,yPos)\
5865 screen.body.write(args)\
5866 screen.body.setTextColor(colors.lightGray)\
5867 screen.body.write(prev)\
5868 -- screen.writeLine(args,4,yPos,colors.white)\
5869 screen.redraw()\
5870 screen.writeLine(\" \",1,2,colors.gray,screen.header)\
5871 screen.writeLine(\">\"..place,1,2,colors.lightGray,screen.header)\
5872 screen.body.setCursorPos(4+#args, yPos)\
5873 screen.body.setCursorBlink(true)\
5874 end\
5875end\
5876\
5877updatePath()\
5878input()",
5879 [ "App.info" ] = "{\
5880 name = \"Shell\",\
5881 version = \"0.1\",\
5882 developer = \"DECE\",\
5883}",
5884 [ "App.ico" ] = " 07 07 07 07 07 07\
5885 0f 0f 0f 0f 0f 0f\
5886 0f>9f 0f 0f 0f 0f\
5887 0f 0f 0f 0f 0f 0f",
5888 },
5889 LegacyUI = {
5890 [ "Start.x" ] = "os.newBackgroundTask(\"/System/Scripts/update_checker.lua\", \"OTA updates service\")\
5891\
5892local mon = peripheral.wrap(\"top\")\
5893\
5894local xSize, ySize = mon.getSize()\
5895local centerX = math.floor(xSize/2)\
5896local centerY = math.floor(ySize/2)\
5897\
5898local showApps = false\
5899local showNoti = false\
5900\
5901local show_float_noti = false\
5902local float_timer = 0\
5903local float_timer_limit = os.getFloatingTime()/os.getSystemDelay()\
5904\
5905local notifications = {}\
5906\
5907local first = term.current()\
5908local origin = window.create(mon,1,1,xSize,ySize)\
5909local currentTask\
5910\
5911local recApps = window.create(origin,centerX-14,1,30,ySize-1)\
5912local recApps_scroll = window.create(recApps,3,1,26,5)\
5913recApps_scroll.setBackgroundColor(colors.black)\
5914recApps_scroll.clear()\
5915recApps.setVisible(false)\
5916\
5917local btn_animation = window.create(mon,-1,-1,1,1)\
5918btn_animation.setTextColor(colors.lightGray)\
5919\
5920local noti_screen = window.create(mon,xSize+1,1,20,ySize)\
5921local noti_screen_background = window.create(noti_screen,1,1,20,ySize-3)\
5922local noti_screen_scroll = window.create(noti_screen_background,1,1,20,ySize-3)\
5923\
5924local float_noti_window = window.create(mon,xSize+1,ySize-6,20,5)\
5925float_noti_window.setVisible(false)\
5926\
5927local errorBuffer\
5928local tasks = os.getRunningTasks()\
5929coroutine.yield(1, 1, xSize, ySize-1)\
5930\
5931\
5932local clear = function(color)\
5933 term.setBackgroundColor(color)\
5934 term.clear()\
5935 term.setCursorPos(1,1)\
5936end\
5937\
5938local text = function(string,xPos,yPos,trm)\
5939 if not trm then\
5940 trm = term\
5941 end\
5942 trm.setCursorPos(xPos,yPos)\
5943 trm.write(string)\
5944end\
5945\
5946\
5947local function redrawNotifications()\
5948 local pos\
5949 noti_screen_scroll.reposition(1,1, 20, ySize-3)\
5950 noti_screen_scroll.clear()\
5951 local sizeX, sizeY = noti_screen_scroll.getSize()\
5952 local posX, posY = noti_screen_scroll.getPosition()\
5953 notifications = os.getNotifications()\
5954\
5955 for i, noti in ipairs(notifications) do\
5956 if noti then\
5957 pos = i*5-4\
5958\
5959 if pos + 4 > sizeY then\
5960 noti_screen_scroll.reposition(posX, posY, sizeX, pos+5)\
5961 end\
5962\
5963 noti_screen_scroll.setBackgroundColor(colors.lightGray)\
5964 noti_screen_scroll.setTextColor(colors.gray)\
5965 noti_screen_scroll.setCursorPos(1,pos)\
5966 noti_screen_scroll.write(\" \")\
5967 noti_screen_scroll.setCursorPos(1,pos)\
5968 noti_screen_scroll.write(\" \"..noti.icon..\" \"..noti.header)\
5969 noti_screen_scroll.setCursorPos(20,pos)\
5970 noti_screen_scroll.write(\"x\")\
5971\
5972 noti_screen_scroll.setBackgroundColor(colors.gray)\
5973 noti_screen_scroll.setTextColor(colors.lightGray)\
5974 noti_screen_scroll.setCursorPos(2,pos+2)\
5975 noti_screen_scroll.write(noti.text)\
5976 noti_screen_scroll.setCursorPos(2,pos+3)\
5977 noti_screen_scroll.write(noti.text2)\
5978 end\
5979 end\
5980 os.applyColorPalette(currentPalette)\
5981end\
5982\
5983local function removeNotification(num)\
5984 notifications = os.getNotifications()\
5985 if notifications[num] then\
5986 os.printLog(\"Removing notification #\"..num, \"SystemUI\")\
5987 os.removeNotification(num)\
5988 end\
5989end\
5990\
5991local function clearNotifications()\
5992 os.printLog(\"Clearing notifications\", \"SystemUI\")\
5993 os.clearNotifications()\
5994 local posX, posY = noti_screen_scroll.getPosition()\
5995 if #notifications > 0 then\
5996 local sizeX, sizeY = noti_screen_scroll.getSize()\
5997 for i=1, sizeX/3+1 do\
5998 noti_screen_background.clear()\
5999 noti_screen_scroll.reposition(i*3, posY)\
6000 sleep(0)\
6001 end\
6002 end\
6003 redrawNotifications()\
6004 noti_screen_scroll.reposition(posX, posY)\
6005end\
6006\
6007term.redirect(noti_screen_background)\
6008clear(colors.gray)\
6009term.redirect(noti_screen_scroll)\
6010clear(colors.gray)\
6011term.redirect(noti_screen)\
6012clear(colors.gray)\
6013term.setTextColor(colors.lightGray)\
6014text(\"Clear\",2,ySize-1)\
6015\
6016\
6017local function drawBar()\
6018 term.redirect(origin)\
6019 local barText = --[[string.char(17)..\" \"..string.char(7)..\" \"..]]string.char(140)\
6020 local clr = colors.black\
6021 local tx_clr = colors.lightGray\
6022\
6023 if tasks[currentTask] and not showApps then\
6024 if tasks[currentTask].style then\
6025 clr = tasks[currentTask].style\
6026 if tasks[currentTask].style >= colors.orange and tasks[currentTask].style <= colors.red then\
6027 tx_clr = colors.white\
6028 end\
6029 end\
6030 end\
6031\
6032 if showNoti then\
6033 paintutils.drawLine(5,ySize,xSize-20,ySize,clr)\
6034 paintutils.drawLine(xSize-19,ySize,xSize,ySize,colors.gray)\
6035 else\
6036 paintutils.drawLine(5,ySize,xSize-2,ySize,clr)\
6037 end\
6038\
6039 term.setTextColor(tx_clr)\
6040 if not show_float_noti then\
6041 text(string.char(7)..\" \",xSize-1,ySize)\
6042 elseif not showNoti then\
6043 text(string.char(19)..\" \",xSize-1,ySize)\
6044 end\
6045\
6046 term.setBackgroundColor(clr)\
6047 text(\" \"..barText..\" \",1,ySize)\
6048 if currentTask > 1 then\
6049 text(string.char(30),4,ySize)\
6050 end\
6051 time = textutils.formatTime(os.time(),true)\
6052 text(time,centerX-#time/2+2,ySize)\
6053end\
6054\
6055local function animate(x1,y1,x2,y2, color, redrTerm)\
6056 btn_animation.reposition(x1,y1,x2,y2)\
6057 os.applyColorPalette(currentPalette)\
6058 if color then\
6059 btn_animation.setBackgroundColor(color)\
6060 else\
6061 btn_animation.setBackgroundColor(colors.gray)\
6062 end\
6063 btn_animation.clear()\
6064 sleep(0.1)\
6065 btn_animation.reposition(-1,-1)\
6066 os.applyColorPalette(currentPalette)\
6067 local redrTerm = redrTerm or origin\
6068 redrTerm.redraw()\
6069 if not showApps and not showNoti and tasks[currentTask] then\
6070 tasks[currentTask].screen.redraw()\
6071 os.applyColorPalette(currentPalette)\
6072 end\
6073end\
6074\
6075local function openNoti()\
6076 setDidState(true)\
6077 if show_float_noti then\
6078 show_float_noti = false\
6079 float_timer = 0\
6080 float_noti_window.reposition(xSize+1,ySize-6)\
6081 float_noti_window.setVisible(false)\
6082 end\
6083 for i=1,5 do\
6084 noti_screen.reposition(xSize-i*4+1,1)\
6085 os.applyColorPalette(currentPalette)\
6086 sleep(0)\
6087 end\
6088 showNoti = true\
6089end\
6090\
6091local function closeNoti()\
6092 showNoti = false\
6093 drawBar()\
6094 for i=1,7 do\
6095 origin.redraw()\
6096 if not showApps and tasks[currentTask] then\
6097 tasks[currentTask].screen.redraw()\
6098 end\
6099 noti_screen.reposition(xSize-19+i*3,1)\
6100 os.applyColorPalette(currentPalette)\
6101 sleep(0)\
6102 end\
6103 setDidState(false)\
6104end\
6105\
6106local function redrawTasks()\
6107 tasks = os.getRunningTasks()\
6108 currentTask = os.getCurrentTask()\
6109\
6110 local pos\
6111 local sizeX, sizeY = recApps_scroll.getSize()\
6112 local posX, posY = recApps_scroll.getPosition()\
6113\
6114 recApps_scroll.setBackgroundColor(colors.black)\
6115 recApps_scroll.clear()\
6116\
6117 recApps_scroll.reposition(posX,1,sizeX,#tasks*5)\
6118\
6119 for i=1,#tasks do\
6120 -- tasks[i] = tasks[i+1]\
6121\
6122 pos = i*5-3\
6123 term.redirect(recApps_scroll)\
6124\
6125 paintutils.drawFilledBox(1,pos,26,pos+3,colors.white)\
6126 recApps_scroll.setTextColor(colors.lightGray)\
6127 text(tasks[i].name,8,pos+1,recApps_scroll)\
6128\
6129 if i > 1 then\
6130 paintutils.drawFilledBox(24,pos,26,pos+3,colors.red)\
6131 recApps_scroll.setTextColor(colors.white)\
6132 text(\"x\",25,pos+1,recApps_scroll)\
6133 end\
6134\
6135 os.drawImage(os.getAppIcon(tasks[i].path),1,pos,recApps_scroll,6,4)\
6136\
6137 -- recApps_scroll.reposition(posX,1,sizeX,sizeY-5)\
6138 end\
6139end\
6140\
6141local function openShowApps()\
6142 setDidState(true)\
6143 redrawTasks()\
6144 os.applyColorPalette(currentPalette)\
6145 os.printLog(\"Trying to open Recent apps\", \"SystemUI\")\
6146\
6147 tasks = os.getRunningTasks()\
6148 currentTask = os.getCurrentTask()\
6149\
6150 for i=1,#tasks do\
6151 tasks[i].screen.setVisible(false)\
6152 end\
6153\
6154 recApps.setVisible(true)\
6155 tasks[currentTask].screen.setVisible(true)\
6156 drawBar()\
6157\
6158 for i=1,math.floor(ySize/3) do\
6159 recApps.redraw()\
6160 tasks[currentTask].screen.reposition(1,ySize-(ySize-i*3+1))\
6161 drawBar()\
6162 sleep(0)\
6163 end\
6164 tasks[currentTask].screen.reposition(1,ySize+1)\
6165 showApps = true\
6166 recApps.redraw()\
6167 drawBar()\
6168 os.applyColorPalette(currentPalette)\
6169end\
6170\
6171local function changeApp(name)\
6172 tasks = os.getRunningTasks()\
6173 currentTask = os.getCurrentTask()\
6174\
6175 if tasks[name] then\
6176 recApps.setVisible(false)\
6177 drawBar()\
6178 tasks[name].screen.reposition(1,ySize+1)\
6179 tasks[name].screen.setVisible(true)\
6180\
6181 for i=1,math.floor(ySize/4) do\
6182 tasks[name].screen.reposition(1,ySize-i*4+1)\
6183 drawBar()\
6184 sleep(0)\
6185 end\
6186\
6187 tasks[name].screen.reposition(1,1)\
6188 drawBar()\
6189 showApps = false\
6190 showNoti = false\
6191 end\
6192 setDidState(false)\
6193 drawBar()\
6194end\
6195\
6196local function closeApp(name)\
6197 redrawTasks()\
6198\
6199 if not showApps or #tasks == 1 then\
6200 showApps = false\
6201 os.changeApp(1)\
6202 os.printLog(\"Open Launcher\", \"SystemUI\")\
6203 end\
6204end\
6205\
6206local function runApp(info, args)\
6207 redrawTasks()\
6208\
6209 local error\
6210 local path = info.path\
6211 local findApp = info.access\
6212 local name = info.name\
6213\
6214 if findApp ~= nil then\
6215 term.redirect(origin)\
6216 if tasks[currentTask].coroutine and not error then\
6217 local pos = #tasks*5-3\
6218 local sizeX, sizeY = recApps_scroll.getSize()\
6219 local posX, posY = recApps_scroll.getPosition()\
6220\
6221 if pos + 4 > sizeY then\
6222 if (pos+4) >= ySize-1 then\
6223 recApps_scroll.reposition(posX,posY+(ySize-(pos+4)-1),sizeX,pos+4)\
6224 else\
6225 recApps_scroll.reposition(posX,1,sizeX,pos+4)\
6226 end\
6227 end\
6228 term.redirect(recApps_scroll)\
6229\
6230 paintutils.drawFilledBox(1,pos,26,pos+3,colors.white)\
6231 recApps_scroll.setTextColor(colors.lightGray)\
6232 text(tasks[currentTask].name,8,pos+1,recApps_scroll)\
6233\
6234 if currentTask > 1 then\
6235 paintutils.drawFilledBox(24,pos,26,pos+3,colors.red)\
6236 recApps_scroll.setTextColor(colors.white)\
6237 text(\"x\",25,pos+1,recApps_scroll)\
6238 end\
6239\
6240 os.drawImage(os.getAppIcon(tasks[currentTask].path),1,pos,recApps_scroll,6,4)\
6241 recApps_scroll.setBackgroundColor(colors.black)\
6242 drawBar()\
6243 end\
6244 end\
6245end\
6246\
6247local function input()\
6248 os.printLog(\"Started\", \"SystemUI\")\
6249 while true do\
6250 local event, side, x, y, z = os.pullEvent()\
6251 tasks = os.getRunningTasks()\
6252 currentTask = os.getCurrentTask()\
6253\
6254 if show_float_noti and os.getFloatingEnabled() then\
6255 float_noti_window.redraw()\
6256 if float_timer > float_timer_limit then\
6257 show_float_noti = false\
6258 float_timer = 0\
6259 local xp, yp = float_noti_window.getPosition()\
6260 for i=1,3 do\
6261 if showApps then\
6262 first.redraw()\
6263 recApps.redraw()\
6264 else\
6265 tasks[currentTask].screen.redraw()\
6266 end\
6267 float_noti_window.reposition(xp, ySize-6+i*2+1)\
6268 sleep(0)\
6269 end\
6270 float_noti_window.setVisible(false)\
6271 else\
6272 float_timer = float_timer + 1\
6273 end\
6274 elseif show_float_noti then\
6275 if float_timer > float_timer_limit then\
6276 show_float_noti = false\
6277 float_timer = 0\
6278 else\
6279 float_timer = float_timer + 1\
6280 end\
6281 end\
6282 drawBar()\
6283\
6284 errorBuffer = os.getErrorBuffer()\
6285 if errorBuffer then\
6286 local errMsg = screenworks.alert(\"Error in \"..errorBuffer.app, errorBuffer.error)\
6287 errMsg.show()\
6288 if errorBuffer.app == \"System UI\" then\
6289 os.reboot()\
6290 end\
6291 errorBuffer = nil\
6292 os.clearErrorBuffer()\
6293 end\
6294\
6295 if event == \"system.closeApp\" then\
6296 closeApp(side)\
6297 elseif event == \"system.runApp\" then\
6298 runApp(side, x)\
6299 elseif event == \"system.changeApp\" then\
6300 changeApp(side)\
6301 elseif event == \"system.sendNotification\" or event == \"system.removeNotification\" or event == \"system.clearNotifications\" then\
6302 redrawNotifications()\
6303 float_timer_limit = os.getFloatingTime()/os.getSystemDelay()\
6304 show_float_noti = true\
6305 float_timer = 0\
6306 drawBar()\
6307 if event == \"system.sendNotification\" and not showNoti and os.getFloatingEnabled() then\
6308 float_noti_window.setBackgroundColor(colors.gray)\
6309 float_noti_window.clear()\
6310\
6311 float_noti_window.setTextColor(colors.lightGray)\
6312 float_noti_window.setCursorPos(2,3)\
6313 float_noti_window.write(side.text)\
6314 float_noti_window.setCursorPos(2,4)\
6315 float_noti_window.write(side.text2)\
6316\
6317 float_noti_window.setBackgroundColor(colors.lightGray)\
6318 float_noti_window.setTextColor(colors.gray)\
6319 float_noti_window.setCursorPos(1,1)\
6320 float_noti_window.write(\" \")\
6321 float_noti_window.setCursorPos(1,1)\
6322 float_noti_window.write(\" \"..side.icon..\" \"..side.header)\
6323\
6324 float_noti_window.setVisible(true)\
6325 for i=1,5 do\
6326 float_noti_window.reposition(xSize-i*4+1,ySize-6)\
6327 sleep(0)\
6328 end\
6329 end\
6330 elseif event == \"mouse_click\" then\
6331 if y == ySize then\
6332 coroutine.yield(true)\
6333 if x >= xSize-1 and x <= xSize then\
6334 animate(xSize-2,ySize,3,1)\
6335 if showNoti then\
6336 closeNoti()\
6337 else\
6338 openNoti()\
6339 end\
6340 elseif x >= 1 and x <= 2 then\
6341 animate(1,ySize,3,1)\
6342 if showNoti then\
6343 closeNoti()\
6344 end\
6345 if tasks[currentTask] and not showApps then\
6346 openShowApps()\
6347 elseif showApps then\
6348 os.changeApp(currentTask)\
6349 end\
6350 elseif currentTask > 1 and x >= 4 and x <= 5 then\
6351 animate(3,ySize,3,1)\
6352 if showNoti then\
6353 closeNoti()\
6354 end\
6355 os.changeApp(1)\
6356 end\
6357 elseif showNoti then\
6358 if x >= xSize - 19 and y < ySize then\
6359 local posX, posY = noti_screen_scroll.getPosition()\
6360 local notiNum = math.floor((y-posY+5)/5)\
6361\
6362 if x == xSize and (y-posY+5)%5 == 0 then\
6363 removeNotification(notiNum)\
6364 elseif x >= xSize-19 and x <= xSize-13 and y == ySize-1 then\
6365 animate(xSize-19,ySize-1,7,1, colors.lightGray, noti_screen)\
6366 clearNotifications()\
6367 closeNoti()\
6368 elseif notiNum and #notifications > 0 and notifications[notiNum] then\
6369 os.runApp(notifications[notiNum].app)\
6370 removeNotification(notiNum)\
6371 closeNoti()\
6372 end\
6373 else\
6374 closeNoti()\
6375 end\
6376 else\
6377 if showApps and not showNoti then\
6378 local posX, posY = recApps_scroll.getPosition()\
6379 local app = math.floor((y-posY+4)/5)\
6380\
6381 if x>=centerX-12 and x<=centerX+10 then\
6382 if app > 0 and app <= #tasks then\
6383 os.changeApp(app)\
6384 end\
6385 elseif x >= centerX+11 and x <= centerX+13 then\
6386 if app > 1 and app <= #tasks then\
6387 os.closeApp(app)\
6388 end\
6389 end\
6390 end\
6391 end\
6392 elseif event == \"mouse_drag\" and y == ySize and x < centerX-3 and not showNoti then\
6393 coroutine.yield(true)\
6394 animate(centerX-5,ySize,13,1)\
6395 if currentTask < #tasks then\
6396 os.changeApp(currentTask + 1)\
6397 elseif currentTask ~= 1 then\
6398 os.changeApp(1)\
6399 end\
6400 elseif event == \"mouse_drag\" and y == ySize and x > centerX+4 and not showNoti then\
6401 coroutine.yield(true)\
6402 animate(centerX-5,ySize,13,1)\
6403 if currentTask > 1 then\
6404 os.changeApp(currentTask - 1)\
6405 elseif currentTask ~= #tasks then\
6406 os.changeApp(#tasks)\
6407 end\
6408 elseif event == \"mouse_scroll\" and showNoti then\
6409 local posX, posY = noti_screen_scroll.getPosition()\
6410 local sx, sy = noti_screen_scroll.getSize()\
6411 if side == 1 and posY > -(sy - ySize) then\
6412 noti_screen_scroll.reposition(posX,posY-1)\
6413 elseif side == -1 and posY < 1 then\
6414 noti_screen_scroll.reposition(posX,posY+1)\
6415 end\
6416 os.applyColorPalette(currentPalette)\
6417 elseif event == \"mouse_scroll\" and showApps then\
6418 local posX, posY = recApps_scroll.getPosition()\
6419 local sx, sy = recApps_scroll.getSize()\
6420 if side == 1 and posY > -(sy - ySize) then\
6421 recApps_scroll.reposition(posX,posY-1)\
6422 elseif side == -1 and posY < 1 then\
6423 recApps_scroll.reposition(posX,posY+1)\
6424 end\
6425 os.applyColorPalette(currentPalette)\
6426 end\
6427 end\
6428end\
6429\
6430input()",
6431 [ "App.info" ] = "{\
6432 name = \"Legacy UI\",\
6433 version = \"0.1\",\
6434 developer = \"DECE\",\
6435 hidden = true,\
6436}",
6437 [ "App.ico" ] = " 90 90 90 90 90 90\
6438 9000909000 90\
6439 90 90O90S90 90 90\
6440 90 90 90 90 90 90",
6441 },
6442 ScreenworcksDemo = {
6443 [ "Start.x" ] = "local xSize, ySize = term.getSize()\
6444os.loadAPI(\"/System/APIs/screenworks\")\
6445\
6446os.setBarColor(colors.white)\
6447\
6448local startPos = math.floor(xSize/2)-11\
6449\
6450local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"ScreenWorks Demo\")\
6451\
6452screen.writeText(\"This is testing text box with align and other comfortable things...\",startPos,2,24,\"justify\")\
6453screen.writeText(\"This is testing text box with center align and cyan color...\",startPos,6,24,\"center\",colors.cyan)\
6454screen.writeText(\"This is testing text box with right align...\",startPos,10,24,\"right\")\
6455\
6456screen.writeLine(\"Type something here:\",startPos,13)\
6457local input = screen.newInput(startPos,14,24,\"\", \"Input field\")\
6458\
6459screen.resize(42)\
6460\
6461screen.writeLine(\"Drag this range:\",startPos,18)\
6462local range = screen.newRange(startPos,19,24)\
6463screen.writeText(range.percent..\"%\",startPos+1,20,24,\"center\")\
6464\
6465local btn1 = screen.newButton(startPos,22,8,3,colors.white,colors.gray,\"Button\")\
6466local btnDialog = screen.newButton(startPos, 29, 24, 3, colors.white,colors.cyan,\"Show dialog\")\
6467local radio1 = screen.newRadioSet(startPos+10,22, {\"Animate\", \"Not animate\"})\
6468\
6469local dropDownList = screen.newDropDownList(startPos, 33, 24, {\"test1\", \"Long test\", \"2x Long long test\", \"3x Long long long test\", \"Another test\", \"And another one\"}, \"Drop-down list\")\
6470\
6471screen.writeLine(\"Simple progress bar:\",startPos,26)\
6472local progress = screen.newProgressBar(startPos,27,24)\
6473\
6474local alert = screenworks.select(\"Test dialog\", \"Test dialog message and Some Other Words\", \"Yes\", \"No\", true)\
6475\
6476local animate = true\
6477\
6478while true do\
6479 local event, side, x, y = os.pullEvent()\
6480 if event == \"mouse_click\" then\
6481 if btn1.check(x,y,animate) then\
6482 if progress.percent < 100 then\
6483 for i=1,range.percent/5 do\
6484 progress.setPercent(progress.percent+5)\
6485 sleep(0)\
6486 end\
6487 else\
6488 progress.setPercent(0)\
6489 end\
6490 elseif radio1.check(x,y) then\
6491 if radio1.selected == \"Animate\" then\
6492 animate = true\
6493 elseif radio1.selected == \"Not animate\" then\
6494 animate = false\
6495 end\
6496 elseif input.check(x,y) then\
6497 elseif dropDownList.check(x,y) then\
6498 -- local alr = screenworks.alert(\"Test alert\", \"You Pressed \")\
6499 -- alr.show()\
6500 dropDownList.open()\
6501 elseif btnDialog.check(x,y) then\
6502 -- local msg = alert.show()\
6503 -- local alr = screenworks.alert(\"Test alert\", \"You Pressed \"..(msg or \"none\"))\
6504 -- alr.show()\
6505 local inp = screenworks.inputDialog(\"Input\",\"Test text\", \"Yes\", \"No\", false, \"Field1\", \"Field2\")\
6506 local btn, data = inp.show()\
6507 local alr = screenworks.alert(\"Test alert\", \"You Pressed \"..(btn or \"none\")..\" \"..data.Field1)\
6508 alr.show()\
6509 end\
6510 elseif event == \"mouse_drag\" then\
6511 range.check(x,y)\
6512 screen.writeText(range.percent..\"%\",startPos+1,20,24,\"center\")\
6513 elseif event == \"mouse_scroll\" then\
6514 screen.scroll(-side)\
6515 end\
6516end",
6517 [ "App.info" ] = "{\
6518 name = \"ScreenWorks Demo\",\
6519 version = \"1.0\",\
6520 developer = \"DECE\",\
6521}",
6522 [ "App.ico" ] = " 90 90 90 90 90 90\
6523 9000909000 90\
6524 90 90O90S90 90 90\
6525 90 90 90 90 90 90",
6526 },
6527 NotificationsDemo = {
6528 [ "Start.x" ] = "local xSize, ySize = term.getSize()\
6529os.loadAPI(\"#API/screenworks\")\
6530\
6531os.setBarColor(colors.white)\
6532\
6533local screen = screenworks.newScreen(colors.lightGray,colors.white, colors.white,colors.cyan, \"Notification Demo\")\
6534\
6535local textFieldHeader = screen.newInput(2, 2, xSize-3, \"\", \"Notification header\")\
6536local textField1 = screen.newInput(2, 6, xSize-3, \"\", \"Notification line 1\")\
6537local textField2 = screen.newInput(2, 10, xSize-3, \"\", \"Notification line 2\")\
6538\
6539local btnSend = screen.newButton(math.floor(xSize/2)-9, 14, 19, 3, colors.white, colors.gray, \"Send notification\", \"center\")\
6540\
6541if ySize-3 < 17 then\
6542 screen.resize(17)\
6543end\
6544\
6545while true do\
6546 local event, side, x, y = os.pullEvent()\
6547\
6548 if event == \"mouse_click\" then\
6549 if btnSend.check(x,y) then\
6550 os.sendNotification(nil, textFieldHeader.text, textField1.text, textField2.text)\
6551 elseif textFieldHeader.check(x,y) or textField1.check(x,y) or textField2.check(x,y) then\
6552 end\
6553 elseif event == \"mouse_scroll\" then\
6554 screen.scroll(-side)\
6555 end\
6556\
6557end",
6558 [ "App.info" ] = "{\
6559 name = \"Notification Demo\",\
6560 version = \"1.0\",\
6561 developer = \"DECE\",\
6562}",
6563 [ "App.ico" ] = " 90 90 90 90 90 90\
6564 9000909000 90\
6565 90 90O90S90 90 90\
6566 90 90 90 90 90 90",
6567 },
6568 },
6569 APIs = {
6570 contexts = "--Contexts\
6571--2.0\
6572\
6573local mon = peripheral.wrap(\"top\")\
6574\
6575local xSize, ySize = term.getSize()\
6576local comp = false\
6577\
6578local function usualText(string,xPos,yPos, trm)\
6579 local trm = trm or term\
6580 trm.setCursorPos(xPos,yPos)\
6581 trm.write(string)\
6582end\
6583\
6584function main(...)\
6585 local arg = {...}\
6586 local waitFor = true\
6587 local x = arg[1]\
6588 local y = arg[2]\
6589 local color = colors.gray\
6590 local textColor = colors.white\
6591 local maxLenth = 3\
6592 local align = \"center\"\
6593 local lenth\
6594 local output\
6595 local vertical_inverted\
6596\
6597 if type(arg[3]) == \"table\" then\
6598 if arg[3].color then\
6599 color = arg[3].color\
6600 end\
6601 if arg[3].textColor then\
6602 textColor = arg[3].textColor\
6603 end\
6604 if arg[3].lenth then\
6605 lenth = arg[3].lenth\
6606 end\
6607 if arg[3].minLenth then\
6608 maxLenth = arg[3].minLenth\
6609 end\
6610 if arg[3].align then\
6611 align = arg[3].align\
6612 end\
6613 if arg[3].verticalInverted then\
6614 vertical_inverted = arg[3].verticalInverted\
6615 end\
6616 table.remove(arg, 3)\
6617 end\
6618\
6619 if not lenth then\
6620 for i=3,#arg do\
6621 if #arg[i] > maxLenth then\
6622 maxLenth = #arg[i]\
6623 end\
6624 end\
6625 maxLenth = maxLenth + 2\
6626 else\
6627 maxLenth = lenth\
6628 end\
6629\
6630 local xend = x+maxLenth\
6631 local yend = y+#arg-1\
6632 if x+maxLenth > xSize then\
6633 xend = x\
6634 x = x-maxLenth+1\
6635 end\
6636 if y+#arg-1 > ySize then\
6637 yend = y\
6638 y = y-#arg\
6639 vertical_inverted = true\
6640 end\
6641\
6642 local body = window.create(mon,x,y,maxLenth,0)\
6643 body.setBackgroundColor(color)\
6644 body.setTextColor(textColor)\
6645 body.clear()\
6646\
6647 local function drawItem(id)\
6648 if align == \"center\" then\
6649 usualText(arg[id+2],math.floor((maxLenth)/2)-math.floor(#arg[id+2]/2)+1,id+1, body)\
6650 elseif align == \"left\" then\
6651 usualText(arg[id+2],2,id+1, body)\
6652 elseif align == \"right\" then\
6653 usualText(arg[id+2],maxLenth-#arg[id+2],id+1, body)\
6654 end\
6655 end\
6656\
6657 for i=3,#arg do\
6658 if vertical_inverted then\
6659 body.reposition(x,y+#arg-i,maxLenth,i)\
6660 else\
6661 body.reposition(x,y,maxLenth,i)\
6662 end\
6663 drawItem(i-2)\
6664 sleep(0)\
6665 end\
6666\
6667 while waitFor do\
6668 event, side, xp, yp = os.pullEvent()\
6669 if event == 'mouse_click' then\
6670 for i=1,#arg-2 do\
6671 if xp >= x and xp <= xend and yp >= y and yp <= yend then\
6672 if yp == y+i then\
6673 local bk = term.redirect(body)\
6674 paintutils.drawFilledBox(1,i+1,maxLenth,i+1,colors.lightGray)\
6675 term.redirect(bk)\
6676 drawItem(i)\
6677 sleep(0.1)\
6678 output = arg[i+2]\
6679 body.setVisible(false)\
6680 end\
6681 end\
6682 end\
6683 return output\
6684 end\
6685 end\
6686end",
6687 images = "--Image drawer API\
6688--1.1\
6689\
6690local Colors = {\
6691 [\"0\"] = 1,\
6692 [\"1\"] = 2,\
6693 [\"2\"] = 4,\
6694 [\"3\"] = 8,\
6695 [\"4\"] = 16,\
6696 [\"5\"] = 32,\
6697 [\"6\"] = 64,\
6698 [\"7\"] = 128,\
6699 [\"8\"] = 256,\
6700 [\"9\"] = 512,\
6701 [\"a\"] = 1024,\
6702 [\"b\"] = 2048,\
6703 [\"c\"] = 4096,\
6704 [\"d\"] = 8192,\
6705 [\"e\"] = 16384,\
6706 [\"f\"] = 32768\
6707}\
6708\
6709local function convert(mode,color)\
6710 if mode == \"from cc\" then\
6711 for key,value in pairs(Colors) do\
6712 if color == value then\
6713 return key\
6714 end\
6715 end\
6716 else\
6717 if color == \"#\" then\
6718 return \"0\"\
6719 else\
6720 return Colors[color]\
6721 end\
6722 end\
6723end\
6724\
6725function loadImage(path, format)\
6726 local Pixels = {}\
6727 local file\
6728 if type(path) == \"string\" then\
6729 file = fs.open(path,\"r\")\
6730 else\
6731 file = path\
6732 end\
6733 if file == nil then\
6734 file = fs.open('#SysRes/Images/imgerror.png','r')\
6735 end\
6736 local lineCounter = 1\
6737 while true and file do\
6738 local line = file.readLine()\
6739 Pixels[lineCounter]={}\
6740 if line ~= nil then\
6741 for i=1,#line,3 do\
6742 Pixels[lineCounter][(i+2)/3]={[\"symbol\"] = string.sub(line,i,i),[\"textColor\"] = convert(\"to cc\",string.sub(line,i+1,i+1)),[\"backColor\"] = convert(\"to cc\",string.sub(line,i+2,i+2))}\
6743 end\
6744 lineCounter = lineCounter + 1\
6745 else\
6746 break\
6747 end\
6748 end\
6749 if file then\
6750 file.close()\
6751 end\
6752\
6753 return Pixels\
6754end\
6755\
6756function draw(image,startX,startY,trm,cutX,cutY, threads)\
6757 if not trm then\
6758 trm = term\
6759 end\
6760 local threads = threads or 16\
6761\
6762 if type(image) == \"string\" then\
6763 image = loadImage(image)\
6764 elseif type(image) == \"table\" then\
6765 else\
6766 image = loadImage(\"#SysRes/Images/noicon.png\")\
6767 end\
6768\
6769 if not image or not image[1] then return end\
6770\
6771 if cutX == nil or cutY == nil then\
6772 cutX = #image[1]\
6773 cutY = #image-1\
6774 else\
6775 if cutY >= #image then cutY = #image-1 end\
6776 if cutX > #image[1] then cutX = #image[1] end\
6777 end\
6778\
6779 local drawfuncs = {}\
6780 if threads > cutX then\
6781 threads = cutX\
6782 end\
6783 if threads > cutY then\
6784 threads = cutY\
6785 end\
6786 local div = math.floor(math.sqrt(threads))\
6787\
6788 local verSize = math.floor(cutY/div)\
6789 local horSize = math.floor(cutX/div)\
6790\
6791 for ver=1,div do\
6792 for hor=1,div do\
6793 table.insert(drawfuncs, function()\
6794 for y=verSize*ver - verSize, verSize*ver do\
6795 if image[y] then\
6796 for x=horSize*hor - horSize, horSize*hor do\
6797 if image[y][x] and image[y][x][\"symbol\"] ~= \"#\" then\
6798 trm.setTextColor(image[y][x][\"textColor\"])\
6799 trm.setBackgroundColor(image[y][x][\"backColor\"])\
6800 trm.setCursorPos(startX+x-1,startY+y-1)\
6801 trm.write(image[y][x][\"symbol\"])\
6802 end\
6803 end\
6804 end\
6805 end\
6806 end)\
6807 end\
6808 end\
6809\
6810 parallel.waitForAll(unpack(drawfuncs))\
6811end",
6812 screenworks = "--ScreenWorks API\
6813--0.4\
6814\
6815local mon = peripheral.wrap(\"top\")\
6816\
6817local args = {...}\
6818local xSize, ySize = term.getSize()\
6819local screens = {}\
6820\
6821local function textToTable(text)\
6822 local words = {}\
6823 local pos = 1\
6824\
6825 for i = 1, #text do\
6826 if string.sub(text,i,i) == '\\\
6827' then\
6828 pos = pos + 1\
6829 words[pos] = '\\\
6830'\
6831 elseif string.sub(text,i,i) ~= \" \" then\
6832 if words[pos] == nil then\
6833 words[pos] = \"\"\
6834 end\
6835 words[pos] = words[pos]..string.sub(text,i,i)\
6836 else\
6837 if string.sub(text,i-1,i-1) ~= \" \" then\
6838 pos = pos + 1\
6839 else\
6840 if words[pos] == nil then\
6841 words[pos] = \"\"\
6842 end\
6843 words[pos] = words[pos]..\" \"\
6844 end\
6845 end\
6846 end\
6847 return words\
6848end\
6849\
6850local function printText(trm, text, x, y, size, align, color)\
6851 if color then\
6852 trm.setTextColor(color)\
6853 end\
6854 if not text then\
6855 text = \"\"\
6856 end\
6857\
6858 local words = textToTable(text)\
6859 if not words then\
6860 words = {\"\"}\
6861 elseif not words[1] then\
6862 words[1] = \"\"\
6863 end\
6864 local lines = {}\
6865 local pos = x+#words[1]\
6866 local elms = 1\
6867\
6868 lines[1] = words[1]..\" \"\
6869 for i=2, #words do\
6870 if words[i] == \"\\n\" or words[i] == \"\\\
6871\" then\
6872 elms = elms + 1\
6873 lines[elms] = \"\"\
6874 pos = x\
6875 elseif words[i] then\
6876 pos = pos + #words[i]\
6877 if pos <= size+x-1 then\
6878 lines[elms] = lines[elms]..words[i]..\" \"\
6879 pos = pos+1\
6880 else\
6881 lines[elms] = string.sub(lines[elms],1,#lines[elms]-1)\
6882 elms = elms + 1\
6883 lines[elms] = words[i]..\" \"\
6884 pos = x + #words[i]\
6885 end\
6886 end\
6887 end\
6888\
6889 lines[#lines] = string.sub(lines[#lines],1,#lines[#lines]-1)\
6890\
6891 if align == 'justify' then\
6892 local dim = size+2\
6893 for i=1,#lines do\
6894 if #lines[i] < dim-3 and #lines[i] > math.floor(dim/2 + dim/5) then\
6895 local j = 1\
6896 local space = 0\
6897 while j < #lines[i] and #lines[i] <= dim-3 do\
6898 if j < #lines[i] and string.sub(lines[i],j,j) == ' ' then\
6899 lines[i] = string.sub(lines[i],1,j)..string.sub(lines[i],j,#lines[i])\
6900 j = j + 3 + space\
6901 else\
6902 j = j + 1\
6903 end\
6904 if j >= #lines[i] then\
6905 j = 1\
6906 space = space + 1\
6907 end\
6908 end\
6909 end\
6910 end\
6911 end\
6912\
6913 for i=1, #lines do\
6914 for j=x,size+x-1 do\
6915 trm.setCursorPos(j,i+y-1)\
6916 trm.write(\" \")\
6917 end\
6918 if align == 'center' then\
6919 trm.setCursorPos(math.floor(size/2-#lines[i]/2)+x,i+y-1)\
6920 elseif align == 'right' then\
6921 trm.setCursorPos(size-#lines[i]+x,i+y-1)\
6922 else\
6923 trm.setCursorPos(x,i+y-1)\
6924 end\
6925 trm.write(lines[i])\
6926 end\
6927 return elms\
6928end\
6929\
6930local startInput = os.advancedRead\
6931\
6932function newScreen(textColor, backgroundColor, headerTextColor, headerColor, header, act, _X, _Y, _SizeX, _SizeY, _HeaderSizeY)\
6933 local obj = {}\
6934\
6935 local _HeaderSizeY = _HeaderSizeY or 2\
6936 local _X = _X or 1\
6937 local _Y = _Y or 1\
6938 local _SizeX = _SizeX or xSize\
6939 local _SizeY = _SizeY or ySize-_HeaderSizeY\
6940\
6941 obj.header = window.create(mon, _X, _Y, _SizeX, _HeaderSizeY)\
6942 obj.background = window.create(mon, _X, _Y + _HeaderSizeY, _SizeX, _SizeY)\
6943 obj.body = window.create(obj.background, 1, 1, _SizeX-1, _SizeY)\
6944\
6945 obj.scroller = window.create(obj.background, _SizeX, 1, 1, _SizeY)\
6946 obj.scrollerB = window.create(obj.scroller, 1, 1, 1, _SizeY)\
6947\
6948 local steping = 0\
6949 local scr_size\
6950 obj.buttons = {}\
6951\
6952 obj.setActive = function(state)\
6953 local state = state or false\
6954 obj.active = state\
6955 obj.header.setVisible(state)\
6956 obj.background.setVisible(state)\
6957 obj.body.setVisible(state)\
6958 obj.scroller.setVisible(state)\
6959 end\
6960\
6961 if act == nil then\
6962 obj.active = true\
6963 else\
6964 obj.setActive(act)\
6965 end\
6966\
6967 obj.redraw = function()\
6968 obj.background.redraw()\
6969 obj.body.redraw()\
6970 obj.header.redraw()\
6971 obj.scroller.redraw()\
6972 end\
6973\
6974 obj.remove = function()\
6975 for i=1, #screens do\
6976 if screens[i] == obj then\
6977 table.remove(screens, i)\
6978 break\
6979 end\
6980 end\
6981\
6982 obj.header.setVisible(false)\
6983 obj.body.setVisible(false)\
6984 obj.scroller.setVisible(false)\
6985\
6986 obj.header = nil\
6987 obj.body = nil\
6988 obj.scroller = nil\
6989\
6990 obj = nil\
6991 end\
6992\
6993 local function drawMenuDot()\
6994 obj.header.setCursorPos(xSize-5,1)\
6995 obj.header.write(\" ... \")\
6996 end\
6997\
6998 local function drawBackBtn()\
6999 obj.header.setCursorPos(1,1)\
7000 obj.header.write(\" < \")\
7001 obj.header.setCursorPos(1,2)\
7002 obj.header.write(\" \")\
7003 end\
7004\
7005 obj.createMenu = function(...)\
7006 local args = {...}\
7007 obj.header.hasMenu = true\
7008 drawMenuDot()\
7009 os.loadAPI(\"#API/contexts\")\
7010\
7011 local menu = {}\
7012 menu.check = function(x,y)\
7013 if obj.active and y >= 1 and y <= 2 and x >= xSize-5 and x <= xSize-1 then\
7014 return true\
7015 end\
7016 end\
7017\
7018 menu.open = function()\
7019 obj.header.setBackgroundColor(colors.gray)\
7020 obj.header.setTextColor(colors.white)\
7021 drawMenuDot()\
7022 local answer = contexts.main(xSize-1,2,unpack(args))\
7023 obj.header.setBackgroundColor(headerColor)\
7024 obj.header.setTextColor(headerTextColor)\
7025 drawMenuDot()\
7026 obj.redraw()\
7027 return answer\
7028 end\
7029\
7030 return menu\
7031 end\
7032\
7033 obj.createBackBtn = function()\
7034 obj.header.hasBackBtn = true\
7035 drawBackBtn()\
7036\
7037 local btn = {}\
7038 btn.check = function(x,y)\
7039 if obj.active and y >= 1 and y <= 2 and x >= 1 and x <= 3 then\
7040 obj.header.setBackgroundColor(colors.gray)\
7041 obj.header.setTextColor(colors.lightGray)\
7042 drawBackBtn()\
7043 sleep(0)\
7044 obj.header.setBackgroundColor(headerColor)\
7045 obj.header.setTextColor(headerTextColor)\
7046 drawBackBtn()\
7047 return true\
7048 end\
7049 end\
7050\
7051 return btn\
7052 end\
7053\
7054 obj.scrollPos = 1\
7055 obj.scroll = function(n)\
7056 local xPos, yPos = obj.body.getPosition()\
7057 local sizeX, sizeY = obj.body.getSize()\
7058 local xx, yy = obj.scrollerB.getPosition()\
7059 if sizeY >= _SizeY+1 then\
7060 if n > 0 and yPos < 1 then\
7061 obj.body.reposition(1,yPos+n)\
7062 obj.scroller.clear()\
7063 obj.scrollPos = obj.scrollPos-steping*n\
7064 if obj.scrollPos < 1 then\
7065 obj.scrollPos = 1\
7066 end\
7067 if obj.scrollPos > _SizeY-scr_size+1 then\
7068 obj.scrollPos = _SizeY-scr_size+1\
7069 end\
7070 obj.scrollerB.reposition(1,math.ceil(obj.scrollPos))\
7071 -- if obj.scrollPos > _SizeY+1-scr_size then\
7072 -- obj.scrollerB.reposition(1,_SizeY+1-scr_size)\
7073 -- obj.scrollPos = _SizeY+1-scr_size\
7074 -- end\
7075 -- if yPos+n > 1 then\
7076 -- obj.body.reposition(1,1)\
7077 -- end\
7078 elseif n < 0 and yPos+sizeY > _SizeY+1 then\
7079 obj.body.reposition(1,yPos+n)\
7080 obj.scroller.clear()\
7081 obj.scrollPos = obj.scrollPos-steping*n\
7082 if obj.scrollPos < 1 then\
7083 obj.scrollPos = 1\
7084 end\
7085 if obj.scrollPos > ySize-scr_size-1 then\
7086 obj.scrollPos = ySize-scr_size-1\
7087 end\
7088 obj.scrollerB.reposition(1,math.ceil(obj.scrollPos))\
7089 -- if obj.scrollPos < 1 then\
7090 -- obj.scrollerB.reposition(1,1)\
7091 -- obj.scrollPos = 1\
7092 -- end\
7093 -- if yPos+n+sizeY < _SizeY then\
7094 -- obj.body.reposition(1,yPos+sizeY)\
7095 -- end\
7096 end\
7097 -- obj.header.redraw()\
7098 end\
7099 end\
7100\
7101 obj.resize = function(size)\
7102 local xPos, yPos = obj.body.getPosition()\
7103 local cX, cY = obj.body.getSize()\
7104 if size >= cY then\
7105 obj.body.reposition(xPos,yPos,_SizeX-1 ,size)\
7106 else\
7107 obj.body.reposition(1,1,_SizeX-1,size)\
7108 obj.scrollerB.reposition(1,1)\
7109 end\
7110 local xx, yy = obj.scrollerB.getPosition()\
7111 obj.scroller.reposition(_SizeX,1)\
7112 obj.scroller.clear()\
7113\
7114 scr_size = math.floor((_SizeY)/size * (_SizeY))\
7115 steping = ((_SizeY))/(size-1)\
7116\
7117 obj.scrollerB.reposition(1,yy,1,scr_size)\
7118 end\
7119\
7120 obj.setHeader = function(text)\
7121 header = text\
7122 obj.header.setTextColor(headerTextColor)\
7123 obj.header.setBackgroundColor(headerColor)\
7124 obj.header.clear()\
7125 obj.header.setCursorPos(math.floor(xSize/2)-math.floor(#tostring(header))/2+1,math.floor(_HeaderSizeY/2))\
7126 obj.header.write(header)\
7127 if obj.header.hasMenu then\
7128 drawMenuDot()\
7129 end\
7130 if obj.header.hasBackBtn then\
7131 drawBackBtn()\
7132 end\
7133 end\
7134\
7135 obj.writeLine = function(text, x,y, color, trm)\
7136 if not trm or (trm ~= obj.body and trm ~= obj.header) then\
7137 trm = obj.body\
7138 end\
7139 if not text then\
7140 text = \"\"\
7141 end\
7142\
7143 if not color then\
7144 trm.setTextColor(textColor)\
7145 else\
7146 trm.setTextColor(color)\
7147 end\
7148 trm.setCursorPos(x,y)\
7149 trm.write(text)\
7150 end\
7151\
7152 obj.writeText = function(text, x,y, size, align, color)\
7153 if not color then\
7154 color = textColor\
7155 end\
7156 return printText(obj.body, text, x, y, size, align, color)\
7157 end\
7158\
7159 obj.drawImage = function(x,y, path, sizeX,sizeY, threads)\
7160 local img = {}\
7161 img.x = x\
7162 img.y = y\
7163\
7164 if not sizeX or not sizeY then\
7165 sizeX, sizeY = os.getImageSize(path)\
7166 end\
7167\
7168 img.body = window.create(obj.body, x,y, sizeX,sizeY)\
7169 img.body.setBackgroundColor(backgroundColor)\
7170 img.body.clear()\
7171\
7172 os.drawImage(path, 1,1, img.body, sizeX, sizeY, threads)\
7173\
7174 img.setPosition = function(nx,ny)\
7175 img.x = nx\
7176 img.y = ny\
7177 img.body.reposition(nx, ny)\
7178 obj.redraw()\
7179 end\
7180\
7181 return img\
7182 end\
7183\
7184 obj.newButton = function(x,y, sizeX, sizeY, textColor, backgroundColor, text, align)\
7185\
7186 local btn = {}\
7187\
7188 btn.body = window.create(obj.body, x,y, sizeX,sizeY)\
7189 btn.x = x\
7190 btn.y = y\
7191\
7192 local function wrtText()\
7193 if text then\
7194 if not align then\
7195 align = \"center\"\
7196 end\
7197\
7198 if align == \"center\" then\
7199 btn.body.setCursorPos(math.floor(sizeX/2)-math.floor(#text/2)+1,math.floor(sizeY/2)+1)\
7200 elseif align == \"left\" then\
7201 btn.body.setCursorPos(1,math.floor(sizeY/2)+1)\
7202 elseif align == \"right\" then\
7203 btn.body.setCursorPos(sizeX-#text+1,math.floor(sizeY/2)+1)\
7204 end\
7205 btn.body.write(text)\
7206 end\
7207 end\
7208\
7209 local anim\
7210 local function animate()\
7211 local xPos, yPos = obj.body.getPosition()\
7212 local xPos2, yPos2 = obj.background.getPosition()\
7213 anim = window.create(mon,x+xPos+xPos2-2,y+yPos+yPos2-2,sizeX,sizeY)\
7214 anim.setBackgroundColor(colors.lightGray)\
7215 anim.clear()\
7216 sleep(0)\
7217 anim.setVisible(false)\
7218 anim.reposition(0,0,0,0)\
7219 btn.body.clear()\
7220 obj.body.redraw()\
7221 obj.header.redraw()\
7222 wrtText()\
7223 end\
7224\
7225 btn.body.setBackgroundColor(backgroundColor)\
7226 btn.body.clear()\
7227 btn.body.setTextColor(textColor)\
7228 wrtText()\
7229\
7230 btn.check = function(nx,ny, anime)\
7231 if anime == nil then\
7232 anime = true\
7233 end\
7234 local xPos, yPos = obj.body.getPosition()\
7235 local xPos2, yPos2 = obj.background.getPosition()\
7236 if obj.active and nx >= btn.x+xPos+xPos2-2 and nx <= btn.x+sizeX+xPos+xPos2-3 and ny-yPos-yPos2+2 >= btn.y and ny-yPos-yPos2+2 <= btn.y+sizeY-1 then\
7237 if anime then\
7238 animate()\
7239 end\
7240 return true\
7241 end\
7242 end\
7243 return btn\
7244 end\
7245\
7246 obj.newDropDownList = function(x,y,size, values, default, txtColor, backColor1, backColor2)\
7247 local menu = {}\
7248 os.loadAPI(\"#API/contexts\")\
7249 local txtColor = txtColor or headerTextColor\
7250 local backColor1 = backColor1 or colors.lightGray\
7251 local backColor2 = backColor2 or colors.gray\
7252 local default = default or \"\"\
7253 local size = size or 12\
7254\
7255 menu.x = x\
7256 menu.y = y\
7257 menu.opened = false\
7258\
7259 menu.values = values\
7260\
7261 if type(default) == \"number\" then\
7262 default = values[default]\
7263 end\
7264 menu.selected = default\
7265\
7266 menu.body = window.create(obj.body, x,y, size,1)\
7267 menu.body.setBackgroundColor(backColor1)\
7268 menu.body.setTextColor(txtColor)\
7269 menu.body.clear()\
7270\
7271 local function redraw()\
7272 menu.body.setBackgroundColor(backColor1)\
7273 menu.body.setTextColor(txtColor)\
7274 menu.body.clear()\
7275 menu.body.setCursorPos(2,1)\
7276 menu.body.write(menu.selected)\
7277 menu.body.setCursorPos(size-2,1)\
7278 if not menu.opened then\
7279 menu.body.setTextColor(backColor2)\
7280 else\
7281 menu.body.setTextColor(backColor1)\
7282 menu.body.write(\" \"..string.char(7)..\" \")\
7283 sleep(0.1)\
7284 menu.body.setCursorPos(size-2,1)\
7285 menu.body.setBackgroundColor(backColor2)\
7286 end\
7287 menu.body.write(\" \"..string.char(7)..\" \")\
7288 end\
7289 redraw()\
7290\
7291 menu.set = function(val)\
7292 if type(val) == \"number\" and menu.values[val] then\
7293 menu.selected = menu.values[val]\
7294 elseif type(val) == \"string\" then\
7295 menu.selected = val\
7296 end\
7297 redraw()\
7298 end\
7299\
7300 menu.open = function()\
7301 menu.opened = true\
7302 redraw()\
7303 local xPos, yPos = obj.body.getPosition()\
7304 local xPos2, yPos2 = obj.background.getPosition()\
7305 local yp, xp = menu.y + yPos + yPos2 - 2, menu.x + xPos + xPos2 - 2\
7306 local inv\
7307 if #menu.values+2 + yp > ySize then\
7308 yp = yp - (#menu.values+2)\
7309 inv = true\
7310 else\
7311 yp = yp + 1\
7312 end\
7313 local answer = contexts.main(xp ,yp ,{color = backColor2, lenth = size, align = \"left\", verticalInverted = inv}, unpack(menu.values))\
7314 obj.redraw()\
7315 if answer then\
7316 menu.selected = answer\
7317 end\
7318 menu.opened = false\
7319 redraw()\
7320 return answer\
7321 end\
7322\
7323 menu.check = function(nx,ny)\
7324 local xPos, yPos = obj.body.getPosition()\
7325 local xPos2, yPos2 = obj.background.getPosition()\
7326 if obj.active and nx >= menu.x+xPos+xPos2-2 and nx <= menu.x+size+xPos+xPos2-3 and ny-yPos-yPos2+2 == menu.y then\
7327 return true\
7328 end\
7329 end\
7330\
7331 return menu\
7332 end\
7333\
7334 obj.newSwitch = function(x,y,color,state)\
7335 if not color then\
7336 color = headerColor\
7337 end\
7338 if not state then\
7339 state = false\
7340 end\
7341 local switch = {}\
7342 local bColor = colors.gray\
7343 local offColor = colors.lightGray\
7344 if backgroundColor == bColor then\
7345 bColor = colors.lightGray\
7346 offColor = colors.white\
7347 end\
7348\
7349 local size = 6\
7350\
7351 switch.x = x\
7352 switch.y = y\
7353 switch.body = window.create(obj.body,x,y,size,1)\
7354 switch.body.setBackgroundColor(bColor)\
7355 switch.body.clear()\
7356 switch.state = state\
7357\
7358 switch.getState = function()\
7359 return switch.state\
7360 end\
7361\
7362 switch.toggle = function()\
7363 switch.body.setBackgroundColor(bColor)\
7364 switch.body.clear()\
7365 if switch.state then\
7366 switch.state = false\
7367 switch.body.setCursorPos(1,1)\
7368 switch.body.setBackgroundColor(offColor)\
7369 else\
7370 switch.state = true\
7371 switch.body.setCursorPos(math.floor(size/2)+1,1)\
7372 switch.body.setBackgroundColor(color)\
7373 end\
7374 switch.body.write(\" \")\
7375 end\
7376\
7377 switch.toggle()\
7378 switch.toggle()\
7379\
7380 switch.check = function(nx,ny)\
7381 local xPos, yPos = obj.body.getPosition()\
7382 local xPos2, yPos2 = obj.background.getPosition()\
7383 if obj.active and nx >= switch.x+xPos+xPos2-2 and nx <= switch.x+size+xPos+xPos2-3 and ny-yPos-yPos2+2 == switch.y then\
7384 switch.toggle()\
7385 return true\
7386 end\
7387 end\
7388\
7389 return switch\
7390 end\
7391\
7392 obj.newRange = function(x,y,size,default,color)\
7393 local range = {}\
7394 range.body = window.create(obj.body,x,y,size,1)\
7395 range.body.setBackgroundColor(backgroundColor)\
7396 range.body.clear()\
7397 range.x = x\
7398 range.y = y\
7399\
7400 if not default then\
7401 default = 50\
7402 end\
7403\
7404 range.percent = default\
7405 local pos = math.floor(size*range.percent/100)+1\
7406 if pos > size then\
7407 pos = size\
7408 end\
7409\
7410 if not color then\
7411 color = headerColor\
7412 end\
7413\
7414 local function redraw()\
7415 range.body.setTextColor(color)\
7416\
7417 for i=1,pos do\
7418 range.body.setCursorPos(i,1)\
7419 range.body.write(string.char(140))\
7420 end\
7421\
7422 -- range.body.setBackgroundColor(color)\
7423 range.body.setCursorPos(pos,1)\
7424 range.body.write(string.char(8))\
7425 -- range.body.setBackgroundColor(backgroundColor)\
7426\
7427 range.body.setTextColor(colors.lightGray)\
7428 for i=pos+1,size do\
7429 range.body.setCursorPos(i,1)\
7430 range.body.write(string.char(140))\
7431 end\
7432 end\
7433\
7434 redraw()\
7435\
7436 range.set = function(per)\
7437 range.percent = per\
7438 pos = math.floor(size*range.percent/100)+1\
7439 if pos > size then\
7440 pos = size\
7441 end\
7442 redraw()\
7443 end\
7444\
7445 range.check = function(nx,ny)\
7446 local xPos, yPos = obj.body.getPosition()\
7447 local xPos2, yPos2 = obj.background.getPosition()\
7448 if obj.active and nx >= range.x+xPos+xPos2-2 and nx <= range.x+size+xPos+xPos2-3 and ny-yPos-yPos2+2 == range.y then\
7449 range.percent = (nx-xPos+1-range.x)/size*100\
7450 if range.percent < 50 then\
7451 range.percent = math.ceil((nx-xPos+1-range.x)/size*100)\
7452 elseif range.percent > 50 then\
7453 range.percent = math.floor((nx-xPos+2-range.x)/size*100)\
7454 end\
7455 pos = math.floor(size*range.percent/100)+1\
7456\
7457 if pos > size then\
7458 pos = size\
7459 end\
7460 redraw()\
7461 return true\
7462 end\
7463 end\
7464\
7465 return range\
7466 end\
7467\
7468 obj.newRadioSet = function(x,y, texts, default, size, txColor)\
7469 if not default then\
7470 default = 1\
7471 end\
7472\
7473 local radio = {}\
7474 radio.selectedNum = default\
7475 radio.x = x\
7476 radio.y = y\
7477 radio.selected = texts[default]\
7478\
7479 if not size then\
7480 size = 0\
7481 for i=1,#texts do\
7482 if #texts[i] > size then\
7483 size = #texts[i]\
7484 end\
7485 end\
7486 size = size+2\
7487 end\
7488\
7489 radio.body = window.create(obj.body,x,y,size,#texts*2-1)\
7490 radio.body.setBackgroundColor(backgroundColor)\
7491 radio.body.clear()\
7492\
7493 local function redraw()\
7494 for i=1,#texts do\
7495 radio.body.setTextColor(txColor or textColor)\
7496 radio.body.setCursorPos(1,i*2-1)\
7497 radio.body.write(texts[i])\
7498 radio.body.setCursorPos(size,i*2-1)\
7499 radio.body.setTextColor(textColor)\
7500 radio.body.write(string.char(186))\
7501 end\
7502 radio.body.setTextColor(headerColor)\
7503 radio.body.setCursorPos(size,radio.selectedNum*2-1)\
7504 radio.body.write(string.char(7))\
7505 end\
7506\
7507 redraw()\
7508\
7509 radio.check = function(nx,ny)\
7510 local xPos, yPos = obj.body.getPosition()\
7511 local xPos2, yPos2 = obj.background.getPosition()\
7512 if obj.active and nx >= radio.x+xPos+xPos2-2 and nx <= radio.x+size+xPos+xPos2-3 and ny-yPos-yPos2+2 >= radio.y and ny-yPos-yPos2+2 <= radio.y+#texts*2-2 then\
7513 radio.selectedNum = math.floor((ny-yPos-yPos2+2-radio.y+1)/2)+1\
7514 radio.selected = texts[radio.selectedNum]\
7515 redraw()\
7516 return true\
7517 end\
7518 end\
7519\
7520 radio.set = function(num)\
7521 local num = num or default\
7522 if type(num) == \"string\" then\
7523 for i=1, #texts do\
7524 if texts[i] == num then\
7525 radio.selectedNum = i\
7526 radio.selected = texts[i]\
7527 break\
7528 end\
7529 end\
7530 elseif type(num) == \"number\" then\
7531 radio.selectedNum = num\
7532 radio.selected = texts[num]\
7533 end\
7534 redraw()\
7535 end\
7536\
7537 return radio\
7538 end\
7539\
7540 obj.newProgressBar = function(x,y,size,default,color, waiting)\
7541 if not default then\
7542 default = 0\
7543 end\
7544 local bar = {}\
7545 bar.waiting = waiting\
7546 bar.percent = default\
7547 bar.body = window.create(obj.body,x,y,size,1)\
7548 bar.x = x\
7549 bar.y = y\
7550\
7551 local pos = math.floor(size*bar.percent/100)\
7552 if pos > size then\
7553 pos = size\
7554 end\
7555\
7556 if not color then\
7557 color = headerColor\
7558 end\
7559\
7560 bar.body.setBackgroundColor(backgroundColor)\
7561 bar.body.clear()\
7562 local function redraw()\
7563 bar.body.setTextColor(color)\
7564\
7565 for i=1,pos do\
7566 bar.body.setCursorPos(i,1)\
7567 bar.body.write(string.char(140))\
7568 end\
7569\
7570 bar.body.setTextColor(colors.lightGray)\
7571\
7572 if bar.waiting then\
7573 for i=1,pos-math.floor(size/2.5) do\
7574 bar.body.setCursorPos(i,1)\
7575 bar.body.write(string.char(140))\
7576 end\
7577 end\
7578\
7579 for i=pos+1,size do\
7580 bar.body.setCursorPos(i,1)\
7581 bar.body.write(string.char(140))\
7582 end\
7583 end\
7584\
7585 redraw()\
7586\
7587 bar.setPercent = function(n)\
7588 if n >= 0 and ((n <= 100) or (n <= 142 and bar.waiting)) then\
7589 bar.percent = n\
7590 pos = math.floor(size*bar.percent/100)\
7591 redraw()\
7592 end\
7593 end\
7594\
7595 return bar\
7596 end\
7597\
7598 obj.newInput = function(x,y,size,default,description, align,char, slim)\
7599 local input = {}\
7600 local align = align or \"left\"\
7601 local size = size or 12\
7602 local sizeY = (not slim and 3) or 1\
7603 input.body = window.create(obj.body,x,y,size,sizeY)\
7604 input.x = x\
7605 input.y = y\
7606\
7607 --[[if backgroundColor == colors.lightGray then\
7608 input.body.setBackgroundColor(colors.white)\
7609 else\
7610 input.body.setBackgroundColor(backgroundColor)\
7611 end]]\
7612 input.body.setBackgroundColor(textColor)\
7613 input.body.setTextColor(backgroundColor)\
7614\
7615 local default = tostring(default) or \"\"\
7616 local description = description\
7617 input.text = default\
7618\
7619 local function redraw()\
7620 input.body.clear()\
7621 if align == \"left\" then\
7622 input.body.setCursorPos(2,math.floor((sizeY+1)/2))\
7623 elseif align == \"center\" then\
7624 input.body.setCursorPos(math.floor(size/2) - math.floor(#tostring(input.text)/2)+1,math.floor((sizeY+1)/2))\
7625 elseif align == \"right\" then\
7626 input.body.setCursorPos(math.floor(size - #tostring(input.text)),math.floor((sizeY+1)/2))\
7627 end\
7628 if char and input.text ~= default then\
7629 for i=1,#input.text do\
7630 input.body.write(char)\
7631 end\
7632 elseif input.text ~= \"\" then\
7633 input.body.write(input.text)\
7634 else\
7635 -- input.body.setTextColor(colors.gray)\
7636 input.body.write(description)\
7637 -- input.body.setTextColor(backgroundColor)\
7638 end\
7639 if #input.text > size-1 then\
7640 input.body.setCursorPos(size-2,math.floor((sizeY+1)/2))\
7641 input.body.write(\".. \")\
7642 end\
7643 end\
7644\
7645 redraw()\
7646\
7647 input.set = function(txt)\
7648 input.text = tostring(txt) or \"\"\
7649 redraw()\
7650 end\
7651\
7652 input.check = function(nx,ny)\
7653 local xPos, yPos = obj.body.getPosition()\
7654 local xPos2, yPos2 = obj.background.getPosition()\
7655 if obj.active and nx >= input.x+xPos+xPos2-2 and nx <= input.x+size+xPos+xPos2-3 and ny-yPos-yPos2+2 >= input.y and ny-yPos-yPos2+2 <= input.y+sizeY-1 then\
7656 input.body.setCursorPos(input.x+1,math.floor((sizeY+1)/2))\
7657 input.body.clear()\
7658 input.body.setBackgroundColor(textColor)\
7659 input.body.setTextColor(backgroundColor)\
7660 local bt = term.redirect(input.body)\
7661 input.text = startInput(input.body, 2, math.floor((sizeY+1)/2), size-2, input.text, char) --read(char)\
7662 term.redirect(bt)\
7663 redraw()\
7664 return true\
7665 end\
7666 end\
7667\
7668 return input\
7669 end\
7670\
7671 -- obj.header.setTextColor(headerTextColor)\
7672 -- obj.header.setBackgroundColor(headerColor)\
7673 -- obj.header.clear()\
7674 -- obj.header.write(\" \"..header)\
7675 obj.setHeader(header)\
7676\
7677 obj.body.setTextColor(textColor)\
7678 obj.body.setBackgroundColor(backgroundColor)\
7679 obj.body.clear()\
7680\
7681 if backgroundColor == colors.lightGray then\
7682 obj.scroller.setBackgroundColor(colors.white)\
7683 else\
7684 obj.scroller.setBackgroundColor(colors.lightGray)\
7685 end\
7686 obj.scroller.clear()\
7687\
7688 obj.scrollerB.setBackgroundColor(backgroundColor)\
7689 obj.scrollerB.clear()\
7690\
7691 table.insert(screens, obj)\
7692 return obj\
7693end\
7694\
7695\
7696-------------------------------------------------------------------\
7697---------------------------DIALOGS--------------------------------\
7698\
7699local function createDialog(header, text, size)\
7700 local dialog = newScreen(colors.gray, colors.white, colors.white, colors.gray, \"\", true, -1, -1, 2, 0, 0)\
7701 dialog.opened = false\
7702 dialog.active = false\
7703 dialog.header.setVisible(false)\
7704 dialog.header.reposition(-1,-1,0,0)\
7705\
7706 if not text then text = \" \" end\
7707 if not header then header = \" \" end\
7708 if not size then size = 0 end\
7709\
7710 local sizeX = 28\
7711 local posX = math.floor(xSize/2)-math.floor(sizeX/2)+1\
7712\
7713 local linesNum = printText(dialog.header, text, 2, 4, sizeX-2, \"center\", colors.gray)\
7714 if linesNum < 1 then\
7715 linesNum = 1\
7716 end\
7717 local sizeY = 5+linesNum+size\
7718 dialog.background.reposition(posX, -sizeY, sizeX, sizeY)\
7719 dialog.body.reposition(1, 1, sizeX, sizeY)\
7720\
7721 os.drawImage(\"#SysRes/Images/dialog_top.png\",1,1, dialog.body)\
7722 dialog.body.setCursorPos(math.floor(sizeX/2)-math.floor(#header/2), 2)\
7723 dialog.body.setTextColor(colors.white)\
7724 dialog.body.write(header)\
7725 for i=1,sizeY-1 do\
7726 os.drawImage(\"#SysRes/Images/dialog_middle.png\",1,3+i, dialog.body)\
7727 end\
7728 os.drawImage(\"#SysRes/Images/dialog_bottom.png\",1,sizeY-1, dialog.body)\
7729\
7730\
7731 dialog.body.setBackgroundColor(colors.white)\
7732 printText(dialog.body, text, 2, 4, sizeX-2, \"center\", colors.gray)\
7733\
7734 dialog.pos = posX\
7735 dialog.sizeX = sizeX\
7736 dialog.sizeY = sizeY\
7737\
7738 return dialog\
7739end\
7740\
7741local function showDialog(diag)\
7742 diag.opened = true\
7743 diag.active = true\
7744 for i=1,math.floor(diag.sizeY/2) do\
7745 diag.background.reposition(diag.pos, -diag.sizeY+i*2+1)\
7746 sleep(0)\
7747 end\
7748 diag.background.reposition(diag.pos, 1)\
7749end\
7750\
7751local function closeDialog(diag)\
7752 diag.opened = false\
7753 diag.active = false\
7754 for i=1,math.floor(diag.sizeY/2)+1 do\
7755 term.current().redraw()\
7756 for i,scr in ipairs(screens) do\
7757 if scr.active then\
7758 scr.redraw()\
7759 end\
7760 end\
7761 diag.background.reposition(diag.pos, -i*2-1)\
7762 -- sleep(0)\
7763 end\
7764end\
7765\
7766local function animate(trm, x,y, txt)\
7767 trm.setCursorPos(x,y)\
7768 trm.setTextColor(colors.white)\
7769 trm.setBackgroundColor(colors.gray)\
7770 trm.write(\" \"..txt..\" \")\
7771 sleep(0.1)\
7772 trm.setCursorPos(x,y)\
7773 trm.setTextColor(colors.gray)\
7774 trm.setBackgroundColor(colors.white)\
7775 trm.write(\" \"..txt..\" \")\
7776end\
7777\
7778\
7779\
7780function alert(header, text)\
7781 local dialog = createDialog(header, text)\
7782\
7783 local okbtn = dialog.newButton(dialog.sizeX-5,dialog.sizeY,4,1, colors.gray,colors.white, \"ok\")\
7784\
7785 dialog.close = function()\
7786 if dialog.opened then\
7787 closeDialog(dialog)\
7788 end\
7789 end\
7790\
7791 dialog.show = function()\
7792 if not dialog.opened then\
7793 showDialog(dialog)\
7794 while true do\
7795 local event, side, x, y = os.pullEvent()\
7796 if event == \"mouse_click\" then\
7797 if okbtn.check(x,y) then\
7798 dialog.close()\
7799 break\
7800 end\
7801 end\
7802 end\
7803 end\
7804 end\
7805\
7806 return dialog\
7807end\
7808\
7809function select(header, text, btn1, btn2, cancel)\
7810 local dialog = createDialog(header, text)\
7811\
7812 local btn_1 = dialog.newButton(dialog.sizeX-#tostring(btn1)-#tostring(btn2)-6,dialog.sizeY,#tostring(btn1)+2,1, colors.gray,colors.white, btn1)\
7813 local btn_2 = dialog.newButton(dialog.sizeX-#tostring(btn2)-3,dialog.sizeY,#tostring(btn2)+2,1, colors.gray,colors.white, btn2)\
7814 if cancel then\
7815 btn_cancel = dialog.newButton(3,dialog.sizeY,3,1, colors.gray,colors.white, \"x\")\
7816 end\
7817\
7818 dialog.close = function()\
7819 if dialog.opened then\
7820 closeDialog(dialog)\
7821 end\
7822 end\
7823\
7824 dialog.show = function()\
7825 if not dialog.opened then\
7826 showDialog(dialog)\
7827 while true do\
7828 local event, side, x, y = os.pullEvent()\
7829 if event == \"mouse_click\" then\
7830 if btn_1.check(x,y) then\
7831 dialog.close()\
7832 return btn1\
7833 elseif btn_2.check(x,y) then\
7834 dialog.close()\
7835 return btn2\
7836 elseif btn_cancel.check(x,y) then\
7837 dialog.close()\
7838 break\
7839 end\
7840 end\
7841 end\
7842 end\
7843 end\
7844\
7845 return dialog\
7846end\
7847\
7848function inputDialog(header, text, btn1, btn2, cancel, ...)\
7849 local fields = {...}\
7850 local inputs = {}\
7851 local dialog = createDialog(header, text, #fields*2)\
7852\
7853 local btn_1 = dialog.newButton(dialog.sizeX-#tostring(btn1)-#tostring(btn2)-6,dialog.sizeY,#tostring(btn1)+2,1, colors.gray,colors.white, btn1)\
7854 local btn_2 = dialog.newButton(dialog.sizeX-#tostring(btn2)-3,dialog.sizeY,#tostring(btn2)+2,1, colors.gray,colors.white, btn2)\
7855 if cancel then\
7856 btn_cancel = dialog.newButton(3,dialog.sizeY,3,1, colors.gray,colors.white, \"x\")\
7857 end\
7858\
7859 for i,field in ipairs(fields) do\
7860 table.insert(inputs, dialog.newInput(3,dialog.sizeY-#fields*2+i*2-2,dialog.sizeX-4,\"\",field,nil,nil,true))\
7861 end\
7862\
7863 dialog.close = function()\
7864 if dialog.opened then\
7865 closeDialog(dialog)\
7866 end\
7867 end\
7868\
7869 dialog.getInputData = function()\
7870 local out = {}\
7871 for i,inp in ipairs(inputs) do\
7872 out[fields[i]] = inp.text\
7873 end\
7874\
7875 return out\
7876 end\
7877\
7878 dialog.show = function()\
7879 if not dialog.opened then\
7880 showDialog(dialog)\
7881 while true do\
7882 local event, side, x, y = os.pullEvent()\
7883 if event == \"mouse_click\" then\
7884 if btn_1.check(x,y) then\
7885 dialog.close()\
7886 return btn1, dialog.getInputData()\
7887 elseif btn_2.check(x,y) then\
7888 dialog.close()\
7889 return btn2, dialog.getInputData()\
7890 elseif btn_cancel.check(x,y) then\
7891 dialog.close()\
7892 break\
7893 else\
7894 for i,inp in ipairs(inputs) do\
7895 if inp.check(x,y) then\
7896 break\
7897 end\
7898 end\
7899 end\
7900 end\
7901 end\
7902 end\
7903 end\
7904\
7905 return dialog\
7906end\
7907\
7908function getName()\
7909 return name\
7910end\
7911\
7912function getVersion()\
7913 return version\
7914end",
7915 advanced_read = "--Advanced read API\
7916--0.8\
7917\
7918function read(trm, x,y, xSize, text, char)\
7919 local pointer = 1\
7920 local posS = 1\
7921 local posE = xSize-1\
7922 if text then\
7923 pointer = #text+1\
7924 if #text > xSize then\
7925 posS = #text-xSize+2\
7926 posE = #text\
7927 end\
7928 end\
7929 local text = text or \"\"\
7930 local textCleaner = \"\"\
7931 for i=1,xSize do\
7932 textCleaner = textCleaner..\" \"\
7933 end\
7934\
7935 local function redrawText()\
7936\
7937 trm.setCursorPos(x,y)\
7938 trm.write(textCleaner)\
7939\
7940 local txt = text\
7941 if #text >= xSize-4 then\
7942 txt = string.sub(text, posS, posE)\
7943 end\
7944 trm.setCursorPos(x,y)\
7945 if not char then\
7946 trm.write(txt)\
7947 else\
7948 for i=1, #txt do\
7949 trm.write(char)\
7950 end\
7951 end\
7952 if posS > 1 then\
7953 trm.setCursorPos(x,y)\
7954 trm.write(\"..\")\
7955 end\
7956 if posE < #text then\
7957 trm.setCursorPos(x+xSize-2,y)\
7958 trm.write(\"..\")\
7959 end\
7960 end\
7961\
7962 redrawText()\
7963\
7964 while true do\
7965 local ev, sd, mx, my = os.pullEvent()\
7966 -- trm.setCursorPos(x+pointer-posS, y)\
7967 -- trm.setCursorBlink(true)\
7968 if ev == 'key' then\
7969 if sd == keys.enter then\
7970 trm.setCursorBlink(false)\
7971 return text\
7972 elseif sd == keys.backspace and pointer > 1 then\
7973 if pointer > #text then\
7974 text = string.sub(text, 0, #text-1)\
7975 else\
7976 text = string.sub(text, 0, pointer-2)..string.sub(text, pointer, #text)\
7977 end\
7978 pointer = pointer-1\
7979 if x+pointer-posS < x+xSize-3 and posS > 1 then\
7980 posS = posS-1\
7981 if #text < xSize-4 then\
7982 posS = 1\
7983 end\
7984 posE = posS+xSize-2\
7985 end\
7986 elseif sd == keys[\"end\"] then\
7987 pointer = #text + 1\
7988\
7989 if x+pointer-posS > x+xSize-3 then\
7990 posS = #text-xSize+3\
7991 posE = #text\
7992 end\
7993 elseif sd == keys.home then\
7994 pointer = 1\
7995\
7996 posS = 1\
7997 posE = xSize-2\
7998 elseif sd == keys.delete then\
7999 if pointer <= #text then\
8000 text = string.sub(text, 0, pointer-1)..string.sub(text, pointer+1, #text)\
8001 if #text < xSize-4 then\
8002 posE = xSize-2\
8003 end\
8004 end\
8005 elseif sd == keys.left then\
8006 if pointer > 1 then\
8007 pointer = pointer - 1\
8008 if x+pointer-posS < x+math.floor(xSize/2) and posS > 1 then\
8009 posS = posS-1\
8010 if #text < xSize-4 then\
8011 posS = 1\
8012 end\
8013 posE = posS+xSize-2\
8014 end\
8015 end\
8016 elseif sd == keys.right then\
8017 if pointer < #text+1 then\
8018 pointer = pointer + 1\
8019 if x+pointer-posS > x+math.floor(xSize/2) then\
8020 posS = posS+1\
8021 posE = posS+xSize-1\
8022 end\
8023 end\
8024 end\
8025 elseif ev == 'char' and sd ~= nil then\
8026 text = string.sub(text, 0, pointer-1)..sd..string.sub(text, pointer, #text)\
8027 pointer = pointer + 1\
8028 if x+pointer-posS > x+xSize-2 then\
8029 posS = posS+1\
8030 posE = posS+xSize-2\
8031 end\
8032 elseif ev == \"paste\" then\
8033 text = text..sd\
8034 pointer = #text + 1\
8035 if #text > xSize then\
8036 posS = #text-xSize+2\
8037 posE = #text\
8038 else\
8039 posS = 1\
8040 posE = #text\
8041 end\
8042 elseif ev == \"mouse_click\" then\
8043 trm.setCursorBlink(false)\
8044 return text\
8045 elseif ev == \"mouse_scroll\" then\
8046 trm.setCursorBlink(false)\
8047 return text\
8048 end\
8049\
8050 redrawText()\
8051 trm.setCursorPos(x+pointer-posS, y)\
8052 trm.setCursorBlink(true)\
8053 end\
8054end",
8055 },
8056}
8057
8058
8059
8060
8061
8062
8063
8064
8065local function writeFile(path,content)
8066 local file = fs.open(path,"w")
8067 file.write(content)
8068 file.close()
8069end
8070function writeDown(input,dir)
8071 for i,v in pairs(input) do
8072 if type(v) == "table" then
8073 writeDown(v,dir.."/"..i)
8074 elseif type(v) == "string" then
8075 writeFile(dir.."/"..i,v)
8076 end
8077 end
8078end
8079
8080args = {...}
8081if #args == 0 then
8082 print("Please input a destination folder.")
8083else
8084 writeDown(inputTable,args[1])
8085end
8086