peripheral.getType

From ComputerCraft
Jump to: navigation, search

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

Returns boolean result
API peripheral
Source Lua (source)

Returns the type of peripheral attached at the specified side or network name. Returns nil when no peripheral is attached at the specified side or network name.

ExampleExampleGet peripheral type
Gets and prints the type of peripheral attached to the top side.
Code
print(peripheral.getType("top"))
Output If a wireless modem was attached, the output would be 'modem'.