BlueZero

BlueLock 1.1

Nov 24th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.02 KB | None | 0 0
  1. --Title: BlueLock
  2. --Version: 1.1
  3. --Author: BlueZero (AKA Stevenmcl)
  4. --Platform: ComputerCraft LUA Environment
  5.  
  6. ospullEvent = os.pullEventRaw
  7. protectmode = true
  8. opentime = 5
  9. maxtries = 3
  10. tries = 0
  11. pass = "Temp"
  12.  
  13. function bluelock()
  14.     password()
  15.  
  16.     if user == pass then
  17.         correct()
  18.     end
  19.  
  20.  
  21.     if user == "credits" then
  22.         print ("BlueLock v1.1")
  23.         print ("This lock was created by BlueZero (AKA Stevenmcl)")
  24.         sleep(2)
  25.         bluelock()
  26.     end
  27.  
  28.     if not (user == pass) or (user == "credits") then
  29.         if tries == maxtries -1 then
  30.             if protectmode then
  31.                 protect()
  32.                     else
  33.                 print ("Too many incorrect passwords.")
  34.                 print ("Shutting the computer down.")
  35.                 sleep(2)
  36.                 os.shutdown()
  37.                 end
  38.             else
  39.             print ("Wrong password.")
  40.             tries = tries+1
  41.             print ("Tries left; ", maxtries - tries)
  42.             sleep(1)
  43.             bluelock()
  44.         end
  45.     end
  46. end
  47.  
  48. function correct()
  49.     shell.run("clear")
  50.     print("Password Accepted.")
  51.     sleep(1)
  52.     shell.run("clear")
  53.     shell.run("shell")
  54. end
  55.  
  56. function protect()
  57.     sleep(1)
  58.     os.shutdown()
  59. end
  60.  
  61. function password()
  62.     shell.run("clear")
  63.     print ("BlueLock 1.1 running on computer ", os.getComputerID())
  64.     print ("CraftOS Version: ", os.version())
  65.     print ("To view credits, type 'credits'.")
  66.     print ("")
  67.     write ("Password: ")
  68.     user=io.read()
  69. end
  70.  
  71. function splash()
  72.     shell.run("clear")
  73.     print("")
  74.     print("")
  75.     print("")
  76.     print("")
  77.     print([[         __________ .__                  ]])
  78.     print([[         \______   \|  |   __ __   ____  ]])
  79.     print([[          |    |  _/|  |  |  |  \_/ __ \ ]])
  80.     print([[          |    |   \|  |__|  |  /\  ___/ ]])
  81.     print([[          |______  /|____/|____/  \___  >]])
  82.     print([[         .____   \/                __ \/ ]])
  83.     print([[         |    |     ____    ____  |  | __]])
  84.     print([[         |    |    /  _ \ _/ ___\ |  |/ /]])
  85.     print([[         |    |___(  <_> )\  \___ |    < ]])
  86.     print([[         |_______ \\____/  \___  >|__|_ \]])
  87.     print([[                 \/            \/      \/]])
  88.     sleep(2)
  89.     shell.run("clear")
  90.     bluelock()
  91. end
  92.  
  93. splash()
Advertisement
Add Comment
Please, Sign In to add comment