Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem") or error("No modem attached", 0)
- modem.open(43) -- Open 43 so we can receive replies
- -- Send our message
- modem.transmit(15, 43, "Hello, world!")
- -- 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 == 43
- print("Received a reply: " .. tostring(message))
Add Comment
Please, Sign In to add comment