Difference between revisions of "Rednet.run"
From ComputerCraft Wiki
Bomb Bloke (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=rednet.run |api=rednet |returns=Nothing. |addon=ComputerCraft |desc=Automatically started within a co-routine by [[computer...") |
Bomb Bloke (Talk | contribs) (Also now handles answers to rednet.lookup() requests.) |
||
Line 5: | Line 5: | ||
|returns=Nothing. | |returns=Nothing. | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
− | |desc=Automatically started within a [[Coroutine_(type)|co-routine]] by [[ | + | |desc=Automatically started within a [[Coroutine_(type)|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_(event)|modem_message]] events to appear within the event queue. On spotting them, it then generates corresponding [[Rednet_message_(event)|rednet_message]] events to go with them (which can then be "received" with [[Rednet.receive|rednet.receive()]], or pulled manually with [[Os.pullEvent|os.pullEvent()]]). As of ComputerCraft 1.6, this function also deals with responses to [[rednet.lookup|rednet.lookup()]] requests.<br><br> |
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"). | 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"). | ||
Line 15: | Line 15: | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | {{RednetAPIFunctions}} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Latest revision as of 06:33, 6 June 2014
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
Rednet API Functions |
---|
rednet.open - rednet.close - rednet.send - rednet.broadcast - rednet.receive - rednet.isOpen - rednet.host - rednet.unhost - rednet.lookup |