Guest User

Untitled

a guest
Jul 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. password = "pie"  --Sets the password
  5. debug = "cheese" --Sets debugging password
  6. write("Enter your password: ")
  7. input = read()  --Input the password
  8.  
  9. term.clear()  --Clearing the terminal, and...
  10. term.setCursorPos(1,1)  --...THEN setting the cursor position
  11. if input == password then
  12.     print("Password Correct!")  --If the input is correct!
  13.     rs.setOutput("right",true)  --Change this and the setOutput to the side the door is on
  14.     sleep(2)  --Pause for 2 seconds
  15.     rs.setOutput("left",false)
  16.     os.shutdown()  --Shut down the computer
  17. elseif input == debug then
  18.     exit()  --Exits the program
  19. else
  20.     print("Password Incorrect!")  --If the input is incorrect! (Oh Noes!)
  21.     sleep(2)
  22.     os.shutdown()  --Shut down the computer
  23. end  --Ends the 'if' block
Add Comment
Please, Sign In to add comment