Advertisement
Guest User

startup

a guest
Mar 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. -- Password Door by alex3025.
  2.  
  3. Username = "alex3025" -- Set your username. This username is also for Debug.
  4.  
  5. Password = "123" -- Set your password.
  6.  
  7. DebugPsw = "debug" -- Set the debug password for computer maintenance. Username is the main username.
  8.  
  9. DebugText = "ciao" -- Set the debug access garanted text.
  10.  
  11. Side = "top" -- Set the redstone side.
  12.  
  13. Seconds = 5 -- Set the time the door must stay open. Default is 5.
  14.  
  15. MainText = "Ciaone!" -- Set the main text.
  16.  
  17. AccessYes = "Accesso ok" -- Set the text for access garanted.
  18.  
  19. AccessNo = "Accesso no" -- Set the text for access denied.
  20.  
  21. term.clear()
  22. term.setCursorPos(1,1)
  23. print(MainText)
  24. term.setCursorPos(1,3)
  25. write("Username: ")
  26. user = read()
  27. write("Password: ")
  28. psw = read("*")
  29.  
  30. program = true
  31.  
  32. while program do
  33.  
  34.   if Username == user and Password == psw then
  35.     term.setCursorPos(1,6)
  36.     print(AccessYes)
  37.     rs.setOutput(Side, true)
  38.     os.sleep(Seconds)
  39.     rs.setOutput(Side, false)
  40.     os.reboot()
  41.   elseif Username == user and DebugPsw == psw then
  42.     term.setCursorPos(1,6)
  43.     print(DebugText)
  44.     os.sleep(1,5)
  45.     term.clear()
  46.     term.setCursorPos(1,1)
  47.     program = false
  48.   else
  49.     term.setCursorPos(1,6)
  50.     print(AccessNo)
  51.     os.sleep(1,5)
  52.     os.reboot()    
  53.   end
  54.  
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement