IronClaymore

[minecraft-CC] Generic password door

Jan 16th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. local pullEvent = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3. while true do
  4.     redstone.setOutput("back", false)
  5.     term.clear()
  6.     term.setCursorPos(1, 1)
  7.     term.setTextColor(colors.blue)
  8.     print("Welcome to the IC-TECH Offsite R&D Facility.")
  9.     term.setCursorPos(1, 2)
  10.     term.setTextColor(colors.red)
  11.     print("WARNING! This is a secure facility!")
  12.     term.setCursorPos(1, 3)
  13.     print("Authorised personnel only.")
  14.     term.setCursorPos(1, 5)
  15.     term.setTextColor(colors.white)
  16.     print("Please enter password to open the door:")
  17.     input = read()
  18. if input == "guest" then
  19.     term.clear()
  20.     term.setCursorPos(1, 1)
  21.     print("Password correct. Door will remain open for 10 seconds.")
  22.     redstone.setOutput("back", true)
  23.     sleep(10)
  24.     redstone.setOutput("back", false)
  25. elseif input == "password" then
  26.     term.clear()
  27.     term.setCursorPos(1, 1)
  28.     print("Password correct. Door will remain open for 10 seconds.")
  29.     redstone.setOutput("back", true)
  30.     sleep(10)
  31.     redstone.setOutput("back", false)
  32. elseif input == "debug" then
  33.     term.clear()
  34.         term.setCursorPos(1, 1)
  35.         print("Debug mode activated. Use CTRL + T after 5 seconds to exit program.")
  36.         sleep(5)
  37.         os.pullEvent = pullEvent
  38. else
  39.     term.clear()
  40.         term.setCursorPos(1, 1)
  41.     term.setTextColor(colors.red)
  42.         print("Incorrect Password!")
  43.     sleep(30)
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment