SHARE
TWEET

*Computercraft* Simple Door Lock

Rastey Dec 28th, 2012 124 Never
  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
RAW Paste Data
Top