rednet.send
Sends a Rednet message to be received by a specific computer (whose id is id.) Takes another optional parameter, protocol, which specifies what the message is for. It returns false if the message was unable to be sent, but true if it was sent.
rednet.send Function | |
---|---|
Syntax rednet.send(
| |
Returns | bool success |
API | rednet |
Source | Rednet API (source) |
Make sure your modem is opened with rednet.open!
|
|||
We send a message to the computer whose id is 567. If the message could be sent, we should see an output of true: | |||
Code | <nowiki>
print(rednet.send(567, "Hello world!"))
</nowiki>
|
||
Output | true
|
|
|||
We now send a message to the computer whose id is 890, with a protocol of "ComputerCraft". If it was sent, we will see a true output: | |||
Code | <nowiki>
print(rednet.send(890, "Hello world!", "ComputerCraft"))
</nowiki>
|
||
Output | true
|
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.