SkyCrafter0

Double Password Door

May 23rd, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This program has a master password, and a password for a user. It will open a door to the left of the computer.
  2. os.pullEvent = os.pullEventRaw
  3.  
  4. while true do
  5.         term.clear()
  6.         term.setCursorPos(1,1)
  7.         term.write("Password:")
  8.         local password = read("")
  9.        
  10.         if password == "MasterKey" then
  11.                 term.clear()
  12.                 rs.setOutput("left", true)
  13.                 sleep(10)
  14.                 rs.setOutput("left", false)
  15.         elseif password == "password1" then
  16.                 term.clear()
  17.                 rs.setOutput("left", true)
  18.                 sleep(10)
  19.                 rs.setOutput("left", false)
  20.         else
  21.                 term.clear()
  22.                 term.setCursorPos(1,1)
  23.                 term.write("Incorrect. Rebooting")
  24.                 sleep(2)
  25.                 os.reboot()
  26.         end
  27. end
Add Comment
Please, Sign In to add comment