Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Загружаем библиотеки
- local term = require("term")
- local sides = require("sides")
- local note = require("note")
- local component = require("component")
- -- Загружаем локалки
- local rs = component.redstone
- local password = "123", try
- local exit = "AdminKey", try
- term.clear()
- -- Запускаем вечный цикл проги
- while true do
- -- Прописываем сообщения
- io.write("Введи пароль: ")
- err, try = pcall(io.read)
- -- Если пользователь попытался выйти с программы (ctrl+alt+C)
- if not err then
- print("Нее! Не прокатит!")
- -- Пошли проверки паролей
- elseif try == password then
- print("Ок! Иди! У тебя 3 секунды.")
- rs.setOutput(sides.east, 15)
- note.play(83, 0.3)
- note.play(90, 0.2)
- os.sleep(2.5)
- print("Усё. Время вышло.")
- rs.setOutput(sides.east, 0)
- elseif try == exit then
- note.play(90, 0.5)
- print("Ключ прокатил. Выхожу из проги...")
- os.sleep(2.5)
- term.clear()
- break
- else
- print("Не прошло! Попробуй еще разок, другой.")
- note.play(70, 0.2)
- end
- end
Add Comment
Please, Sign In to add comment