Advertisement
Guest User

Locker

a guest
Jul 9th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.14 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. value = "4Q$p`?WpvF"
  5. user = "TekCastPork"
  6. locked == false
  7. code = "31415926"
  8. function startup()
  9.   os.pullEvent = os.pullEventRaw
  10.   print("||||||[PorkCo Door Systems]||||||")
  11.   term.setCursorPos(1,3)
  12.   print("Gathering Startup files....")
  13.   print("Running Startup Scripts....")
  14.   print("Gathering Configurations...")
  15.   print("Loading OS files...........")
  16.   print("Gathering OS Settings......")
  17.   term.setCursorPos(29,3)
  18.   sleep(1)
  19.   print("Complete")
  20.   term.setCursorPos(29,4)
  21.   sleep(1.5)
  22.   print("Complete")
  23.   term.setCursorPos(29,5)
  24.   sleep(1)
  25.   print("Complete")
  26.   term.setCursorPos(29,6)
  27.   sleep(2)
  28.   print("Complete")
  29.   term.setCursorPos(29,7)
  30.   sleep(2.5)
  31.   print("Complete")
  32.   term.setCursorPos(1,9)
  33.   print("Startup Complete! Loading UI...")
  34.   sleep(2)
  35.   term.clear()
  36.   term.setCursorPos(1,1)
  37. end
  38.  
  39. function mainLoop()
  40.   while true do
  41.     os.pullEvent = os.pullEventRaw
  42.     print("||||||[PorkCo Door Systems]||||||")
  43.     term.setCursorPos(1,3)
  44.     print("Login UI.")
  45.     print("Username: ")
  46.     user1 = read()
  47.     print("Password: ")
  48.     pass1 = read("*")
  49.     if (user1 == user) then
  50.       print("Attempting to login using provided ID.")
  51.       sleep(1)
  52.       if (pass1 == value) then
  53.         term.clear()
  54.         term.setCursorPos(1,1)
  55.         print("Success! Welcome TekCastPork.")
  56.         sleep(1)
  57.         while (allowed == 0) do
  58.         print("What do you wish to do?")
  59.         print("Possible Commands:")
  60.         print("OpenDoor    LockDoor
  61.               CloseDoor   UnlockDoor
  62.               Logout      Shutdown")
  63.         command = read()
  64.         if(command == "OpenDoor") then
  65.           print("Opening The Door...")
  66.           if (locked == true) then
  67.             print("Warning! The door is locked!")
  68.             print("Please input the lock code.")
  69.             code = read("*")
  70.       end
  71.     else
  72.       print("Attempting to login using provided ID.")
  73.       sleep(5)
  74.       print("Provided ID not found!")
  75.       sleep(0.5)
  76.       print("Goodbye.")
  77.       sleep(1)
  78.       os.shutdown()
  79.     end
  80.   end
  81. end
  82.  
  83.  
  84. startup()
  85. mainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement