rednet.run

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function rednet.run
Automatically started within a co-routine by bios.lua whenever a given system boots (regardless as to whether it has a modem available or not), this function continues to run in the background and constantly waits for modem_message events to appear within the event queue. On spotting them, it then generates corresponding rednet_message events to go with them (which can then be "received" with rednet.receive(), or pulled manually with os.pullEvent()). As of ComputerCraft 1.6, this function also deals with responses to rednet.lookup() requests.

As there need not be multiple instances of this function active, attempting to call it while it's already running (ie most any time) results in an error being thrown ("rednet is already running").
Syntax rednet.run()
Returns Nothing.
Part of ComputerCraft
API rednet

Examples

Grid paper.png  Example
Attempts to manually start the rednet event listener.
Code
rednet.run()
Output An error stating "rednet is already running" (as this function is started automatically during each computer's / turtle's startup process).


Grid disk.png Rednet API Functions
rednet.open - rednet.close - rednet.send - rednet.broadcast - rednet.receive - rednet.isOpen - rednet.host - rednet.unhost - rednet.lookup
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox