BeastmodeJD

Bldg-Ab_DoorLock

Dec 26th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. print("This is building Ab of the Cables for the World LLC.")
  5. print("CFW is owned and operated by JD's Town Goverment. No unatherized access! Please contact JD for entry.")
  6. print("")
  7. print("Please enter password: ")
  8. rednet.open("back")
  9. message = nil
  10. function reader()
  11.   password = read("*")
  12. end
  13. function rednetRe()
  14.   sender, message, disT = rednet.receive()
  15. end
  16. parallel.waitForAny(reader, rednetRe)
  17. if not (message == nil) then
  18.   if (message == "C^Y|cE5krz") then
  19.     rednet.send(75, "Vy;vR;F6jrC,k!n")
  20.   end
  21. else
  22.   if (password == "BeastmodeJD24_BldgAbAccess") then
  23.     term.clear()
  24.     term.setCursorPos(1,1)
  25.     textutils.slowPrint("Sending 2nd factor auth...")
  26.     rednet.send(75, "vLctbt8LLG7shFoNDKw7")
  27.     sender, message, disT = rednet.receive(7)
  28.     if (sender == 75 and message == "3ZuleCzbkQsvCmCoRw9R") then
  29.       term.clear()
  30.       term.setCursorPos(1,1)
  31.       print("Access Granted...")
  32.       rs.setOutput("left", true)
  33.       sleep(5)
  34.       rs.setOutput("left",false)
  35.       os.reboot()
  36.     else
  37.       term.clear()
  38.       term.setCursorPos(1,1)
  39.       print("2nd auth was not accepted. Please contact JD for entry.")
  40.       sleep(5)
  41.       os.reboot()
  42.     end
  43.   elseif (password == "BeastmodeJD24_access") then
  44.     return
  45.   else
  46.     term.clear()
  47.     term.setCursorPos(1,1)
  48.     print("Wrong Password!")
  49.     sleep(3)
  50.     os.reboot()
  51.   end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment