Difference between revisions of "Modem.isOpen"
From ComputerCraft Wiki
(Categorised page) |
MKlegoman357 (Talk | contribs) m (Fixed variable types, expanded the example) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
|name=modem.isOpen | |name=modem.isOpen | ||
− | |args={{type| | + | |args={{type|number}} channel |
− | |returns={{type| | + | |returns={{type|boolean}} is channel open? |
|api=Modem | |api=Modem | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
Line 8: | Line 8: | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc=Checks whether the computer is listening on | + | |desc=Checks whether the computer is listening on channel 5. |
− | |code=modem.isOpen( | + | |code=<pre>if modem.isOpen(5) then |
+ | print("The computer is listening on channel 5.") | ||
+ | else | ||
+ | print("The computer is not listening on channel 5.") | ||
+ | end</pre> | ||
+ | |output=Weather or not channel 5 is open. | ||
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Revision as of 14:12, 8 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 |