Advertisement
Guest User

password

a guest
Nov 26th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.41 KB | None | 0 0
  1. m = peripheral.wrap("top")
  2.  
  3. local pass = "" --Change This
  4. local apass =  ""--Change This
  5.  
  6. -------------------------------
  7. --DO NOT EDIT BELOW THIS LINE--
  8. -------------------------------
  9.  
  10. function monNoPassIn()
  11.    m.clear()
  12.    m.setCursorPos(1,1)
  13.    m.write("No Password Entered! Please Enter a Password!")
  14. end
  15.  
  16. function monIncPass()
  17.    m.clear()
  18.    m.setCursorPos(1,1)
  19.    m.write("Password Incorrect! Access DENIED!")
  20. end
  21.  
  22. function monCorPass()
  23.    m.clear()
  24.    m.setCursorPos(1,1)
  25.    m.write("Password Correct! Access GRANTED!")
  26. end
  27.  
  28. function monAdmin()
  29.    m.clear()
  30.    m.setCursorPos(1,1)
  31.    m.write("Admin Panel Is Being Accessed! Access Cannot Be Granted!")
  32. end
  33.  
  34. function monAdminDoorOpen()
  35.    m.clear()
  36.    m.setCursorPos(1,1)
  37.    m.write("Admin Panel Override: Opening Door!")
  38. end
  39.  
  40. function monAdminDoorClose()
  41.    m.clear()
  42.    m.setCursorPos(1,1)
  43.    m.write("Admin Panel Override: Closing Door!")
  44. end
  45.  
  46. function monAdminRTPass()
  47.     m.clear()
  48.     m.setCursorPos(1,1)
  49.     m.write("Admin Panel OverrideL Showing Pass!")
  50. end
  51.  
  52. function monAdminRPass()
  53.    m.clear()
  54.    m.setCursorPos(1,1)
  55.    m.write("Admin Panel Override: Showing Password!")
  56. end
  57.  
  58. function admin()
  59.    term.clear()
  60.    term.setCursorPos(1,1)
  61.    monAdmin()
  62.    print("Admin Panel")
  63.    print("Available Commands: ")
  64.    print("[1] Open Door")
  65.    print("[2] Close Door")
  66.    print("[3] Return To Password")
  67.    print("[4] Reveal Password")
  68.    local input = read()
  69.    if input == "1" then
  70.       monAdminDoorOpen()
  71.       print("Opening Door")
  72.       rs.setOutput("left", true)
  73.       sleep(1)
  74.    else if input == "2" then
  75.       monAdminDoorClose()
  76.       rs.setOutput("left", false)
  77.       sleep(1)
  78.    else if input == "3" then
  79.       monAdminRTPass()
  80.       sleep(2)
  81.       password()
  82.    else if input == "4" then
  83.       monAdminRPass()
  84.       print("Password is "..pass)
  85.       sleep(3)
  86.    else if input == "edit password" then
  87.       shell.run("edit password")
  88.    end
  89. end
  90. end
  91. end
  92. end
  93. end
  94.  
  95. function password()
  96.    monNoPassIn()
  97.    term.clear()
  98.    term.setCursorPos(1,1)
  99.    print("Enter Password: ")
  100.    local input = read("*")
  101.    if input == pass then
  102.       monCorPass()
  103.       print("Correct Password! Opening Door.")
  104.       rs.setOutput("left", true)
  105.       sleep(3)
  106.       rs.setOutput("left", false)
  107.    else if input == apass then
  108.       admin()
  109.    end
  110. end
  111. end
  112.  
  113. while true do
  114.    password()
  115.    sleep(3)
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement