peripheral.isPresent

From ComputerCraft
Jump to: navigation, search

peripheral.isPresent
Function
Syntax
peripheral.isPresent(
  • side or network name : string
)

Returns boolean result
API peripheral
Source Lua (source)

Returns if there's a peripheral attached at the specified side or network name.

ExampleExampleCheck if there is a peripheral attached on top.
Checks and prints if there is a peripheral attached to the top side.
Code
print(peripheral.isPresent("top"))
Output true