modem_message event
Occurs every time a wireless message has been received by (wireless) modem that had the message's channel open.
|
|||
Wraps a connected modem peripheral, opens channel 123 and listens for incoming messages. | |||
Code | <nowiki>
local modem = peripheral.find("modem")
modem.open(123)
while true do
local event, peripheral_name, channel, replyChannel, message, distance = os.pullEvent("modem_message")
print("Received a message on channel", channel, "at", distance, "blocks away.")
print("The message: ", message)
end
</nowiki>
|
modem_message Event | |
---|---|
Returns
| |
Source | CC:Tweaked |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.