Guest User

Advanced Security Command

a guest
Oct 1st, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. -- Not explained command:
  2.  
  3. local tryMax, try, pWord = 3, 0, "*"
  4.  
  5. local cmdPass, Pass = "Command","OpenDoor"
  6.  
  7. function CheckPass()
  8.  
  9. print("Enter Password: ("..try.."/"..tryMax.."):")
  10. local sel = read(pWord)
  11.  
  12. if sel == cmdPass then
  13. shell.run('clear')
  14. print("Command Access Granted!")
  15. sleep(1.5)
  16. shell.run('clear')
  17. elseif sel == Pass then
  18. shell.run('clear')
  19. print("Access Granted!")
  20. sleep(1)
  21. shell.run('clear')
  22. redstone.setOutput("left", true)
  23. local openTime = 5
  24. for i=openTime, 1, -1 do
  25. print("Closing in "..i.." seconds")
  26. sleep(1)
  27. shell.run('clear')
  28. end
  29. redstone.setOutput("left", false)
  30. os.shutdown()
  31. else
  32. shell.run('clear')
  33.  
  34. if try < tryMax then
  35. try = try + 1
  36. print("Wrong password!")
  37. sleep(1)
  38. CheckPass()
  39. return nil
  40. else
  41. print("Wrong password. Closing computer...") -- I don't make a LOCK...
  42. wait(1.5)
  43. shell.run('clear')
  44. shell.run('shutdown')
  45. return nil
  46. end
  47.  
  48. end
  49. end
  50.  
  51. CheckPass()
Advertisement
Add Comment
Please, Sign In to add comment