SHOW:
|
|
- or go back to the newest paste.
1 | ### Hier bitte nix mehr machen auå9Fer du weiå9Ft was du machst! ### | |
2 | function clear() | |
3 | term.clear() | |
4 | term.setCursorPos(1,1) | |
5 | end | |
6 | print( "Copyright by Birog" ) | |
7 | write( "Es wird nach Updates gesucht... " ) | |
8 | - | local response = http.get("http://pastebin.com/raw.php?i=YbBfnA5b") |
8 | + | local response = http.get("http://pastebin.com/raw.php?i=jSgWWuV4") |
9 | if response then | |
10 | print("Update-suche erfolgreich!") | |
11 | local sSource = response.readAll() | |
12 | response.close() | |
13 | local file = fs.open( "startup", "r" ) | |
14 | local sTarget = "" | |
15 | if file then | |
16 | sTarget = file.readAll() | |
17 | file.close() | |
18 | end | |
19 | if sSource ~= sTarget then | |
20 | term.write("Updates gefunden!") | |
21 | file = fs.open( "startup", "w" ) | |
22 | file.write( sSource ) | |
23 | file.close() | |
24 | print( "Wurde herruntergeladen als - startup - -Datei") | |
25 | print("Programm wird Neugestartet!") | |
26 | shell.run("startup") | |
27 | return | |
28 | else | |
29 | print("Es sind keine Updates vorhanden!") | |
30 | print("Programm wird gestartet!") | |
31 | sleep(3) | |
32 | clear() | |
33 | end | |
34 | else | |
35 | clear() | |
36 | print("ERROR! Informiere bitte Birog!!") | |
37 | clear() | |
38 | end | |
39 | ------------------------------------------------------------------------------------------------------------------- | |
40 | rednet.open("bottom") | |
41 | moniside = "top" | |
42 | -- | |
43 | redout = "bottom" | |
44 | ||
45 | -- | |
46 | adminpass = "5555" | |
47 | ||
48 | term = peripheral.wrap(moniside) | |
49 | --local pullEvent = os.pullEvent | |
50 | --os.pullEvent = os.pullEventRaw | |
51 | ||
52 | function Rahmen() | |
53 | term.clear() | |
54 | term.setTextColor(colors.white) | |
55 | -- Information | |
56 | -- Anzeige oben | |
57 | term.setCursorPos(1,1) | |
58 | term.setBackgroundColor(colors.lightBlue) | |
59 | term.write(" ") | |
60 | term.setCursorPos(2,1) | |
61 | term.setBackgroundColor(colors.lightBlue) | |
62 | term.write(" ") | |
63 | term.setBackgroundColor(colors.black) | |
64 | term.setCursorPos(3,1) | |
65 | term.setBackgroundColor(colors.lightBlue) | |
66 | term.write(" ") | |
67 | term.setBackgroundColor(colors.black) | |
68 | term.setCursorPos(4,1) | |
69 | term.setBackgroundColor(colors.lightBlue) | |
70 | term.write(" ") | |
71 | term.setBackgroundColor(colors.black) | |
72 | term.setCursorPos(5,1) | |
73 | term.setBackgroundColor(colors.lightBlue) | |
74 | term.write(" ") | |
75 | term.setBackgroundColor(colors.black) | |
76 | term.setCursorPos(6,1) | |
77 | term.setBackgroundColor(colors.lightBlue) | |
78 | term.write(" ") | |
79 | term.setBackgroundColor(colors.black) | |
80 | term.setCursorPos(7,1) | |
81 | term.setBackgroundColor(colors.lightBlue) | |
82 | term.write(" ") | |
83 | term.setBackgroundColor(colors.black) | |
84 | -- Anzeige unten | |
85 | term.setCursorPos(1,5) | |
86 | term.setBackgroundColor(colors.lightBlue) | |
87 | term.write(" ") | |
88 | term.setBackgroundColor(colors.black) | |
89 | term.setCursorPos(2,5) | |
90 | term.setBackgroundColor(colors.lightBlue) | |
91 | term.write(" ") | |
92 | term.setBackgroundColor(colors.black) | |
93 | term.setCursorPos(3,5) | |
94 | term.setBackgroundColor(colors.lightBlue) | |
95 | term.write(" ") | |
96 | term.setBackgroundColor(colors.black) | |
97 | term.setCursorPos(4,5) | |
98 | term.setBackgroundColor(colors.lightBlue) | |
99 | term.write(" ") | |
100 | term.setBackgroundColor(colors.black) | |
101 | term.setCursorPos(5,5) | |
102 | term.setBackgroundColor(colors.lightBlue) | |
103 | term.write(" ") | |
104 | term.setBackgroundColor(colors.black) | |
105 | term.setCursorPos(6,5) | |
106 | term.setBackgroundColor(colors.lightBlue) | |
107 | term.write(" ") | |
108 | term.setBackgroundColor(colors.black) | |
109 | term.setCursorPos(7,5) | |
110 | term.setBackgroundColor(colors.lightBlue) | |
111 | term.write(" ") | |
112 | term.setBackgroundColor(colors.black) | |
113 | -- Anzeige links | |
114 | term.setCursorPos(1,2) | |
115 | term.setBackgroundColor(colors.lightBlue) | |
116 | term.write(" ") | |
117 | term.setBackgroundColor(colors.black) | |
118 | term.setCursorPos(1,3) | |
119 | term.setBackgroundColor(colors.lightBlue) | |
120 | term.write(" ") | |
121 | term.setBackgroundColor(colors.black) | |
122 | term.setCursorPos(1,4) | |
123 | term.setBackgroundColor(colors.lightBlue) | |
124 | term.write(" ") | |
125 | term.setBackgroundColor(colors.black) | |
126 | --Anzeige rechts | |
127 | term.setCursorPos(7,2) | |
128 | term.setBackgroundColor(colors.lightBlue) | |
129 | term.write(" ") | |
130 | term.setBackgroundColor(colors.black) | |
131 | term.setCursorPos(7,3) | |
132 | term.setBackgroundColor(colors.lightBlue) | |
133 | term.write(" ") | |
134 | term.setBackgroundColor(colors.black) | |
135 | term.setCursorPos(7,4) | |
136 | term.setBackgroundColor(colors.lightBlue) | |
137 | term.write(" ") | |
138 | term.setBackgroundColor(colors.black) | |
139 | end | |
140 | ||
141 | function Knoepf() | |
142 | -- Reihe 1 | |
143 | term.setCursorPos(2,2) | |
144 | term.setBackgroundColor(colors.brown) | |
145 | term.write(" ") | |
146 | term.setBackgroundColor(colors.black) | |
147 | term.setCursorPos(3,2) | |
148 | term.setBackgroundColor(colors.brown) | |
149 | term.write(" ") | |
150 | term.setBackgroundColor(colors.black) | |
151 | term.setCursorPos(4,2) | |
152 | term.setBackgroundColor(colors.brown) | |
153 | term.write(" ") | |
154 | term.setBackgroundColor(colors.black) | |
155 | term.setCursorPos(5,2) | |
156 | term.setBackgroundColor(colors.brown) | |
157 | term.write(" ") | |
158 | term.setBackgroundColor(colors.black) | |
159 | term.setCursorPos(6,2) | |
160 | term.setBackgroundColor(colors.brown) | |
161 | term.write(" ") | |
162 | term.setBackgroundColor(colors.black) | |
163 | -- Reihe 2 | |
164 | term.setCursorPos(2,3) | |
165 | term.setBackgroundColor(colors.brown) | |
166 | term.write(" ") | |
167 | term.setBackgroundColor(colors.black) | |
168 | term.setCursorPos(3,3) | |
169 | term.setBackgroundColor(colors.brown) | |
170 | term.write(" ") | |
171 | term.setBackgroundColor(colors.black) | |
172 | term.setCursorPos(4,3) | |
173 | term.setBackgroundColor(colors.brown) | |
174 | term.write(" ") | |
175 | term.setBackgroundColor(colors.black) | |
176 | term.setCursorPos(5,3) | |
177 | term.setBackgroundColor(colors.brown) | |
178 | term.write(" ") | |
179 | term.setBackgroundColor(colors.black) | |
180 | term.setCursorPos(6,3) | |
181 | term.setBackgroundColor(colors.brown) | |
182 | term.write(" ") | |
183 | term.setBackgroundColor(colors.black) | |
184 | -- Reihe 3 | |
185 | term.setCursorPos(2,4) | |
186 | term.setBackgroundColor(colors.brown) | |
187 | term.write(" ") | |
188 | term.setBackgroundColor(colors.black) | |
189 | term.setCursorPos(3,4) | |
190 | term.setBackgroundColor(colors.brown) | |
191 | term.write(" ") | |
192 | term.setBackgroundColor(colors.black) | |
193 | term.setCursorPos(4,4) | |
194 | term.setBackgroundColor(colors.brown) | |
195 | term.write(" ") | |
196 | term.setBackgroundColor(colors.black) | |
197 | term.setCursorPos(5,4) | |
198 | term.setBackgroundColor(colors.brown) | |
199 | term.write(" ") | |
200 | term.setBackgroundColor(colors.black) | |
201 | term.setCursorPos(6,4) | |
202 | term.setBackgroundColor(colors.brown) | |
203 | term.write(" ") | |
204 | term.setBackgroundColor(colors.black) | |
205 | end | |
206 | ||
207 | function Knoepfon() | |
208 | -- Reihe 1 | |
209 | term.setCursorPos(2,2) | |
210 | term.setBackgroundColor(colors.lightGray) | |
211 | term.write(" ") | |
212 | term.setBackgroundColor(colors.black) | |
213 | term.setCursorPos(3,2) | |
214 | term.setBackgroundColor(colors.lightGray) | |
215 | term.write(" ") | |
216 | term.setBackgroundColor(colors.black) | |
217 | term.setCursorPos(4,2) | |
218 | term.setBackgroundColor(colors.lightGray) | |
219 | term.write(" ") | |
220 | term.setBackgroundColor(colors.black) | |
221 | term.setCursorPos(5,2) | |
222 | term.setBackgroundColor(colors.lightGray) | |
223 | term.write(" ") | |
224 | term.setBackgroundColor(colors.black) | |
225 | term.setCursorPos(6,2) | |
226 | term.setBackgroundColor(colors.lightGray) | |
227 | term.write(" ") | |
228 | term.setBackgroundColor(colors.black) | |
229 | -- Reihe 2 | |
230 | term.setCursorPos(2,3) | |
231 | term.setBackgroundColor(colors.lightGray) | |
232 | term.write(" ") | |
233 | term.setBackgroundColor(colors.black) | |
234 | term.setCursorPos(3,3) | |
235 | term.setBackgroundColor(colors.lightGray) | |
236 | term.write(" ") | |
237 | term.setBackgroundColor(colors.black) | |
238 | term.setCursorPos(4,3) | |
239 | term.setBackgroundColor(colors.lightGray) | |
240 | term.write(" ") | |
241 | term.setBackgroundColor(colors.black) | |
242 | term.setCursorPos(5,3) | |
243 | term.setBackgroundColor(colors.lightGray) | |
244 | term.write(" ") | |
245 | term.setBackgroundColor(colors.black) | |
246 | term.setCursorPos(6,3) | |
247 | term.setBackgroundColor(colors.lightGray) | |
248 | term.write(" ") | |
249 | term.setBackgroundColor(colors.black) | |
250 | -- Reihe 3 | |
251 | term.setCursorPos(2,4) | |
252 | term.setBackgroundColor(colors.lightGray) | |
253 | term.write(" ") | |
254 | term.setBackgroundColor(colors.black) | |
255 | term.setCursorPos(3,4) | |
256 | term.setBackgroundColor(colors.lightGray) | |
257 | term.write(" ") | |
258 | term.setBackgroundColor(colors.black) | |
259 | term.setCursorPos(4,4) | |
260 | term.setBackgroundColor(colors.lightGray) | |
261 | term.write(" ") | |
262 | term.setBackgroundColor(colors.black) | |
263 | term.setCursorPos(5,4) | |
264 | term.setBackgroundColor(colors.lightGray) | |
265 | term.write(" ") | |
266 | term.setBackgroundColor(colors.black) | |
267 | term.setCursorPos(6,4) | |
268 | term.setBackgroundColor(colors.lightGray) | |
269 | term.write(" ") | |
270 | term.setBackgroundColor(colors.black) | |
271 | end | |
272 | ||
273 | function Eingabe() | |
274 | event,side,x,y = os.pullEvent() | |
275 | if event == "terminate" then | |
276 | write("Admin Passwort:") | |
277 | admin = read("*") | |
278 | if admin == adminpass then | |
279 | os.pullEvent = pullEvent | |
280 | write("Richtig! Mache jetzt nochmal STRG + T fåBCr 4 sec") | |
281 | sleep(5) | |
282 | end | |
283 | end | |
284 | ||
285 | if event == "monitor_touch" then | |
286 | ||
287 | if x == 2 and y == 2 or | |
288 | x == 3 and y == 2 or | |
289 | x == 4 and y == 2 or | |
290 | x == 5 and y == 2 or | |
291 | x == 6 and y == 2 or | |
292 | x == 2 and y == 3 or | |
293 | x == 3 and y == 3 or | |
294 | x == 4 and y == 3 or | |
295 | x == 5 and y == 3 or | |
296 | x == 6 and y == 3 or | |
297 | x == 2 and y == 4 or | |
298 | x == 3 and y == 4 or | |
299 | x == 4 and y == 4 or | |
300 | x == 5 and y == 4 or | |
301 | x == 6 and y == 4 then | |
302 | Knoepfon() | |
303 | - | rednet.send(6,"Up",true) |
303 | + | rednet.send(6,"Down",true) |
304 | sleep(5) | |
305 | Knoepf() | |
306 | end | |
307 | ||
308 | ||
309 | end | |
310 | end | |
311 | ||
312 | Rahmen() | |
313 | Knoepf() | |
314 | while true do | |
315 | Eingabe() | |
316 | end |