Advertisement
compwiz1548

Basic Door Lock

Jan 23rd, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. password = "cheese" --Sets the password
  5. debug = "applesareyummm" --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("right",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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement