SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- Konfigurace |
| 1 | + | -- Configuration |
| 2 | - | local heslo = "tajneHeslo" -- Zde nastavte své tajné heslo |
| 2 | + | local password = "secretPassword" -- Set your secret password here |
| 3 | - | local stranaDveri = "left" -- Zde nastavte stranu, na které jsou dveře (left, right, front, back, top, bottom) |
| 3 | + | local doorSide = "left" -- Set the side where the door is located (left, right, front, back, top, bottom) |
| 4 | ||
| 5 | - | -- Funkce pro výzdobu |
| 5 | + | -- Decoration function |
| 6 | - | function vyzdoba() |
| 6 | + | function decorate() |
| 7 | print("****************************************")
| |
| 8 | print("* *")
| |
| 9 | - | print("* Vítejte v bezpečnostním systému *")
|
| 9 | + | print("* Welcome to the Security System *")
|
| 10 | print("* *")
| |
| 11 | print("****************************************")
| |
| 12 | end | |
| 13 | ||
| 14 | - | -- Hlavní program |
| 14 | + | -- Main program |
| 15 | while true do | |
| 16 | - | vyzdoba() |
| 16 | + | decorate() |
| 17 | - | print("Zadejte heslo pro otevření dveří:")
|
| 17 | + | print("Enter password to open the door:")
|
| 18 | - | local zadaneHeslo = read("*") -- Heslo nebude vidět při zadávání
|
| 18 | + | local enteredPassword = read("*") -- Password will not be shown when typing
|
| 19 | ||
| 20 | - | if zadaneHeslo == heslo then |
| 20 | + | if enteredPassword == password then |
| 21 | - | print("Heslo správné. Otevírám dveře...")
|
| 21 | + | print("Password correct. Opening door...")
|
| 22 | - | redstone.setOutput(stranaDveri, true) -- Otevře dveře |
| 22 | + | redstone.setOutput(doorSide, true) -- Opens the door |
| 23 | - | sleep(5) -- Počkej 5 sekund |
| 23 | + | sleep(5) -- Wait for 5 seconds |
| 24 | - | redstone.setOutput(stranaDveri, false) -- Zavře dveře |
| 24 | + | redstone.setOutput(doorSide, false) -- Closes the door |
| 25 | - | print("Dveře zavřeny.")
|
| 25 | + | print("Door closed.")
|
| 26 | else | |
| 27 | - | print("Nesprávné heslo.")
|
| 27 | + | print("Incorrect password.")
|
| 28 | end | |
| 29 | ||
| 30 | - | print("Čekám na další pokus...")
|
| 30 | + | print("Waiting for the next attempt...")
|
| 31 | - | sleep(3) -- Počkej 3 sekundy před dalším pokusem |
| 31 | + | sleep(3) -- Wait for 3 seconds before the next attempt |
| 32 | end | |
| 33 |