Advertisement
Guest User

Security

a guest
Feb 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.32 KB | None | 0 0
  1. shell.run("clear")
  2. term.setCursorPos(1,1)
  3. At = 0
  4.  
  5. function checkFront()
  6. if SFront == "S" then
  7.   F = "Front: Secured"
  8.   elseif SFront == "US" then
  9.   F = "Front: UnSecure"
  10.   else
  11.   F = "Front: Unknown"
  12.  end
  13. end
  14.  
  15. function checkSide()
  16. if SSide == "S" then
  17.   S = "Side: Secured"
  18.   elseif SSide == "US" then
  19.   S = "Side: UnSecured"
  20.   else
  21.   S = "Side: Unknown"
  22.  end
  23. end
  24.  
  25. function checkBack()
  26. if SBack == "S" then
  27.   B = "Back: Secured"
  28.   elseif SBack == "US" then
  29.   B = "Back: UnSecured"
  30.   else
  31.   B = "Back: Unknown"
  32.  end
  33. end
  34.  
  35. function show()
  36. print(F)
  37. print(S)
  38. print(B)
  39. end
  40.  
  41. function run()
  42. shell.run("clear")
  43. checkFront()
  44. checkSide()
  45. checkBack()
  46. show()
  47. print("Would You Like to Secure or Unsecure an area?")
  48. write("Secure/Unsecure:")
  49. Sec = "Secure"
  50. UnSec = "Unsecure"
  51. Front = "Front"
  52. Side = "Side"
  53. Back = "Back"
  54. Security = "Security"
  55.  
  56.  input = read()
  57.  
  58. if input == UnSec then
  59. shell.run("clear")
  60. show()
  61. print("Which Sector Would You Like UnSecure?")
  62. print("Front   Side")
  63. print("Back")
  64. write("Unsecure: ")
  65. input = read()
  66.   if input == Front then
  67.   shell.run("clear")
  68.   print("Front Enterance UnSecure")
  69.   rs.setOutput("left" , false )
  70.   sleep(3)
  71.   SFront = "US"
  72.   run()
  73.   end
  74.   if input == Side  then
  75.   shell.run("clear")
  76.   print("Side Enterance UnSecure")
  77.   rs.setOutput("back" , false )
  78.   sleep(3)
  79.   SSide = "US"
  80.   run()
  81.   end  
  82.   if input == Back then
  83.   shell.run("clear")
  84.   print("Back Enterance UnSecure")
  85.   rs.setOutput("top" , false )
  86.   sleep(3)
  87.   SBack = "US"
  88.   run()
  89.   end
  90. elseif input ~= Sec and input ~= UnSec then
  91.   run()
  92. end
  93.  
  94.  
  95. if input == Sec then
  96. shell.run("clear")
  97. show()
  98. print("Which Sector Would You Like To Secure?")
  99. print(" ")
  100. print("Front   Side")
  101. print("Back")
  102. write("Secure:")
  103. input = read()
  104.   if input == Front then
  105.   shell.run("clear")
  106.   print("Securing Front Entrance")
  107.   rs.setOutput("left" , true )
  108.   sleep(3)
  109.   SFront = "S"
  110.   run()
  111.   end
  112.   if input == Side then
  113.   shell.run("clear")
  114.   print("Securing Side Enterance")
  115.   rs.setOutput("back" , true )
  116.   sleep(3)  
  117.   SSide = "S"
  118.   run()
  119.   end
  120.   if input == Back then
  121.   shell.run("clear")
  122.   print("Securing Back Enterance")
  123.   rs.setOutput("top" , true )
  124.   sleep(3)
  125.   SBack = "S"
  126.   run()
  127.   end
  128.  end
  129. end
  130.  
  131. function pass()
  132. term.clear()
  133. term.setCursorPos(1,1)
  134. print("Attempts ".. At .. "/5")
  135. print("Please Enter the Password")
  136. write("Password: ")
  137.  
  138. input = read("*")
  139. if At < 5 then
  140. if input == "Artak2002" and At < 5 then
  141.   term.clear()
  142.   term.setCursorPos(10,1)
  143.   textutils.slowPrint("Welcome Back Superzorik")
  144.   sleep(2)
  145.   run()
  146.  elseif input == "Backdoor" and At < 5 then
  147.   term.clear()
  148.   term.setCursorPos(12,1)
  149.   textutils.slowPrint("Welcome Home Superzorik")
  150.   sleep(2)
  151.   term.clear()
  152.   term.setCursorPos(1,1)
  153.   print("ADT Security Termal v1.6")
  154.   term.setCursorPos(1,2)
  155.   error()
  156.  else
  157.   term.clear()
  158.   term.setCursorPos(1,1)
  159.   print("Error Code: 14503")
  160.   print("Please Contact Computer Administrator")
  161.   At = At + 1
  162.   sleep(5)
  163.   pass()
  164.  end
  165. elseif At >= 5 then
  166.   term.clear()
  167.   term.setCursorPos(1,1)
  168.   print("Number of Password Attempts Exceeded")
  169.   print("Error Code: 24450")
  170.   print("Please Contact Computer Administrator")
  171.   term.setCursorPos(1,4)
  172.   input = read()
  173.   if input == "Reset M25Hash" then
  174.     At = 0
  175.     pass()
  176.   end
  177.   end
  178. end
  179.  
  180. pass()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement