Guest User

doorlock

a guest
Jun 17th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. x = 1
  3. while true do
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print("Please enter the correct password: ")
  7. local input = read("*")
  8. if input == "123" then
  9.   term.clear()
  10.   term.setCursorPos(1,1)
  11.   textutils.slowWrite("The password entered was correct!")
  12.   sleep(1)
  13.   term.clear()
  14.   term.setCursorPos(1,1)
  15.   textutils.slowWrite("Opening Gate...")
  16.   rs.setOutput("back",true)
  17.   sleep(5)
  18.   rs.setOutput("back",false)
  19. else if input == "1234" then
  20.   term.clear()
  21.   term.setCursorPos(1,1)
  22.   textutils.slowWrite("Admin password has been entered.")
  23.   sleep(1)
  24.   term.clear()
  25.   term.setCursorPos(1,1)
  26.   textutils.slowPrint("One moment...")
  27.   sleep(2)
  28.   term.clear()
  29.   term.setCursorPos(1,1)
  30.   error()
  31. else if x == 4 then
  32.    textutils.slowPrint("The password entered has been incorrect 4 times...")  
  33.   sleep(1)
  34.   term.clear()
  35.   term.setCursorPos(1,1)
  36.   textutils.slowPrint("LOCK DOWN!")
  37.   sleep(300)
  38.   x = 1
  39. else  
  40.   term.clear()
  41.   term.setCursorPos(1,1)
  42.   textutils.slowPrint("The password entered was incorrect!")
  43.   x = x + 1
  44.   sleep(2)
  45. end
  46. end
  47. end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment