SHOW:
|
|
- or go back to the newest paste.
1 | - | term.clear() |
1 | + | |
2 | - | term.setCursorPos(1,1) |
2 | + | |
3 | opentime = 5 | |
4 | - | inverted = false |
4 | + | invertedSignal = false |
5 | local fail = 0 | |
6 | ||
7 | while true do | |
8 | term.clear() | |
9 | - | rs.setOutput(side,inverted) |
9 | + | term.setCursorPos(1,1) |
10 | - | write("Password: ") |
10 | + | print() -- empty line |
11 | - | input = read("*") |
11 | + | write(" Password: ") |
12 | - | if input == password then |
12 | + | input = read("*") |
13 | - | if inverted == true then |
13 | + | if input == password then |
14 | - | print("Access granted") |
14 | + | print("Access granted!") |
15 | - | rs.setOutput(side, false) |
15 | + | if invertedSignal then |
16 | - | sleep(opentime) |
16 | + | rs.setOutput(side, false) |
17 | - | os.reboot() |
17 | + | sleep(opentime) |
18 | rs.setOutput(side, true) | |
19 | - | print("Access granted") |
19 | + | else |
20 | - | rs.setOutput(side, true) |
20 | + | rs.setOutput(side, true) |
21 | - | sleep(opentime) |
21 | + | sleep(opentime) |
22 | - | os.reboot() |
22 | + | rs.setOutput(side, false) |
23 | end | |
24 | - | elseif input == "goodchoys" then |
24 | + | |
25 | - | print("Exiting program..") |
25 | + | fail = fail+1 |
26 | - | sleep(2) |
26 | + | print("Access denied!") |
27 | - | else |
27 | + | if fail == 3 then |
28 | - | print("Access denied") |
28 | + | print(" Failed 3 times") |
29 | - | sleep(3) |
29 | + | print(" Rebooting...") |
30 | - | os.reboot() |
30 | + | sleep(2) |
31 | os.shutdown() | |
32 | end | |
33 | end | |
34 | sleep(0.2) | |
35 | end |