Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Opening channel ..")
- local p = peripheral.wrap("bottom")
- p.open(1);
- local gotEvent = false
- function doSleep()
- sleep(1)
- end
- function doPull()
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- gotEvent = message == "GO"
- end
- while true do
- print("Sending signal ..")
- p.transmit(1, 1, os.getComputerLabel())
- parallel.waitForAny(doPull, doSleep)
- if gotEvent == true then
- print("Received GO signal")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement