Advertisement
sdk345

Computercraft login system with redstone output

Jun 18th, 2016
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. shell.run("clear")
  2. print("Lab Secure Access")
  3. local u1username = "user1" -- set me
  4. local u1password = "pass1" -- set me
  5. local u2username = "user2" -- set me
  6. local u2password = "pass2" -- set me
  7. repeat
  8.   write("Enter Your Name: ")
  9.   local status1, username = pcall(read)
  10.   write("Enter Your Password: ")
  11.   local status2, password = pcall(read, "*")
  12. until (username == u1username or username == u2username) and (password == u1password or password == u2password)
  13. print("Welcome Back")
  14. redstone.setOutput("left", true)
  15. pcall(sleep, 5)
  16. redstone.setOutput("left", false)
  17. shell.run("shutdown")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement