SHOW:
|
|
- or go back to the newest paste.
1 | -- pastebin get Fb72VKyP startup | |
2 | ||
3 | os.pullEvent = os.pullEventRaw | |
4 | - | motdepasse = "pirmaxlpr" |
4 | + | |
5 | MDP = ("1234") | |
6 | - | print("Temps d'ouverture de la porte (seconde) ?") |
6 | + | |
7 | term.clear() | |
8 | - | time = read() |
8 | + | |
9 | - | time = tonumber(time) |
9 | + | |
10 | print("entrez votre mot de passe : ") | |
11 | - | print("Veuillez saisir le mot de passe :") |
11 | + | read = read("*") |
12 | ||
13 | - | text = read("*") |
13 | + | if read == MDP then |
14 | print("Acces Autorise") | |
15 | - | if text == (motdepasse) then |
15 | + | |
16 | redstone.setOutput("left",true) | |
17 | - | write("La porte restera ouverte pendant "..time.." seconde(s)") |
17 | + | redstone.setOutput("right",true) |
18 | ||
19 | - | redstone.setOutput("back", true) |
19 | + | sleep (5) |
20 | ||
21 | redstone.setOutput("left",true) | |
22 | redstone.setOutput("right",true) | |
23 | - | sleep(time) |
23 | + | |
24 | os.reboot() | |
25 | - | redstone.setOutput("back", false) |
25 | + | |
26 | elseif read == ("debug") then | |
27 | ||
28 | print("Mode debug") | |
29 | - | write("Le mot de passe que vous avez saisi est incorrect !") |
29 | + | |
30 | - | sleep(3) |
30 | + | |
31 | print("Acces refuse") | |
32 | - | end |
32 | + | sleep(1) |
33 | os.reboot() | |
34 | - | os.shutdown() |
34 | + | end |