Advertisement
CaptPickguard

IRIS SERVER

Mar 31st, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. c = require("component")
  2. e = require("event")
  3. t = require("term")
  4. local m = c.modem
  5.  
  6. s = c.getPrimary("stargate")
  7.  
  8. t.clear()
  9.  
  10. while true do
  11. print(e.pull("sgDialIn"))
  12. print("Incoming Wormhole")
  13. print("Closing Iris")
  14. s.closeIris()
  15. m.open(420) --- Choose whatever port you want
  16. print("Channel Open")
  17. e.pull("sgStargateStateChange")
  18. print("Awaiting Signal")
  19. local _, _, from, port, _, message = e.pull("modem_message")
  20. if message == "999357" then  --- choose whatever password you want
  21.  print("Code Accpeted, Opening Iris")
  22.   s.openIris()
  23.    os.sleep(2)
  24.     m.broadcast(420, "Iris Open") --- port must be the same as the one you chose earlier
  25.      print("Welcome Home")
  26.       os.sleep(10)
  27.        print("Locking Up")
  28.         s.closeIris()
  29.          e.pull("sgStargateStateChange")
  30.           os.sleep(1)
  31.            s.openIris()
  32.  else if message ~= "999357" then ---password must be the same as the one you chose earlier
  33.   m.broadcast(420, "Code Rejected") --- port must be the same as the one you chose earlier
  34.    print("Code: " ..(message).." Not Accepted, Locking Up Gate")
  35.     s.closeIris()
  36.      e.pull("sgStargateStateChange")
  37.       os.sleep(1)
  38.        print("Gate Disconnected, Opening Iris")
  39.         s.openIris()
  40.          print("Good-Bye")
  41.   end
  42.  end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement