View difference between Paste ID: 152uatDE and Us9vm050
SHOW: | | - or go back to the newest paste.
1-
--	###### Touchpad version 0.1 by JUMBONET! ######
1+
password = "1235"
2-
--
2+
-- Redstone Output
3-
--
3+
4-
--
4+
-- Monitor Side
5-
-- Put the password here (4 Numbers max)
5+
6-
passwort = "8535"
6+
-- Super Admin pass:
7-
--
7+
adminpass = "admin"
8-
-- Redstone Output(bottom,top,back,front,left,right)
8+
9
-- Farbcodes:
10-
--
10+
11-
-- Monitor Side(bottom,top,back,front,left,right)
11+
12
-- magenta	 			0x4	
13-
--
13+
14-
-- Super Admin pass: Sexy things xd
14+
15-
adminpass = "TGPV123123"
15+
16-
--
16+
17-
-- Tastenfarbe:
17+
18
-- lightGray 			0x100	
19
-- cyan					0x200	 
20
-- purple				0x400
21
-- blue					0x800	
22
-- brown				0x1000
23
-- green				0x2000
24
-- red					0x4000
25
-- black				0x8000
26
27
count = 0
28
a = 0
29
b = 0
30
c = 0
31
d = 0
32
eingabe = 0
33
zugang = 0
34
term = peripheral.wrap(moniside)
35
local pullEvent = os.pullEvent
36
os.pullEvent = os.pullEventRaw
37
term.setBackgroundColor(colors.black)
38
if os.getComputerLabel() == nil then
39
os.setComputerLabel("Password-Door" )
40
end
41
 
42
function Rahmen()
43
	term.clear()
44
	term.setTextColor(colors.white)
45
	term.setCursorPos(2,1)
46
	term.setBackgroundColor(tastencol)
47
	term.write(" 1 ")
48
	term.setBackgroundColor(colors.black)
49
	term.write (" ")
50
	term.setBackgroundColor(tastencol)
51
	term.write(" 2 ")
52
	term.setBackgroundColor(colors.black)
53-
term.clear()
53+
	term.write (" ")
54-
term.setTextColor(colors.white)
54+
	term.setBackgroundColor(tastencol)
55-
term.setCursorPos(2,1)
55+
	term.write(" 3 ")
56-
term.setBackgroundColor(tastencol)
56+
	term.setBackgroundColor(colors.black)
57-
term.write(" 1 ")
57+
	term.setCursorPos(2,3)
58
	term.setBackgroundColor(tastencol)
59-
term.write (" ")
59+
	term.write(" 4 ")
60-
term.setBackgroundColor(tastencol)
60+
	term.setBackgroundColor(colors.black)
61-
term.write(" 2 ")
61+
	term.write (" ")
62
	term.setBackgroundColor(tastencol)
63-
term.write (" ")
63+
	term.write(" 5 ")
64-
term.setBackgroundColor(tastencol)
64+
	term.setBackgroundColor(colors.black)
65-
term.write(" 3 ")
65+
	term.write (" ")
66
	term.setBackgroundColor(tastencol)
67-
term.setCursorPos(2,3)
67+
	term.write(" 6 ")
68-
term.setBackgroundColor(tastencol)
68+
	term.setBackgroundColor(colors.black)
69-
term.write(" 4 ")
69+
	term.write ("  ")
70
	term.setBackgroundColor(tastencol)
71-
term.write (" ")
71+
	term.write(" C ")
72-
term.setBackgroundColor(tastencol)
72+
	term.setBackgroundColor(colors.black)
73-
term.write(" 5 ")
73+
	term.setCursorPos(2,5)
74
	term.setBackgroundColor(tastencol)
75-
term.write (" ")
75+
	term.write(" 7 ")
76-
term.setBackgroundColor(tastencol)
76+
	term.setBackgroundColor(colors.black)
77-
term.write(" 6 ")
77+
	term.write (" ")
78
	term.setBackgroundColor(tastencol)
79-
term.write ("  ")
79+
	term.write(" 8 ")
80-
term.setBackgroundColor(tastencol)
80+
	term.setBackgroundColor(colors.black)
81-
term.write(" C ")
81+
	term.write (" ")
82
	term.setBackgroundColor(tastencol)
83-
term.setCursorPos(2,5)
83+
	term.write(" 9 ")
84-
term.setBackgroundColor(tastencol)
84+
	term.setBackgroundColor(colors.black)
85-
term.write(" 7 ")
85+
	term.setCursorPos(15,2)
86
	term.setBackgroundColor(tastencol)
87-
term.write (" ")
87+
	term.write("   ")
88-
term.setBackgroundColor(tastencol)
88+
	term.setCursorPos(15,4)
89-
term.write(" 8 ")
89+
	term.write("   ")
90
	term.setBackgroundColor(colors.black)
91-
term.write (" ")
91+
92-
term.setBackgroundColor(tastencol)
92+
93-
term.write(" 9 ")
93+
94
function Eingabe()
95-
term.setCursorPos(15,2)
95+
	while count < 4 do
96-
term.setBackgroundColor(tastencol)
96+
		event,side,x,y = os.pullEvent()
97-
term.write("   ")
97+
		if event == "terminate" then
98-
term.setCursorPos(15,4)
98+
		write("Admin Password:")
99-
term.write("   ")
99+
		admin = read("*")
100
		if admin == adminpass then
101
		os.pullEvent = pullEvent
102
		shell.run("clear")
103
		shell.run("shell")
104
		os.reboot()
105-
while count < 4 do
105+
		sleep(6)
106-
event,side,x,y = os.pullEvent()
106+
	else
107-
 if event == "terminate" then
107+
		print("wrong")
108-
 write("Admin Password:")
108+
	end
109-
 admin = read("*")
109+
110-
 if admin == adminpass then
110+
111-
 os.pullEvent = pullEvent
111+
if event == "monitor_touch" then
112-
 shell.run("clear")
112+
	if (x >= 2 and x<= 4) and y == 1 then
113-
 shell.run("shell")
113+
		count = count + 1
114-
 os.reboot()
114+
	if count == 1 then
115-
 sleep(6)
115+
		a = 1
116-
 else
116+
		term.setBackgroundColor(colors.black)
117-
 print("wrong")
117+
		punkt()
118-
 end
118+
	elseif count == 2 then
119-
 end
119+
		b = 1
120-
 if event == "monitor_touch" then
120+
		punkt()
121
	elseif count == 3 then
122-
  if (x >= 2 and x<= 4) and y == 1 then
122+
		c = 1
123-
   count = count + 1
123+
		punkt()
124-
   if count == 1 then
124+
	elseif count == 4 then
125-
   a = 1
125+
		d = 1
126-
   term.setBackgroundColor(colors.black)
126+
		punkt()
127-
   punkt()
127+
	end
128-
   elseif count == 2 then
128+
129-
   b = 1
129+
130-
   punkt()
130+
if (x >= 6 and x<= 8) and y == 1 then
131-
   elseif count == 3 then
131+
	count = count + 1/re
132-
   c = 1
132+
	if count == 1 then
133-
   punkt()
133+
		a = 2
134-
   elseif count == 4 then
134+
		term.setBackgroundColor(colors.black)
135-
   d = 1
135+
		punkt()
136-
   punkt()
136+
	elseif count == 2 then
137-
   end
137+
		b = 2
138-
  end
138+
		punkt()
139
	elseif count == 3 then
140-
  if (x >= 6 and x<= 8) and y == 1 then
140+
		c = 2
141-
   count = count + 1/re
141+
		punkt()
142-
   if count == 1 then
142+
	elseif count == 4 then
143-
   a = 2
143+
		d = 2
144-
   term.setBackgroundColor(colors.black)
144+
		punkt()
145-
   punkt()
145+
	end
146-
   elseif count == 2 then
146+
147-
   b = 2
147+
148-
   punkt()
148+
if (x >= 10 and x<= 12) and y == 1 then
149-
   elseif count == 3 then
149+
	count = count + 1
150-
   c = 2
150+
	if count == 1 then
151-
   punkt()
151+
		a = 3
152-
   elseif count == 4 then
152+
		term.setBackgroundColor(colors.black)
153-
   d = 2
153+
		punkt()
154-
   punkt()
154+
	elseif count == 2 then
155-
   end
155+
		b = 3
156-
  end
156+
		punkt()
157
	elseif count == 3 then
158-
  if (x >= 10 and x<= 12) and y == 1 then
158+
		c = 3
159-
   count = count + 1
159+
		punkt()
160-
   if count == 1 then
160+
	elseif count == 4 then
161-
   a = 3
161+
		d = 3
162-
   term.setBackgroundColor(colors.black)
162+
		punkt()
163-
   punkt()
163+
	end
164-
   elseif count == 2 then
164+
165-
   b = 3
165+
166-
   punkt()
166+
if (x >= 2 and x<= 4) and y == 3 then
167-
   elseif count == 3 then
167+
	count = count + 1
168-
   c = 3
168+
	if count == 1 then
169-
   punkt()
169+
		a = 4
170-
   elseif count == 4 then
170+
		term.setBackgroundColor(colors.black)
171-
   d = 3
171+
		punkt()
172-
   punkt()
172+
	elseif count == 2 then
173-
   end
173+
		b = 4
174-
  end
174+
		punkt()
175
	elseif count == 3 then
176-
  if (x >= 2 and x<= 4) and y == 3 then
176+
		c = 4
177-
   count = count + 1
177+
		punkt()
178-
   if count == 1 then
178+
	elseif count == 4 then
179-
   a = 4
179+
		d = 4
180-
   term.setBackgroundColor(colors.black)
180+
		punkt()
181-
   punkt()
181+
	end
182-
   elseif count == 2 then
182+
183-
   b = 4
183+
184-
   punkt()
184+
if (x >= 6 and x<= 8) and y == 3 then
185-
   elseif count == 3 then
185+
	count = count + 1
186-
   c = 4
186+
	if count == 1 then
187-
   punkt()
187+
		a = 5
188-
   elseif count == 4 then
188+
		term.setBackgroundColor(colors.black)
189-
   d = 4
189+
		punkt()
190-
   punkt()
190+
	elseif count == 2 then
191-
   end
191+
		b = 5
192-
  end
192+
		punkt()
193
	elseif count == 3 then
194-
  if (x >= 6 and x<= 8) and y == 3 then
194+
		c = 5
195-
   count = count + 1
195+
		punkt()
196-
   if count == 1 then
196+
	elseif count == 4 then
197-
   a = 5
197+
		d = 5
198-
   term.setBackgroundColor(colors.black)
198+
		punkt()
199-
   punkt()
199+
	end
200-
   elseif count == 2 then
200+
201-
   b = 5
201+
202-
   punkt()
202+
if (x >= 10 and x<= 12) and y == 3 then
203-
   elseif count == 3 then
203+
	count = count + 1
204-
   c = 5
204+
	if count == 1 then
205-
   punkt()
205+
		a = 6
206-
   elseif count == 4 then
206+
		term.setBackgroundColor(colors.black)
207-
   d = 5
207+
		punkt()
208-
   punkt()
208+
	elseif count == 2 then
209-
   end
209+
		b = 6
210-
  end
210+
		punkt()
211
	elseif count == 3 then
212-
  if (x >= 10 and x<= 12) and y == 3 then
212+
		c = 6
213-
   count = count + 1
213+
		punkt()
214-
   if count == 1 then
214+
	elseif count == 4 then
215-
   a = 6
215+
		d = 6
216-
   term.setBackgroundColor(colors.black)
216+
		punkt()
217-
   punkt()
217+
	end
218-
   elseif count == 2 then
218+
219-
   b = 6
219+
220-
   punkt()
220+
if (x >= 2 and x<= 4) and y == 5 then
221-
   elseif count == 3 then
221+
	count = count + 1
222-
   c = 6
222+
	if count == 1 then
223-
   punkt()
223+
		a = 7
224-
   elseif count == 4 then
224+
		term.setBackgroundColor(colors.black)
225-
   d = 6
225+
		punkt()
226-
   punkt()
226+
	elseif count == 2 then
227-
   end
227+
		b = 7
228-
  end
228+
		punkt()
229
	elseif count == 3 then
230-
  if (x >= 2 and x<= 4) and y == 5 then
230+
		c = 7
231-
   count = count + 1
231+
		punkt()
232-
   if count == 1 then
232+
	elseif count == 4 then
233-
   a = 7
233+
		d = 7
234-
   term.setBackgroundColor(colors.black)
234+
		punkt()
235-
   punkt()
235+
	end
236-
   elseif count == 2 then
236+
237-
   b = 7
237+
238-
   punkt()
238+
if (x >= 6 and x<= 8) and y == 5 then
239-
   elseif count == 3 then
239+
	count = count + 1
240-
   c = 7
240+
	if count == 1 then
241-
   punkt()
241+
		a = 8
242-
   elseif count == 4 then
242+
		term.setBackgroundColor(colors.black)
243-
   d = 7
243+
		punkt()
244-
   punkt()
244+
	elseif count == 2 then
245-
   end
245+
		b = 8
246-
  end
246+
		punkt()
247
	elseif count == 3 then
248-
  if (x >= 6 and x<= 8) and y == 5 then
248+
		c = 8
249-
   count = count + 1
249+
		punkt()
250-
   if count == 1 then
250+
	elseif count == 4 then
251-
   a = 8
251+
		d = 8
252-
   term.setBackgroundColor(colors.black)
252+
		punkt()
253-
   punkt()
253+
	end
254-
   elseif count == 2 then
254+
255-
   b = 8
255+
256-
   punkt()
256+
if (x >= 10 and x<= 12) and y == 5 then
257-
   elseif count == 3 then
257+
	count = count + 1
258-
   c = 8
258+
	if count == 1 then
259-
   punkt()
259+
		a = 9
260-
   elseif count == 4 then
260+
		term.setBackgroundColor(colors.black)
261-
   d = 8
261+
		punkt()
262-
   punkt()
262+
	elseif count == 2 then
263-
   end
263+
		b = 9
264-
  end
264+
		punkt()
265
	elseif count == 3 then
266-
  if (x >= 10 and x<= 12) and y == 5 then
266+
		c = 9
267-
   count = count + 1
267+
		punkt()
268-
   if count == 1 then
268+
	elseif count == 4 then
269-
   a = 9
269+
		d = 9
270-
   term.setBackgroundColor(colors.black)
270+
		punkt()
271-
   punkt()
271+
	end
272-
   elseif count == 2 then
272+
273-
   b = 9
273+
274-
   punkt()
274+
if (x >= 15 and x<= 17) and (y >= 2 and y<= 5) then
275-
   elseif count == 3 then
275+
	term.setCursorPos(15,5)
276-
   c = 9
276+
	term.write("    ")
277-
   punkt()
277+
	count = 0
278-
   elseif count == 4 then
278+
279-
   d = 9
279+
280-
   punkt()
280+
281-
   end
281+
282-
  end
282+
283-
  if (x >= 15 and x<= 17) and (y >= 2 and y<= 5) then
283+
	if count == 1 then
284-
  term.setCursorPos(15,5)
284+
	term.setCursorPos(15,5)
285-
  term.write("    ")
285+
	term.write ("*")
286-
  count = 0
286+
	elseif count == 2 then
287-
  end
287+
	term.setCursorPos(16,5)
288-
 end
288+
	term.write ("*")
289
	elseif count == 3 then
290
	term.setCursorPos(17,5)
291
	term.write ("*")
292
	elseif count == 4 then
293
	term.setCursorPos(18,5)
294-
if count == 1 then
294+
	term.write ("*")
295-
term.setCursorPos(15,5)
295+
	sleep(0.1)
296-
term.write ("*")
296+
297-
elseif count == 2 then
297+
298-
term.setCursorPos(16,5)
298+
299-
term.write ("*")
299+
	term.setBackgroundColor(farbe)
300-
elseif count == 3 then
300+
	term.setCursorPos(1,1)
301-
term.setCursorPos(17,5)
301+
	term.write("                  ")
302-
term.write ("*")
302+
	term.setCursorPos(1,2)
303-
elseif count == 4 then
303+
	term.write(" ")
304-
term.setCursorPos(18,5)
304+
	term.setCursorPos(18,2)
305-
term.write ("*")
305+
	term.write(" ")
306-
sleep(0.1)
306+
	term.setBackgroundColor(colors.black)
307
	term.write(" ")
308
	term.setBackgroundColor(farbe)
309
	term.setCursorPos(1,3)
310
	term.write(" ")
311-
term.setBackgroundColor(farbe)
311+
	term.setCursorPos(18,3)
312-
term.setCursorPos(1,1)
312+
	term.write(" ")
313-
term.write("                  ")
313+
	term.setBackgroundColor(colors.black)
314-
term.setCursorPos(1,2)
314+
	term.write(" ")
315-
term.write(" ")
315+
	term.setBackgroundColor(farbe)
316-
term.setCursorPos(18,2)
316+
	term.setCursorPos(1,4)
317-
term.write(" ")
317+
	term.write(" ")
318
	term.setCursorPos(18,4)
319-
term.write(" ")
319+
	term.write(" ")
320-
term.setBackgroundColor(farbe)
320+
	term.setBackgroundColor(colors.black)
321-
term.setCursorPos(1,3)
321+
	term.write(" ")
322-
term.write(" ")
322+
	term.setBackgroundColor(farbe)
323-
term.setCursorPos(18,3)
323+
	term.setCursorPos(1,5)
324-
term.write(" ")
324+
	term.write("                  ")
325
	term.setBackgroundColor(colors.black)
326-
term.write(" ")
326+
327-
term.setBackgroundColor(farbe)
327+
328-
term.setCursorPos(1,4)
328+
329-
term.write(" ")
329+
330-
term.setCursorPos(18,4)
330+
	Rahmen()
331-
term.write(" ")
331+
	Eingabe()
332
	eingabe = (""..a..""..b..""..c..""..d.."")
333-
term.write(" ")
333+
	zugang = (password-eingabe)
334-
term.setBackgroundColor(farbe)
334+
	if password == eingabe then
335-
term.setCursorPos(1,5)
335+
		term.clear()
336-
term.write("                  ")
336+
		term.setBackgroundColor(colors.black)
337
		term.setTextColor(colors.lime)
338
		farbe = 8192
339
		rand()
340
		term.setCursorPos(9,3)
341
		term.write ("OK")
342-
Rahmen()
342+
		rs.setOutput(redout, true)
343-
Eingabe()
343+
		sleep(2.5)
344-
eingabe = (""..a..""..b..""..c..""..d.."")
344+
		rs.setOutput(redout, false)
345-
zugang = (passwort-eingabe)
345+
	else
346-
if passwort == eingabe then
346+
		term.clear()
347-
term.clear()
347+
		term.setBackgroundColor(colors.black)
348
		term.setTextColor(colors.red)
349-
term.setTextColor(colors.lime)
349+
		farbe = 16384
350-
farbe = 8192
350+
		rand()
351-
rand()
351+
		term.setCursorPos(8,3)
352-
term.setCursorPos(9,3)
352+
		term.write("NOPE")
353-
term.write ("OK")
353+
		sleep (1)
354-
rs.setOutput(redout, true)
354+
		term.setCursorPos(6,3)
355-
sleep(2.5)
355+
		term.write("       ")
356-
rs.setOutput(redout, false)
356+
		term.setCursorPos(9,3)
357
		term.write("05")
358-
else
358+
		sleep(1)
359-
term.clear()
359+
		term.setCursorPos(9,3)
360
		term.write("04")
361-
term.setTextColor(colors.red)
361+
		sleep(1)
362-
farbe = 16384
362+
		term.setCursorPos(9,3)
363-
rand()
363+
		term.write("03")
364-
term.setCursorPos(8,3)
364+
		sleep(1)
365-
term.write("NOPE")
365+
		term.setCursorPos(9,3)
366-
sleep (1)
366+
		term.write("02")
367-
term.setCursorPos(6,3)
367+
		sleep(1)
368-
term.write("       ")
368+
		term.setCursorPos(9,3)
369-
term.setCursorPos(9,3)
369+
		term.write("01")
370-
term.write("05")
370+
		sleep(1)
371-
sleep(1)
371+
		term.setCursorPos(9,3)
372-
term.setCursorPos(9,3)
372+
		term.write("00")
373-
term.write("04")
373+
		sleep(1)
374-
sleep(1)
374+
	end
375-
term.setCursorPos(9,3)
375+
376-
term.write("03")
376+