SHOW:
|
|
- or go back to the newest paste.
1 | rednet.open("bottom") | |
2 | count=0 | |
3 | a=0 | |
4 | b=0 | |
5 | c=0 | |
6 | d=0 | |
7 | e=0 | |
8 | f=0 | |
9 | eingabe=0 | |
10 | - | function Rahmen() |
10 | + | |
11 | - | shell.run("clear") |
11 | + | |
12 | - | term.setBackgroundColor(colors.green) |
12 | + | --Funktion Rahmen |
13 | - | term.setCursorPos(3,2) |
13 | + | function Rahmen() |
14 | - | print("123") |
14 | + | shell.run("clear") |
15 | - | term.setCursorPos(3,3) |
15 | + | term.setBackgroundColor(colors.green) |
16 | - | print("456") |
16 | + | term.setCursorPos(2,3) |
17 | - | term.setCursorPos(3,4) |
17 | + | print("1") |
18 | - | print("789") |
18 | + | term.setCursorPos(4,3) |
19 | - | term.setCursorPos(3,5) |
19 | + | print("2") |
20 | - | print("*0#") |
20 | + | term.setCursorPos(6,3) |
21 | print("3") | |
22 | term.setCursorPos(2,5) | |
23 | - | term.setBackgroundColor(colors.black) |
23 | + | print("4") |
24 | term.setCursorPos(4,5) | |
25 | print("5") | |
26 | term.setCursorPos(6,5) | |
27 | print("6") | |
28 | term.setCursorPos(2,7) | |
29 | print("7") | |
30 | term.setCursorPos(4,7) | |
31 | print("8") | |
32 | term.setCursorPos(6,7) | |
33 | print("9") | |
34 | term.setCursorPos(2,9) | |
35 | print("*") | |
36 | term.setCursorPos(4,9) | |
37 | print("0") | |
38 | term.setCursorPos(6,9) | |
39 | print("#") | |
40 | term.setCursorPos(2,10) | |
41 | print("") | |
42 | end | |
43 | ||
44 | --Hintergrund auf Schwarz รคndern | |
45 | term.setBackgroundColor(colors.black) | |
46 | ||
47 | --Funktion der Eingabe | |
48 | function Eingabe() | |
49 | while count < 6 do | |
50 | event,side,x,y = os.pullEvent() | |
51 | if event =="monitor_touch" then | |
52 | ||
53 | if x == 2 and y == 3 then | |
54 | count = count +1 | |
55 | if count == 1 then | |
56 | a = 1 | |
57 | term.setBackgroundColor(colors.black) | |
58 | write("*") | |
59 | elseif count == 2 then | |
60 | b = 1 | |
61 | term.setBackgroundColor(colors.black) | |
62 | write("*") | |
63 | elseif count == 3 then | |
64 | c = 1 | |
65 | term.setBackgroundColor(colors.black) | |
66 | write("*") | |
67 | elseif count == 4 then | |
68 | d = 1 | |
69 | term.setBackgroundColor(colors.black) | |
70 | write("*") | |
71 | elseif count == 5 then | |
72 | e = 1 | |
73 | term.setBackgroundColor(colors.black) | |
74 | write("*") | |
75 | elseif count == 6 then | |
76 | f = 1 | |
77 | term.setBackgroundColor(colors.black) | |
78 | write("*") | |
79 | end | |
80 | end | |
81 | ||
82 | if x == 4 and y == 3 then | |
83 | count = count +1 | |
84 | if count == 1 then | |
85 | a = 2 | |
86 | term.setBackgroundColor(colors.black) | |
87 | write("*") | |
88 | elseif count == 2 then | |
89 | b = 2 | |
90 | term.setBackgroundColor(colors.black) | |
91 | write("*") | |
92 | elseif count == 3 then | |
93 | c = 2 | |
94 | term.setBackgroundColor(colors.black) | |
95 | write("*") | |
96 | elseif count == 4 then | |
97 | d = 2 | |
98 | term.setBackgroundColor(colors.black) | |
99 | write("*") | |
100 | elseif count == 5 then | |
101 | e = 2 | |
102 | term.setBackgroundColor(colors.black) | |
103 | write("*") | |
104 | elseif count == 6 then | |
105 | f = 2 | |
106 | term.setBackgroundColor(colors.black) | |
107 | write("*") | |
108 | end | |
109 | end | |
110 | ||
111 | if x == 6 and y == 3 then | |
112 | count = count +1 | |
113 | if count == 1 then | |
114 | a = 3 | |
115 | term.setBackgroundColor(colors.black) | |
116 | write("*") | |
117 | elseif count == 2 then | |
118 | b = 3 | |
119 | term.setBackgroundColor(colors.black) | |
120 | write("*") | |
121 | elseif count == 3 then | |
122 | c = 3 | |
123 | term.setBackgroundColor(colors.black) | |
124 | write("*") | |
125 | elseif count == 4 then | |
126 | d = 3 | |
127 | term.setBackgroundColor(colors.black) | |
128 | write("*") | |
129 | elseif count == 5 then | |
130 | e = 3 | |
131 | term.setBackgroundColor(colors.black) | |
132 | write("*") | |
133 | elseif count == 6 then | |
134 | f = 3 | |
135 | term.setBackgroundColor(colors.black) | |
136 | write("*") | |
137 | end | |
138 | end | |
139 | ||
140 | if x == 2 and y == 5 then | |
141 | count = count +1 | |
142 | if count == 1 then | |
143 | a = 4 | |
144 | term.setBackgroundColor(colors.black) | |
145 | write("*") | |
146 | elseif count == 2 then | |
147 | b = 4 | |
148 | term.setBackgroundColor(colors.black) | |
149 | write("*") | |
150 | elseif count == 3 then | |
151 | c = 4 | |
152 | term.setBackgroundColor(colors.black) | |
153 | write("*") | |
154 | elseif count == 4 then | |
155 | d = 4 | |
156 | term.setBackgroundColor(colors.black) | |
157 | write("*") | |
158 | elseif count == 5 then | |
159 | e = 4 | |
160 | term.setBackgroundColor(colors.black) | |
161 | write("*") | |
162 | elseif count == 6 then | |
163 | f = 4 | |
164 | term.setBackgroundColor(colors.black) | |
165 | write("*") | |
166 | end | |
167 | end | |
168 | ||
169 | if x == 4 and y == 5 then | |
170 | count = count +1 | |
171 | if count == 1 then | |
172 | a = 5 | |
173 | term.setBackgroundColor(colors.black) | |
174 | write("*") | |
175 | elseif count == 2 then | |
176 | b = 5 | |
177 | term.setBackgroundColor(colors.black) | |
178 | write("*") | |
179 | elseif count == 3 then | |
180 | c = 5 | |
181 | term.setBackgroundColor(colors.black) | |
182 | write("*") | |
183 | elseif count == 4 then | |
184 | d = 5 | |
185 | term.setBackgroundColor(colors.black) | |
186 | write("*") | |
187 | elseif count == 5 then | |
188 | e = 5 | |
189 | term.setBackgroundColor(colors.black) | |
190 | write("*") | |
191 | elseif count == 6 then | |
192 | f = 5 | |
193 | term.setBackgroundColor(colors.black) | |
194 | write("*") | |
195 | end | |
196 | end | |
197 | ||
198 | if x == 6 and y == 5 then | |
199 | count = count +1 | |
200 | if count == 1 then | |
201 | a = 6 | |
202 | term.setBackgroundColor(colors.black) | |
203 | write("*") | |
204 | elseif count == 2 then | |
205 | b = 6 | |
206 | term.setBackgroundColor(colors.black) | |
207 | write("*") | |
208 | elseif count == 3 then | |
209 | c = 6 | |
210 | term.setBackgroundColor(colors.black) | |
211 | write("*") | |
212 | elseif count == 4 then | |
213 | d = 6 | |
214 | term.setBackgroundColor(colors.black) | |
215 | write("*") | |
216 | elseif count == 5 then | |
217 | e = 6 | |
218 | term.setBackgroundColor(colors.black) | |
219 | write("*") | |
220 | elseif count == 6 then | |
221 | f = 6 | |
222 | term.setBackgroundColor(colors.black) | |
223 | write("*") | |
224 | end | |
225 | end | |
226 | ||
227 | if x == 2 and y == 7 then | |
228 | count = count +1 | |
229 | if count == 1 then | |
230 | a = 7 | |
231 | term.setBackgroundColor(colors.black) | |
232 | write("*") | |
233 | elseif count == 2 then | |
234 | b = 7 | |
235 | term.setBackgroundColor(colors.black) | |
236 | write("*") | |
237 | elseif count == 3 then | |
238 | c = 7 | |
239 | term.setBackgroundColor(colors.black) | |
240 | write("*") | |
241 | elseif count == 4 then | |
242 | d = 7 | |
243 | term.setBackgroundColor(colors.black) | |
244 | write("*") | |
245 | elseif count == 5 then | |
246 | e = 7 | |
247 | term.setBackgroundColor(colors.black) | |
248 | write("*") | |
249 | elseif count == 6 then | |
250 | f = 7 | |
251 | term.setBackgroundColor(colors.black) | |
252 | write("*") | |
253 | end | |
254 | end | |
255 | ||
256 | if x == 4 and y == 7 then | |
257 | count = count +1 | |
258 | if count == 1 then | |
259 | a = 8 | |
260 | term.setBackgroundColor(colors.black) | |
261 | write("*") | |
262 | elseif count == 2 then | |
263 | b = 8 | |
264 | term.setBackgroundColor(colors.black) | |
265 | write("*") | |
266 | elseif count == 3 then | |
267 | c = 8 | |
268 | term.setBackgroundColor(colors.black) | |
269 | write("*") | |
270 | elseif count == 4 then | |
271 | d = 8 | |
272 | term.setBackgroundColor(colors.black) | |
273 | write("*") | |
274 | elseif count == 5 then | |
275 | e = 8 | |
276 | term.setBackgroundColor(colors.black) | |
277 | write("*") | |
278 | elseif count == 6 then | |
279 | f = 8 | |
280 | term.setBackgroundColor(colors.black) | |
281 | write("*") | |
282 | end | |
283 | end | |
284 | ||
285 | if x == 6 and y == 7 then | |
286 | count = count +1 | |
287 | if count == 1 then | |
288 | a = 9 | |
289 | term.setBackgroundColor(colors.black) | |
290 | write("*") | |
291 | elseif count == 2 then | |
292 | b = 9 | |
293 | term.setBackgroundColor(colors.black) | |
294 | write("*") | |
295 | elseif count == 3 then | |
296 | c = 9 | |
297 | term.setBackgroundColor(colors.black) | |
298 | write("*") | |
299 | elseif count == 4 then | |
300 | d = 9 | |
301 | term.setBackgroundColor(colors.black) | |
302 | write("*") | |
303 | elseif count == 5 then | |
304 | e = 9 | |
305 | term.setBackgroundColor(colors.black) | |
306 | write("*") | |
307 | elseif count == 6 then | |
308 | f = 9 | |
309 | term.setBackgroundColor(colors.black) | |
310 | write("*") | |
311 | end | |
312 | end | |
313 | ||
314 | if x == 2 and y == 9 then | |
315 | count = count +1 | |
316 | if count == 1 then | |
317 | a = x | |
318 | term.setBackgroundColor(colors.black) | |
319 | write("*") | |
320 | elseif count == 2 then | |
321 | b = x | |
322 | term.setBackgroundColor(colors.black) | |
323 | write("*") | |
324 | elseif count == 3 then | |
325 | c = x | |
326 | term.setBackgroundColor(colors.black) | |
327 | write("*") | |
328 | elseif count == 4 then | |
329 | d = x | |
330 | term.setBackgroundColor(colors.black) | |
331 | write("*") | |
332 | elseif count == 5 then | |
333 | e = x | |
334 | term.setBackgroundColor(colors.black) | |
335 | write("*") | |
336 | elseif count == 6 then | |
337 | f = x | |
338 | term.setBackgroundColor(colors.black) | |
339 | write("*") | |
340 | end | |
341 | end | |
342 | ||
343 | if x == 4 and y == 9 then | |
344 | count = count +1 | |
345 | if count == 1 then | |
346 | a = 0 | |
347 | term.setBackgroundColor(colors.black) | |
348 | write("*") | |
349 | elseif count == 2 then | |
350 | b = 0 | |
351 | term.setBackgroundColor(colors.black) | |
352 | write("*") | |
353 | elseif count == 3 then | |
354 | c = 0 | |
355 | term.setBackgroundColor(colors.black) | |
356 | write("*") | |
357 | elseif count == 4 then | |
358 | d = 0 | |
359 | term.setBackgroundColor(colors.black) | |
360 | write("*") | |
361 | elseif count == 5 then | |
362 | e = 0 | |
363 | term.setBackgroundColor(colors.black) | |
364 | write("*") | |
365 | elseif count == 6 then | |
366 | f = 0 | |
367 | term.setBackgroundColor(colors.black) | |
368 | write("*") | |
369 | end | |
370 | end | |
371 | ||
372 | if x == 6 and y == 9 then | |
373 | count = count +1 | |
374 | if count == 1 then | |
375 | a = # | |
376 | term.setBackgroundColor(colors.black) | |
377 | write("*") | |
378 | elseif count == 2 then | |
379 | b = # | |
380 | term.setBackgroundColor(colors.black) | |
381 | write("*") | |
382 | elseif count == 3 then | |
383 | c = # | |
384 | term.setBackgroundColor(colors.black) | |
385 | write("*") | |
386 | elseif count == 4 then | |
387 | d = # | |
388 | term.setBackgroundColor(colors.black) | |
389 | write("*") | |
390 | elseif count == 5 then | |
391 | e = # | |
392 | term.setBackgroundColor(colors.black) | |
393 | write("*") | |
394 | elseif count == 6 then | |
395 | f = # | |
396 | term.setBackgroundColor(colors.black) | |
397 | write("*") | |
398 | end | |
399 | end | |
400 | ||
401 | ||
402 | end | |
403 | end | |
404 | count = 0 | |
405 | end | |
406 | ||
407 | while true do | |
408 | Rahmen() | |
409 | Eingabe() | |
410 | ||
411 | eingabe = (""..a..""..b..""..c..""..d..""..e..""..f.."") | |
412 | rednet.send(20,eingabe) | |
413 | y,x,z = rednet.receive() | |
414 | if y == "20" and x == "OK" then | |
415 | write("OK") | |
416 | rs.setOutput("top",true) | |
417 | sleep(3) | |
418 | rs.setOutput("top",false) | |
419 | else write ("FALSCH") | |
420 | end | |
421 | sleep(3) | |
422 | term.setBackgroundColor(colors.black) | |
423 | end |