SHOW:
|
|
- or go back to the newest paste.
1 | - | -- Configuration |
1 | + | -- Nastavení |
2 | - | local password = "secretPassword" -- Set your secret password here |
2 | + | local monitor = peripheral.wrap("back") -- Změňte "right" na stranu, na které je připojen monitor |
3 | - | local doorSide = "left" -- Set the side where the door is located (left, right, front, back, top, bottom) |
3 | + | |
4 | -- Funkce pro vytvoření rámečku | |
5 | - | -- Decoration function |
5 | + | function ramcek(vyska) |
6 | - | function decorate() |
6 | + | monitor.setCursorPos(1, vyska) |
7 | - | print("****************************************") |
7 | + | monitor.write("+------------------------------------+") |
8 | - | print("* *") |
8 | + | for i = 1, 3 do |
9 | - | print("* Welcome to the Security System *") |
9 | + | monitor.setCursorPos(1, vyska + i) |
10 | - | print("* *") |
10 | + | monitor.write("| |") |
11 | - | print("****************************************") |
11 | + | |
12 | monitor.setCursorPos(1, vyska + 4) | |
13 | monitor.write("+------------------------------------+") | |
14 | - | -- Main program |
14 | + | |
15 | - | while true do |
15 | + | |
16 | - | decorate() |
16 | + | -- Hlavní program |
17 | - | print("Enter password to open the door:") |
17 | + | monitor.clear() |
18 | - | local enteredPassword = read("*") -- Password will not be shown when typing |
18 | + | monitor.setTextScale(0.5) -- Nastavte měřítko textu podle velikosti monitoru |
19 | ||
20 | - | if enteredPassword == password then |
20 | + | -- Výpis hlavičky |
21 | - | print("Password correct. Opening door...") |
21 | + | ramcek(1) |
22 | - | redstone.setOutput(doorSide, true) -- Opens the door |
22 | + | monitor.setCursorPos(3, 3) |
23 | - | sleep(5) -- Wait for 5 seconds |
23 | + | monitor.write("Tekkit 2 GPT System 1.12") |
24 | - | redstone.setOutput(doorSide, false) -- Closes the door |
24 | + | |
25 | - | print("Door closed.") |
25 | + | -- Výpis informací o serveru |
26 | - | else |
26 | + | ramcek(6) |
27 | - | print("Incorrect password.") |
27 | + | monitor.setCursorPos(3, 8) |
28 | monitor.write("Server Info:") | |
29 | monitor.setCursorPos(3, 9) | |
30 | - | print("Waiting for the next attempt...") |
30 | + | monitor.write("New server focused on") |
31 | - | sleep(3) -- Wait for 3 seconds before the next attempt |
31 | + | monitor.setCursorPos(3, 10) |
32 | monitor.write("computer science.") | |
33 | ||
34 | -- Výpis kontaktních údajů | |
35 | ramcek(11) | |
36 | monitor.setCursorPos(3, 13) | |
37 | monitor.write("Contact:") | |
38 | monitor.setCursorPos(3, 14) | |
39 | monitor.write("admcgpt@gmail.com") | |
40 | ||
41 | -- Výpis pravidel | |
42 | ramcek(16) | |
43 | monitor.setCursorPos(3, 18) | |
44 | monitor.write("Rules:") | |
45 | monitor.setCursorPos(3, 19) | |
46 | monitor.write("No griefing, be respectful,") | |
47 | monitor.setCursorPos(3, 20) | |
48 | monitor.write("no cheating.") | |
49 | ||
50 | -- Výpis dalších informací | |
51 | ramcek(21) | |
52 | monitor.setCursorPos(3, 23) | |
53 | monitor.write("More Info:") | |
54 | monitor.setCursorPos(3, 24) | |
55 | monitor.write("New features and program") | |
56 | monitor.setCursorPos(3, 25) | |
57 | monitor.write("library coming soon!") | |
58 |