rednet.broadcast

Broadcasts a string message over the predefined rednet.CHANNEL_BROADCAST channel (default 65535), assuming rednet has been opened. The message will be received by every device listening to rednet.

rednet.broadcast
Function
Syntax
rednet.broadcast(
  • message : any
  • protocol? : string
)

Returns nil
API rednet
Source CC:Tweaked (source)

 Note: This function call requires a Modem peripheral to be attached to the computer. See Networking for more information.

 Note: Rednet is not secure against interception or spoofing. See Network security#Rednet for more information.

ExampleBroadcast a 'Ping' message over rednet.
Broadcasts 'Ping' over the defined rednet.CHANNEL_BROADCAST channel.
Code
<nowiki>
rednet.broadcast('Ping')
    </nowiki>
Output Users running rednet.receive will now have received 'Ping' in their programs.
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.