rednet_message event

Triggered by the rednet coroutine and is created from the modem_message event. For most use cases, rednet.receive is usually easier to use.

ExamplePrint messages
Prints messages received through rednet. Requires that there is a modem open for rednet to use.
while true do
  local event, senderId, message, protocol = os.pullEvent("rednet_message")
  print("Computer", senderId, "sent a message", message, "with the", protocol, "protocol!")
  • id : number The supposed ID of the sender.
  • msg : any The message.
  • protocol? : string The specified protocol. Prior to ComputerCraft 1.6, was the distance between sender and reciever.

Source CC:Tweaked
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.