Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- c = require("component")
- local term = require("term")
- local component = require("component")
- local sides = require("sides")
- event = require("event")
- os = require("os")
- event = require("event")
- computer = require("computer")
- serialization = require("serialization")
- local tun = component.tunnel
- local gpu = component.gpu -- get primary gpu component
- local w, h = gpu.getResolution()
- gpu.fill(1, 1, w, h, " ") -- clears the screen
- tun = c.tunnel
- red = c.redstone
- sg = c.stargate
- bm = c.beamer
- local asd = 1
- print("SGC Gate Computer Program v1.1 /by Kevlaris")
- print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
- print()
- repeat
- term.clear(true)
- print("Listening for incoming messages and events across dimensions")
- print()
- local _, _, _, _, _, raw, address_raw = event.pull(nil, "modem_message")
- print("Message recieved.")
- os.sleep(0.5)
- if raw == "AlphaT" then
- print("Engaging IO")
- red.setOutput(sides.left, 1)
- os.sleep(1)
- red.setOutput(sides.left, 0)
- os.sleep(1)
- elseif raw == "BaseT" then
- address = {"Crater", "Monoceros", "Scorpius", "Serpens Caput", "Sculptor", "Aquarius", "Point of Origin"}
- os.sleep(0.5)
- print("Dialing")
- for i,v in ipairs(address) do print(i,v) end
- print()
- function dialNext(dialed)
- glyph = address[dialed + 1]
- print("Engaging "..glyph.."... ")
- sg.engageSymbol(glyph)
- end
- eventID = event.listen("stargate_spin_chevron_engaged", function(evname, address, caller, num, lock, glyph)
- os.sleep(2)
- if lock then
- if (event.cancel(eventID)) then
- print("Event cancelled successfully")
- end
- print("Engaging...")
- sg.engageGate()
- bm.setBeamerRole("transmit")
- print("Transmitting")
- os.sleep(1)
- print("Engaging IO")
- red.setOutput(sides.right, 1)
- os.sleep(1)
- os.sleep(5)
- bm.setBeamerRole("disabled")
- red.setOutput(sides.right, 0)
- doing = false
- os.sleep(1)
- print("Stargate Shutdown")
- sg.disengageGate()
- os.sleep(5)
- bm.setBeamerRole("receive")
- os.sleep(2)
- else
- dialNext(num)
- end
- end)
- dialNext(0)
- doing = true
- print()
- while doing do os.sleep(0.1) end
- end
- until asd == 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement