BeastmodeJD

CPID-startup

Dec 30th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. modem = peripheral.wrap("top")
  3. serverMon = peripheral.wrap("monitor_0")
  4. modem.open(34561)
  5. term.clear()
  6. term.setCursorPos(1,1)
  7. print("Enter password to view comouter IDs:")
  8.  
  9. while (true) do
  10.     event, keySide, heldFrec, repalyFrec, message, disT = os.pullEvent()
  11.     if (event == "key") then
  12.         password = read("*")
  13.         if (password == "Password4CPIDs") then
  14.             monitor.clear()
  15.             monitor.write("Computer IDs")
  16.             monitor.setCursorPos(1,3)
  17.             monitor.write("Bldg Ab door lock CP: 73")
  18.             monitor.setCursorPos(1,4)
  19.             monitor.write("CheckCP-Server: 75")
  20.             monitor.setCursorPos(1,5)
  21.             monitor.write("This Computer: 76")
  22.             term.clear()
  23.             term.setCursorPos(1,1)
  24.             print("Running...")
  25.             term.write("type 'exit' to exit and lock computer: ")
  26.             while not (read() == "exit") do
  27.                sleep(5)
  28.             end
  29.             os.reboot()
  30.         elseif (password == "BeastmodeJD24_access") then
  31.             return
  32.         else
  33.             term.clear()
  34.             term.setCursorPos(1,1)
  35.             print("Wrong Password!")
  36.             sleep(3)
  37.             os.reboot()
  38.         end
  39.     elseif (event == "modem_message") then
  40.         if (message == "CP-List") then
  41.             modem.transmit(43561, 1, "73=left 75=right 76=right")
  42.         else
  43.             monitor.clear()
  44.             monitor.setCursorPos(1,1)
  45.             monitor.write("THERE IS A ROGUE CP!!")
  46.         end
  47.     end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment