android4682

Simple Password Protected Door Script

Jun 28th, 2014
896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. password = "password"
  3.  
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print("===================================================")
  7. print("Welcome to Android's House")
  8. print("")
  9. print("Please enter the password to enter.")
  10. print("")
  11. write "Password: "
  12. passwd=read("*")
  13. if passwd == password then
  14.     term.clear()
  15.     term.setCursorPos(1,1)
  16.     print("===================================================")
  17.     print("Opening door...")
  18.     redstone.setOutput("left", true)
  19.     sleep(3)
  20.     redstone.setOutput("left", false)
  21.     os.reboot()
  22. else
  23.     term.clear()
  24.     term.setCursorPos(1,1)
  25.     print("===================================================")
  26.     print("Password Incorrect!")
  27.     sleep(2)
  28.     os.reboot()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment