Advertisement
KrabPlotva

Прога для стартапа

Mar 21st, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. local term = require("term")
  2. local note = require("note")
  3.  
  4. local username = "dissidentiv", check
  5. local password = "Grisha333", check
  6.  
  7. while true do
  8. term.clear()
  9. io.write("Введите пароль для входа в систему: ")
  10. err, check = pcall(io.read)
  11.   if not err then
  12.     term.clear()
  13.     print("Принудительное завершение программы отменено. У вас нет прав на это.")
  14.     note.play(70, 0.5)
  15.     os.sleep(2)
  16.     term.clear()
  17.    elseif check == password then
  18.     term.clear()
  19.     print("Доступ разрешен.")
  20.     note.play(90, 0.1)
  21.     note.play(90, 0.1)
  22.     note.play(90, 0.1)
  23.     os.sleep(3)
  24.     term.clear()
  25.     break
  26.   else
  27.     term.clear()
  28.     print("Пароль неверный. Попробуйте еще раз.")
  29.     note.play(70, 0.5)
  30.     os.sleep(2)
  31.     term.clear()
  32.   end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement