Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sg = peripheral.wrap("back")
- shell.run("clear")
- while true do
- event, where, value = os.pullEvent()
- --[[-- This prints every OS event as it comes in.
- print(event, " : ", where, " : ", value)]]
- -- This gets the address of an incoming dial in case anyone wants to use it.
- if event == "sgDialIn" then
- remoteAddress = value
- end
- -- Print which chevron and where the dial is coming from
- if event == "sgChevronEngaged" then
- shell.run("clear")
- print("Incoming activation from ", remoteAddress, "!")
- print("Chevron ", value, " encoded!")
- end
- if event == "sgStargateStateChange" and value == "Closing" then
- shell.run("clear")
- print("Event horizon collapsing!")
- end
- if event == "sgStargateStateChange" and value == "Connected" then
- shell.run("clear")
- print("Connection to ", remoteAddress, " is active!")
- sg.openIris()
- end
- -- Remote iris controls
- if event == "sgMessageReceived" then
- if value == "open_iris" then
- print("Remote iris opening!")
- sg.openIris()
- elseif value == "close_iris" then
- print("Remote iris closing!")
- sg.closeIris()
- end
- end
- -- Close the iris if the gate's not running.
- if event == "sgStargateStateChange" and (value == "Idle" or value == "offline") then
- shell.run("clear")
- print("Wormhole inactive.")
- sg.closeIris()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement