SHOW:
|
|
- or go back to the newest paste.
1 | - | -- ###### Nur Bitte diese vier Werte bearbeiten! ###### |
1 | + | --[[ ### Hier bitte nix mehr machen außer du weißt was du machst! ### |
2 | function clear() | |
3 | term.clear() | |
4 | term.setCursorPos(1,1) | |
5 | - | -- Hier bitte Passwort eingeben (4 Ziffern lang) |
5 | + | |
6 | - | passwort = "1253" |
6 | + | print( "Copyright by Birog" ) |
7 | write( "Es wird nach Updates gesucht... " ) | |
8 | - | -- Redstone ausgang(bottom,top,back,front,left,right) |
8 | + | local response = http.get("http://pastebin.com/raw.php?i=EhTQMcyC") |
9 | - | redout = "bottom" |
9 | + | if response then |
10 | print("Update-suche erfolgreich!") | |
11 | - | -- Monitor seite(bottom,top,back,front,left,right) |
11 | + | local sSource = response.readAll() |
12 | - | moniside = "back" |
12 | + | response.close() |
13 | local file = fs.open( "startup", "r" ) | |
14 | - | -- Super Admin pass: wird gebraucht um das Programm zu beenden! |
14 | + | local sTarget = "" |
15 | if file then | |
16 | sTarget = file.readAll() | |
17 | - | -- Orginal von ReduceTheBlock |
17 | + | file.close() |
18 | - | -- Abgeschrieben von Maik Zimmermann |
18 | + | end |
19 | - | -- Für euch verändert von TobsA13 |
19 | + | if sSource ~= sTarget then |
20 | term.write("Updates gefunden!") | |
21 | file = fs.open( "startup", "w" ) | |
22 | - | -- ### Ab hier bitte nix mehr machen außer du weißt was du machst! ### |
22 | + | file.write( sSource ) |
23 | file.close() | |
24 | - | count = 0 |
24 | + | print( "Wurde herruntergeladen als - startup - -Datei") |
25 | - | a = 0 |
25 | + | print("Programm wird Neugestartet!") |
26 | - | b = 0 |
26 | + | shell.run("startup") |
27 | - | c = 0 |
27 | + | return |
28 | - | d = 0 |
28 | + | else |
29 | - | eingabe = 0 |
29 | + | print("Es sind keine Updates vorhanden!") |
30 | - | zugang = 0 |
30 | + | print("Programm wird gestartet!") |
31 | sleep(3) | |
32 | clear() | |
33 | end | |
34 | - | os.setComputerLabel("Passwort-Door" ) |
34 | + | |
35 | - | |
35 | + | clear() |
36 | print("ERROR! Informiere bitte Birog!!") | |
37 | clear() | |
38 | end]] | |
39 | ------------------------------------------------------------------------------------------------------------------- | |
40 | moniside = "right" | |
41 | - | term.write("1") |
41 | + | -- |
42 | redout = "left" | |
43 | - | term.write (" ") |
43 | + | |
44 | Info = "Schild" | |
45 | - | term.write("2") |
45 | + | |
46 | adminpass = "5555" | |
47 | - | term.write (" ") |
47 | + | |
48 | term = peripheral.wrap(moniside) | |
49 | - | term.write("3") |
49 | + | |
50 | os.pullEvent = os.pullEventRaw | |
51 | ||
52 | function AnzeigeAus() | |
53 | - | term.write("4") |
53 | + | term.setCursorPos(2,1) |
54 | term.setBackgroundColor(colors.red) | |
55 | - | term.write (" ") |
55 | + | term.write(" ") |
56 | term.setBackgroundColor(colors.black) | |
57 | - | term.write("5") |
57 | + | term.setCursorPos(3,1) |
58 | term.setBackgroundColor(colors.red) | |
59 | - | term.write (" ") |
59 | + | term.write("O") |
60 | term.setBackgroundColor(colors.black) | |
61 | - | term.write("6") |
61 | + | term.setCursorPos(4,1) |
62 | term.setBackgroundColor(colors.red) | |
63 | term.write("F") | |
64 | term.setBackgroundColor(colors.black) | |
65 | - | term.write("7") |
65 | + | term.setCursorPos(5,1) |
66 | term.setBackgroundColor(colors.red) | |
67 | - | term.write (" ") |
67 | + | term.write("F") |
68 | term.setBackgroundColor(colors.black) | |
69 | - | term.write("8") |
69 | + | term.setCursorPos(6,1) |
70 | term.setBackgroundColor(colors.red) | |
71 | - | term.write (" ") |
71 | + | term.write(" ") |
72 | term.setBackgroundColor(colors.black) | |
73 | - | term.write("9") |
73 | + | |
74 | ||
75 | function AnzeigeEin() | |
76 | - | |
76 | + | term.setCursorPos(2,1) |
77 | - | |
77 | + | term.setBackgroundColor(colors.green) |
78 | term.write(" ") | |
79 | - | while count < 4 do |
79 | + | term.setBackgroundColor(colors.black) |
80 | - | event,side,x,y = os.pullEvent() |
80 | + | term.setCursorPos(3,1) |
81 | - | if event == "terminate" then |
81 | + | term.setBackgroundColor(colors.green) |
82 | - | write("Admin Passwort:") |
82 | + | term.write("O") |
83 | - | admin = read("*") |
83 | + | term.setBackgroundColor(colors.black) |
84 | - | if admin == adminpass then |
84 | + | term.setCursorPos(4,1) |
85 | - | os.pullEvent = pullEvent |
85 | + | term.setBackgroundColor(colors.green) |
86 | - | write("Richtig! Mache jetzt nochmal STRG + T für 4 sec") |
86 | + | term.write("N") |
87 | - | sleep(5) |
87 | + | term.setBackgroundColor(colors.black) |
88 | - | end |
88 | + | term.setCursorPos(5,1) |
89 | - | end |
89 | + | term.setBackgroundColor(colors.green) |
90 | - | if event == "monitor_touch" then |
90 | + | term.write(" ") |
91 | - | |
91 | + | term.setBackgroundColor(colors.black) |
92 | - | if x == 2 and y == 1 then |
92 | + | term.setCursorPos(6,1) |
93 | - | count = count + 1 |
93 | + | term.setBackgroundColor(colors.green) |
94 | - | if count == 1 then |
94 | + | term.write(" ") |
95 | - | a = 1 |
95 | + | term.setBackgroundColor(colors.black) |
96 | - | term.setBackgroundColor(colors.black) |
96 | + | |
97 | - | punkt() |
97 | + | |
98 | - | elseif count == 2 then |
98 | + | |
99 | - | b = 1 |
99 | + | |
100 | - | punkt() |
100 | + | |
101 | - | elseif count == 3 then |
101 | + | -- Information |
102 | - | c = 1 |
102 | + | term.setCursorPos(2,2) |
103 | - | punkt() |
103 | + | term.setBackgroundColor(colors.blue) |
104 | - | elseif count == 4 then |
104 | + | term.write("Hello") |
105 | - | d = 1 |
105 | + | |
106 | - | punkt() |
106 | + | -- Anzeige |
107 | term.setCursorPos(2,1) | |
108 | - | end |
108 | + | term.setBackgroundColor(colors.orange) |
109 | - | |
109 | + | term.write(" ") |
110 | - | if x == 4 and y == 1 then |
110 | + | |
111 | - | count = count + 1 |
111 | + | term.setCursorPos(3,1) |
112 | - | if count == 1 then |
112 | + | term.setBackgroundColor(colors.orange) |
113 | - | a = 2 |
113 | + | term.write(" ") |
114 | - | term.setBackgroundColor(colors.black) |
114 | + | |
115 | - | punkt() |
115 | + | term.setCursorPos(4,1) |
116 | - | elseif count == 2 then |
116 | + | term.setBackgroundColor(colors.orange) |
117 | - | b = 2 |
117 | + | term.write(" ") |
118 | - | punkt() |
118 | + | |
119 | - | elseif count == 3 then |
119 | + | term.setCursorPos(5,1) |
120 | - | c = 2 |
120 | + | term.setBackgroundColor(colors.orange) |
121 | - | punkt() |
121 | + | term.write(" ") |
122 | - | elseif count == 4 then |
122 | + | |
123 | - | d = 2 |
123 | + | term.setCursorPos(6,1) |
124 | - | punkt() |
124 | + | term.setBackgroundColor(colors.orange) |
125 | term.write(" ") | |
126 | - | end |
126 | + | |
127 | - | |
127 | + | |
128 | - | if x == 6 and y == 1 then |
128 | + | -- Einschalten |
129 | - | count = count + 1 |
129 | + | |
130 | - | if count == 1 then |
130 | + | |
131 | - | a = 3 |
131 | + | term.write(" ") |
132 | - | term.setBackgroundColor(colors.black) |
132 | + | |
133 | - | punkt() |
133 | + | term.setCursorPos(2,4) |
134 | - | elseif count == 2 then |
134 | + | |
135 | - | b = 3 |
135 | + | term.write(" ") |
136 | - | punkt() |
136 | + | |
137 | - | elseif count == 3 then |
137 | + | |
138 | - | c = 3 |
138 | + | |
139 | - | punkt() |
139 | + | term.write(" ") |
140 | - | elseif count == 4 then |
140 | + | |
141 | - | d = 3 |
141 | + | term.setCursorPos(3,3) |
142 | - | punkt() |
142 | + | |
143 | term.write(" ") | |
144 | - | end |
144 | + | |
145 | - | |
145 | + | term.setCursorPos(3,4) |
146 | - | if x == 2 and y == 3 then |
146 | + | |
147 | - | count = count + 1 |
147 | + | term.write(" ") |
148 | - | if count == 1 then |
148 | + | |
149 | - | a = 4 |
149 | + | term.setCursorPos(3,5) |
150 | - | term.setBackgroundColor(colors.black) |
150 | + | |
151 | - | punkt() |
151 | + | term.write(" ") |
152 | - | elseif count == 2 then |
152 | + | |
153 | - | b = 4 |
153 | + | -- Ausschalten |
154 | - | punkt() |
154 | + | term.setCursorPos(5,3) |
155 | - | elseif count == 3 then |
155 | + | term.setBackgroundColor(colors.red) |
156 | - | c = 4 |
156 | + | term.write(" ") |
157 | - | punkt() |
157 | + | |
158 | - | elseif count == 4 then |
158 | + | term.setCursorPos(5,4) |
159 | - | d = 4 |
159 | + | term.setBackgroundColor(colors.red) |
160 | - | punkt() |
160 | + | term.write(" ") |
161 | term.setBackgroundColor(colors.black) | |
162 | - | end |
162 | + | term.setCursorPos(5,5) |
163 | - | |
163 | + | term.setBackgroundColor(colors.red) |
164 | - | if x == 4 and y == 3 then |
164 | + | term.write(" ") |
165 | - | count = count + 1 |
165 | + | |
166 | - | if count == 1 then |
166 | + | term.setCursorPos(6,3) |
167 | - | a = 5 |
167 | + | term.setBackgroundColor(colors.red) |
168 | - | term.setBackgroundColor(colors.black) |
168 | + | term.write(" ") |
169 | - | punkt() |
169 | + | |
170 | - | elseif count == 2 then |
170 | + | term.setCursorPos(6,4) |
171 | - | b = 5 |
171 | + | term.setBackgroundColor(colors.red) |
172 | - | punkt() |
172 | + | term.write(" ") |
173 | - | elseif count == 3 then |
173 | + | |
174 | - | c = 5 |
174 | + | term.setCursorPos(6,5) |
175 | - | punkt() |
175 | + | term.setBackgroundColor(colors.red) |
176 | - | elseif count == 4 then |
176 | + | term.write(" ") |
177 | - | d = 5 |
177 | + | |
178 | - | punkt() |
178 | + | |
179 | ||
180 | - | end |
180 | + | |
181 | - | |
181 | + | |
182 | - | if x == 6 and y == 3 then |
182 | + | event,side,x,y = os.pullEvent() |
183 | - | count = count + 1 |
183 | + | if event == "terminate" then |
184 | - | if count == 1 then |
184 | + | write("Admin Passwort:") |
185 | - | a = 6 |
185 | + | admin = read("*") |
186 | - | term.setBackgroundColor(colors.black) |
186 | + | if admin == adminpass then |
187 | - | punkt() |
187 | + | os.pullEvent = pullEvent |
188 | - | elseif count == 2 then |
188 | + | write("Richtig! Mache jetzt nochmal STRG + T für 4 sec") |
189 | - | b = 6 |
189 | + | sleep(5) |
190 | - | punkt() |
190 | + | end |
191 | - | elseif count == 3 then |
191 | + | end |
192 | - | c = 6 |
192 | + | if event == "monitor_touch" then |
193 | - | punkt() |
193 | + | |
194 | - | elseif count == 4 then |
194 | + | if x == 2 and y == 2 or |
195 | - | d = 6 |
195 | + | x == 2 and y == 3 or |
196 | - | punkt() |
196 | + | x == 2 and y == 4 or |
197 | x == 3 and y == 2 or | |
198 | - | end |
198 | + | x == 3 and y == 3 or |
199 | - | |
199 | + | x == 3 and y == 4 then |
200 | - | if x == 2 and y == 5 then |
200 | + | redstone.setOutput(redout, true) |
201 | - | count = count + 1 |
201 | + | -- redstone.setOutput(redout2, false) |
202 | - | if count == 1 then |
202 | + | AnzeigeEin() |
203 | - | a = 7 |
203 | + | end |
204 | - | term.setBackgroundColor(colors.black) |
204 | + | |
205 | - | punkt() |
205 | + | if x == 5 and y == 2 or |
206 | - | elseif count == 2 then |
206 | + | x == 5 and y == 3 or |
207 | - | b = 7 |
207 | + | x == 5 and y == 4 or |
208 | - | punkt() |
208 | + | x == 6 and y == 2 or |
209 | - | elseif count == 3 then |
209 | + | x == 6 and y == 3 or |
210 | - | c = 7 |
210 | + | x == 6 and y == 4 then |
211 | - | punkt() |
211 | + | redstone.setOutput(redout, false) |
212 | - | elseif count == 4 then |
212 | + | -- redstone.setOutput(redout2, true) |
213 | - | d = 7 |
213 | + | AnzeigeAus() |
214 | - | punkt() |
214 | + | end |
215 | end | |
216 | - | end |
216 | + | |
217 | - | |
217 | + | |
218 | - | if x == 4 and y == 5 then |
218 | + | redstone.setOutput(redout, false) |
219 | - | count = count + 1 |
219 | + | |
220 | - | if count == 1 then |
220 | + | |
221 | - | a = 8 |
221 | + | |
222 | - | term.setBackgroundColor(colors.black) |
222 | + |