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