Difference between revisions of "Modem.transmit"
From ComputerCraft Wiki
Iownall555 (Talk | contribs) (Created page with "{{Function |name=modem.transmit |args={{type|int}} channel, {{type|int}} replyChannel, {{type|string}} message |api=Modem |addon=ComputerCraft |desc=Sends a message and a repl...") |
Bomb Bloke (Talk | contribs) m |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
− | |name=modem.transmit | + | |name=''modem''.transmit |
− | |args={{type| | + | |args={{type|number}} channel, {{type|number}} replyChannel, {{type|any}} message |
+ | |returns={{type|nil}} | ||
|api=Modem | |api=Modem | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Sends a message and a reply channel over the specified channel. | + | |desc=Sends a message and a reply channel over the specified channel. The message may be any type of data excluding {{type|function}}s and {{type|thread}}s, which will be received as {{type|nil}}. Prior to about CC 1.53, {{type|table}}s were also received as nil. |
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Sends a message and a reply channel over the specified channel. | + | |desc=Sends a {{type|string}} message and a reply channel over the specified channel. |
− | |code=modem.transmit(1, 2, "Hello world!") | + | |code= local modem = [[peripheral.wrap]]("top") |
+ | |||
+ | modem.transmit(1, 2, "Hello world!") | ||
+ | }} | ||
+ | |||
+ | {{Example | ||
+ | |desc=Sends a {{type|table}} and reply channel over the specified channel. | ||
+ | |code = local modem = [[peripheral.wrap]]("top") | ||
+ | |||
+ | modem.transmit(1, 2, {"a", "b", "c"}) | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Latest revision as of 13:57, 14 June 2015
Function modem.transmit | |
Sends a message and a reply channel over the specified channel. The message may be any type of data excluding functions and threads, which will be received as nil. Prior to about CC 1.53, tables were also received as nil. | |
Syntax | modem.transmit(number channel, number replyChannel, any message) |
Returns | nil |
Part of | ComputerCraft |
API | Modem |
Examples
Example | |
Sends a string message and a reply channel over the specified channel. | |
Code |
local modem = peripheral.wrap("top") modem.transmit(1, 2, "Hello world!") |
Example | |
Sends a table and reply channel over the specified channel. | |
Code |
local modem = peripheral.wrap("top") modem.transmit(1, 2, {"a", "b", "c"}) |