Advertisement
jille_Jr

CC: TurtleGilmore's factory lock

Oct 1st, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.84 KB | None | 0 0
  1. -- Made by jag_e_nummer_ett
  2. -- Created for TurtleGilmore and his factory
  3. -- 1 / 10 - 2012
  4.  
  5. -- ⇊ change this for the id you want ⇊
  6. local factoryID = "Alpha"
  7. local bypassID = "bypass"
  8. local normalID = "normal"
  9. local adminID = "admin"
  10.  
  11. -- ⇊ Program start, dont change anything here ⇊
  12.  
  13. function clearPrint(string, x, y)
  14.   if not x or x < 0 then x = 1 end
  15.   if not y or y < 0 then y = 1 end
  16.   term.clear()
  17.   term.setCursorPos(x,y)
  18.   print(string)
  19. end
  20.  
  21. function checkID(ID)
  22.   clearPrint("Reading ID entered...")
  23.   sleep(2)
  24.   clearPrint("Checking database...")
  25.   sleep(2)
  26.   if ID == normalID or ID == adminID then
  27.     clearPrint("Security ID verified - Correct!")
  28.     sleep(.4)
  29.     print("Un-locking "..factoryID.." security...")
  30.     rs.setOutput("right", true)
  31.     sleep(3)
  32.     clearPrint("Re-activating "..factoryID.." security...")
  33.     sleep(1.5)
  34.     rs.setOutput("right", false)
  35.     clearPrint("LOCKED!")
  36.     sleep(2)
  37.   elseif ID == bypassID then
  38.     clearPrint("Security ID verified - Correct!")
  39.     sleep(.4)
  40.     print("Bypassing "..factoryID.." security...")
  41.     sleep(1.5)
  42.     clearPrint("Done!")
  43.     return "bypass"
  44.   else
  45.     clearPrint("Security ID locked down - Incorrect!")
  46.     sleep(.4)
  47.     print("Activating alarm systems!")
  48.     sleep(2)
  49.     rs.setOutput("back", true)
  50.     local alarmInput = ""
  51.     while alarmInput ~= adminID do
  52.       clearPrint("ENTER ADMINISTRATION ID")
  53.       write("ID: ")
  54.       alarmInput = read()
  55.     end
  56.     clearPrint("Correct Admin ID!")
  57.     sleep(.4)
  58.     print("De-activating alarms")
  59.     rs.setOutput("back", false)
  60.     sleep(2)
  61.   end
  62. end
  63.  
  64. -- ⇊ Main program below ⇊
  65.  
  66. while true do
  67.   clearPrint("Welcome to Vurruca National Production Company")
  68.   print("Please enter your Security ID for: "..factoryID)
  69.   write("ID: ")
  70.   if checkID(read()) == "bypass" then break end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement