Advertisement
gpgautier

Door lock

Oct 17th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local RUNNING = true
  4. local input
  5.  
  6. function reset()
  7.     term.clear()
  8.     term.setCursorPos(1, 2)
  9.     term.write(" Restricted access")
  10.     term.setCursorPos(1, 4)
  11.     term.write(" Please enter password: ")
  12. end
  13.  
  14. reset()
  15.  
  16. while RUNNING do
  17.     input = read("*")
  18.  
  19.     if input == "oeleboele" then
  20.         term.setCursorPos(1, 6)
  21.         term.write(" Opening door.")
  22.         redstone.setOutput("bottom", true)
  23.         sleep(1.5)
  24.         redstone.setOutput("bottom", false)
  25.         sleep(1)
  26.         reset()
  27.     else
  28.         sleep(1)
  29.         reset()
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement