Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!

*Computercraft* Simple Door Lock

By: Rastey on Dec 28th, 2012  |  syntax: Lua  |  size: 0.66 KB  |  views: 112  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --[[
  2. "*READ THIS NOTE*
  3. Replace 'pass' on line 6 with your own password
  4. Replace 'Welcome to King Rastey's Computer' on line 10 with your own MOTD
  5. Replace 'left' on line 15 and 17 with the direction of your door relative to the computer"
  6. ]]
  7. local password = "pass"
  8. while true do
  9.  term.clear()
  10.  term.setCursorPos(1, 1)
  11.  print("         Welcome to King Rastey's Computer")
  12.  print("Please Enter Password:")
  13.  input = read("*")
  14.  if input == "password" then
  15.   print("Password Correct")
  16.   redstone.setOutput("left", true)
  17.   sleep(2)
  18.   redstone.setOutput("left", false)
  19.   os.shutdown()
  20.  else if
  21.   print("Password Incorrect")
  22.   sleep(2)
  23.   os.reboot()
  24.  end
  25. end
clone this paste RAW Paste Data