SHOW:
|
|
- or go back to the newest paste.
1 | os.pullEvent = os.pullEventRaw | |
2 | local password = "bankaccount" | |
3 | local secondPassword = "bankaccess" | |
4 | ||
5 | function secondaryPassword() | |
6 | while true do | |
7 | textutils.slowPrint("PC LOCKED DOWN. ENTER PASSWORD TO UNLOCK PC:"); | |
8 | input = read("*"); | |
9 | if (input == secondPassword) then | |
10 | return true; | |
11 | else | |
12 | textutils.slowPrint("ACCESS DENIED. START ALARM."); | |
13 | - | rs.setOutput("back",true); |
13 | + | rs.setOutput("top",true); |
14 | os.sleep(10); | |
15 | - | rs.setOutput("back",false); |
15 | + | rs.setOutput("top",false); |
16 | end | |
17 | end | |
18 | end | |
19 | ||
20 | function primaryPassword() | |
21 | write("LIMITED ACCESS. ENTER PASSWORD:") | |
22 | local input = read("*") | |
23 | if input == password then | |
24 | term.clear() | |
25 | term.setCursorPos(1,1) | |
26 | textutils.slowPrint("ACCESS GRANTED") | |
27 | textutils.slowPrint("DOOR IS OPENING PLEASE WAIT...") | |
28 | - | rs.setOutput("left",true) |
28 | + | rs.setOutput("back",true) |
29 | sleep(6) | |
30 | - | rs.setOutput("left",false) |
30 | + | rs.setOutput("back",false) |
31 | return true; | |
32 | else | |
33 | term.clear() | |
34 | term.setCursorPos(1,1) | |
35 | print("WRONG PASSWORD. ACCESS DENIED") | |
36 | --rs.setOutput("bottom",true) | |
37 | return false; | |
38 | end | |
39 | end | |
40 | ||
41 | function checkPass() | |
42 | if(primaryPassword()) then | |
43 | return true; | |
44 | else | |
45 | if(secondaryPassword()) then | |
46 | return false; | |
47 | end | |
48 | end | |
49 | end | |
50 | ||
51 | repeat | |
52 | term.clear(); | |
53 | term.setCursorPos(1,1); | |
54 | until(checkPass()) |