modem.transmit

From ComputerCraft
Revision as of 18:32, 24 April 2019 by Luca S (talk | contribs) (Created page with "{{API doc function | name = modem.transmit | description = Sends a modem message to a certain channel. If the modem is wired this will queue a Modem_message_event|modem_mess...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

modem.transmit
Function
Syntax
modem.transmit()
Returns nil
API modem

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.

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

ExampleExampleSend a message on channel 42
Sends a "Hello World" on channel 42.
Code
local modem = peripheral.find("modem")
modem.transmit(42, 43, "Hello World")