modem.transmit

Sends a modem message to a certain channel. If the modem is wired this will queue a modem_message event on all computers connected to the wired network that have the specified channel open. If the modem is wireless it will queue a modem_message event on all computers in range that have the specified channel open.

modem.transmit
Function
Syntax
modem.transmit(
  • channel : number
  • replyChannel : number
  • message : any
)

Returns nil
API modem

 Note: To send a message the channel it is being sent from does not need to be open.

ExampleSend a message on channel 42
Sends a "Hello World" on channel 42.
Code
<nowiki>
local modem = peripheral.find("modem")
modem.transmit(42, 43, "Hello World")
    </nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.