Difference between revisions of "Modem.isOpen"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) m (Added 'local modem = peripheral.wrap("top")' to the example) |
MKlegoman357 (Talk | contribs) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
− | |name=modem.isOpen | + | |name=''modem''.isOpen |
|args={{type|number}} channel | |args={{type|number}} channel | ||
|returns={{type|boolean}} is channel open? | |returns={{type|boolean}} is channel open? |
Revision as of 15:39, 9 April 2014
Function modem.isOpen | |
Checks whether or not a certain channel is open. | |
Syntax | modem.isOpen(number channel) |
Returns | boolean is channel open? |
Part of | ComputerCraft |
API | Modem |
Examples
Example | |
Checks whether the computer is listening on channel 5. | |
Code |
local modem = peripheral.wrap("top") if modem.isOpen(5) then print("The computer is listening on channel 5.") else print("The computer is not listening on channel 5.") end |
Output | Whether or not channel 5 is open. |