Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function dial(address)
- interface = peripheral.find("crystal_interface")
- local addressLength = #address
- local start = interface.getChevronsEngaged() + 1
- for chevron = start,addressLength,1
- do
- local symbol = address[chevron]
- interface.engageSymbol(symbol)
- end
- end
- local modem = peripheral.wrap("top") or error("No modem attached", 0)
- modem.open(12) -- Open 43 so we can receive replies
- -- And wait for a reply
- local event, side, channel, replyChannel, message, distance
- repeat
- event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- until channel == 12
- -- Process the received message based on its content
- if message == "Output" then
- print("Activating Gate...")
- modem.transmit(46, 12, "Activating Gate...")
- dial({22,12,31,16,26,18,2,8,0})
- os.sleep(7)
- interface = peripheral.find("crystal_interface")
- repeat
- os.sleep(0.1)
- until interface.isStargateConnected() == true
- print("Gate Activated...")
- print("Comencing Drop...")
- redstone.setOutput("front", true)
- os.sleep(10)
- print("Stoping Drop...")
- redstone.setOutput("front", false)
- end
- print("Closing Gate...")
- os.sleep(3)
- shell.run("CloseGate")
- os.sleep(3)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement