Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = require("term")
- local component = require("component")
- local sides = require("sides")
- local gpu = component.gpu
- local rs = component.redstone
- if not component.isAvailable("redstone") then
- term.clear()
- print("Для работы данной программы требуется 'Плата на красном камне'!")
- os.sleep(5)
- else
- term.clear()
- local rs = component.redstone
- print("'Плата на красном камне' - обнаружена. Программа запускается!")
- os.sleep(5)
- term.clear()
- end
- local password = {
- user = "9182",
- admin = "exit",
- }
- local try
- gpu.setResolution(80,25)
- rs.setOutput(sides.north, 0)
- while true do
- io.write("\nВведите пароль: ")
- err, try = pcall(io.read)
- if not err then
- print("Для заверщения программы введите Админ пароль!")
- elseif try == "cls" then
- term.clear()
- elseif try == password.user then
- io.write("Доступ разрешён! У Вас 5 секунд, что бы войти :3")
- rs.setOutput(sides.north, 15)
- os.sleep(5)
- rs.setOutput(sides.north, 0)
- elseif try == password.admin then
- io.write("Вы ввели Админ пароль! Программа выключается")
- os.sleep(3)
- break
- else
- io.write("\nВ доступе отказано! Пароль не верный!")
- rs.setOutput(sides.north, 0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement