Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = require("component")
- e = require("event")
- t = require("term")
- local m = c.modem
- s = c.getPrimary("stargate")
- t.clear()
- while true do
- print(e.pull("sgDialIn"))
- print("Incoming Wormhole")
- print("Closing Iris")
- s.closeIris()
- m.open(420) --- Choose whatever port you want
- print("Channel Open")
- e.pull("sgStargateStateChange")
- print("Awaiting Signal")
- local _, _, from, port, _, message = e.pull("modem_message")
- if message == "999357" then --- choose whatever password you want
- print("Code Accpeted, Opening Iris")
- s.openIris()
- os.sleep(2)
- m.broadcast(420, "Iris Open") --- port must be the same as the one you chose earlier
- print("Welcome Home")
- os.sleep(10)
- print("Locking Up")
- s.closeIris()
- e.pull("sgStargateStateChange")
- os.sleep(1)
- s.openIris()
- else if message ~= "999357" then ---password must be the same as the one you chose earlier
- m.broadcast(420, "Code Rejected") --- port must be the same as the one you chose earlier
- print("Code: " ..(message).." Not Accepted, Locking Up Gate")
- s.closeIris()
- e.pull("sgStargateStateChange")
- os.sleep(1)
- print("Gate Disconnected, Opening Iris")
- s.openIris()
- print("Good-Bye")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement