modem.isOpen

From ComputerCraft
Jump to navigation Jump to search

modem.isOpen
Function
Syntax
modem.isOpen()
Returns boolean open
API modem
Source CC:Tweaked (source)

Checks if a channel is open. A channel must be open to receive messages on it. A modem can only have 128 channels open at the same time.

channel must be a Number between 0 and 65535.

ExampleExampleCheck if channel 42 is open
Check if channel 42 is open.
Code
local modem = peripheral.find("modem")
print(modem.isOpen(42))
Output
true