Advertisement
BlueZero

BlueLock v1.4

Feb 8th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Title: BlueLock
  2. --Version: 1.4
  3. --Author: BlueZero (AKA Stevenmcl)
  4. --Platform: ComputerCraft LUA Environment
  5.  
  6. --[[
  7. ospullEvent gives you the ability or inability to bypass the program with CTRL + T.
  8. If you would like to remove the ability to bypass the program, remove the dashes (-)
  9. --]]
  10.  
  11. --ospullEvent = os.pullEventRaw
  12. protectmode = true
  13. maxtries = 3
  14. tries = 0
  15.  
  16. --[[
  17. This is your password variable. You can set this as anything you like but remember, it is Case Sensitive.
  18. Just remove the word between the quotation marks (") and make it what you want.
  19. --]]
  20.  
  21. pass = "Temp"
  22.  
  23. --[[
  24. This variable will determine your password text color. By default the color is set to Cyan.
  25. If you would like to set it to a different color, the colors available currently are:
  26.  
  27. White, Orange, Magenta, Light Blue, Yellow, Lime, Pink, Gray, Light Gray, Cyan, Purple, Blue, Brown, Green, Red, and Black.
  28.  
  29. Watch your capitals when setting the colors.
  30. Single word colors opperate as follows: gray
  31. Double word colors opperate as follows: lightGray
  32. --]]
  33.  
  34. passwordColor = colors.cyan
  35.  
  36.  
  37. function bluelock()
  38.     gateKeeper()
  39.         password()
  40.         if user == pass then
  41.                 correct()
  42.         end
  43.  
  44.  
  45.         if user == "credits" then
  46.                 print("")
  47.                 term.setTextColor(colors.lightBlue)
  48.                 print ("BlueLock v1.4")
  49.                 print ("This lock was created by BlueZero (AKA Stevenmcl)")
  50.                 sleep(2)
  51.                 bluelock()
  52.         end
  53.  
  54.         if not (user == pass) or (user == "credits") then
  55.                 if tries == maxtries -1 then
  56.                         if protectmode then
  57.                                 protect()
  58.                                         else
  59.                                 print ("Too many incorrect passwords.")
  60.                                 print ("Shutting the computer down.")
  61.                                 sleep(2)
  62.                                 os.shutdown()
  63.                                 end
  64.                         else
  65.                         print ("Wrong password.")
  66.                         tries = tries+1
  67.                         print ("Tries left; ", maxtries - tries)
  68.                         sleep(1)
  69.                         bluelock()
  70.                 end
  71.         end
  72. end
  73.  
  74. function correct()
  75.         shell.run("clear")
  76.         print("")
  77.         print("")
  78.         term.setTextColor(colors.lightBlue)
  79.         print([[    ______                                     _ ]])
  80.         term.setTextColor(colors.blue)
  81.         print([[   (_____ \                                   | |]])
  82.         term.setTextColor(colors.lightBlue)
  83.         print([[    _____) )___  ___  ___ _ _ _  ___   ____ _ | |]])
  84.         term.setTextColor(colors.blue)
  85.         print([[   |  ____/ _  |/___)/___) | | |/ _ \ / ___) || |]])
  86.         term.setTextColor(colors.lightBlue)
  87.         print([[   | |   ( ( | |___ |___ | | | | |_| | |  ( (_| |]])
  88.         term.setTextColor(colors.blue)
  89.         print([[   |_|    \_||_(___/(___/ \____|\___/|_|   \____|]])
  90.         term.setTextColor(colors.lightBlue)
  91.         print([[                                              _  ]])
  92.         term.setTextColor(colors.blue)
  93.         print([[      /\                         _           | | ]])
  94.         term.setTextColor(colors.lightBlue)
  95.         print([[     /  \   ____ ____ ____ ____ | |_  ____ _ | | ]])
  96.         term.setTextColor(colors.blue)
  97.         print([[    / /\ \ / ___) ___) _  )  _ \|  _)/ _  ) || | ]])
  98.         term.setTextColor(colors.lightBlue)
  99.         print([[   | |__| ( (__( (__( (/ /| | | | |_( (/ ( (_| | ]])
  100.         term.setTextColor(colors.blue)
  101.         print([[   |______|\____)____)____) ||_/ \___)____)____| ]])
  102.         term.setTextColor(colors.lightBlue)
  103.         print([[                          |_|                    ]])
  104.         sleep(3)
  105.         shell.run("clear")
  106. end
  107.  
  108. function protect()
  109.         sleep(1)
  110.         os.shutdown()
  111. end
  112.  
  113. function password()
  114.         shell.run("clear")
  115.         term.setTextColor(colors.lightBlue)
  116.         print ("B")
  117.         term.setCursorPos(2,1)
  118.         term.setTextColor(colors.blue)
  119.         print ("lueLock 1.1 running on computer ", os.getComputerID())
  120.         term.setTextColor(colors.lightBlue)
  121.         print ("C")
  122.         term.setCursorPos(2,2)
  123.         term.setTextColor(colors.blue)
  124.         print("raftOS Version: ", os.version())
  125.         term.setTextColor(colors.lightBlue)
  126.         print ("T")
  127.         term.setCursorPos(2,3)
  128.         term.setTextColor(colors.blue)
  129.         print("o view credits, type 'credits'.")
  130.         print ("")
  131.         term.setTextColor(colors.lightBlue)
  132.         print ("P")
  133.         term.setCursorPos(2,5)
  134.         term.setTextColor(colors.blue)
  135.         write("assword: ")
  136.         term.setTextColor(passwordColor)
  137.         user = io.read()
  138. end
  139.  
  140. function splash()
  141.     gateKeeper()
  142.         shell.run("clear")
  143.         print("")
  144.         print("")
  145.         print("")
  146.         print("")
  147.         term.setTextColor(colors.lightBlue)
  148.         print([[         __________ .__                  ]])
  149.         term.setTextColor(colors.blue)
  150.         print([[         \______   \|  |   __ __   ____  ]])
  151.         term.setTextColor(colors.lightBlue)
  152.         print([[          |    |  _/|  |  |  |  \_/ __ \ ]])
  153.         term.setTextColor(colors.blue)
  154.         print([[          |    |   \|  |__|  |  /\  ___/ ]])
  155.         term.setTextColor(colors.lightBlue)
  156.         print([[          |______  /|____/|____/  \___  >]])
  157.         term.setTextColor(colors.blue)
  158.         print([[         .____   \/                __ \/ ]])
  159.         term.setTextColor(colors.lightBlue)
  160.         print([[         |    |     ____    ____  |  | __]])
  161.         term.setTextColor(colors.blue)
  162.         print([[         |    |    /  _ \ _/ ___\ |  |/ /]])
  163.         term.setTextColor(colors.lightBlue)
  164.         print([[         |    |___(  <_> )\  \___ |    < ]])
  165.         term.setTextColor(colors.blue)
  166.         print([[         |_______ \\____/  \___  >|__|_ \]])
  167.         term.setTextColor(colors.lightBlue)
  168.         print([[                 \/            \/      \/]])
  169.         sleep(3)
  170.         term.setTextColor(colors.yellow)
  171.         shell.run("clear")
  172.         bluelock()
  173. end
  174.  
  175. function gateKeeper()
  176.     if fs.exists("disk/startup") then
  177.         fs.delete("disk/startup")
  178.     end
  179.     -- More will be added to this in the next updates.
  180. end
  181.  
  182. splash()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement