Advertisement
Shuudoushi

ComputerCraft Computer Password Protection Program

Sep 23rd, 2012
1,713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local password = "<password>" -- Change this to what you want your password to be.
  2. local oldPull = os.pullEvent
  3. os.pullEvent = os.pullEventRaw
  4.  
  5. while true do
  6.  term.clear()
  7.  term.setCursorPos(1,1)
  8.  write("Password:")
  9.  local input = read("*")
  10.  if input == password then
  11.   print("Welcome!")
  12.   sleep(2)
  13.   term.clear()
  14.   term.setCursorPos(1,1)
  15.   break
  16.  else
  17.   print("Password incorect!")
  18.   sleep(2)
  19.   term.clear()
  20.   term.setCursorPos(1,1)
  21.   print("Goodbye!")
  22.   sleep(2)
  23.   os.shutdown()
  24.  end
  25. end
  26.  
  27. os.pullEvent = oldPull
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement