Difference between revisions of "Peripheral.getType"
From ComputerCraft Wiki
m (Changed the name of the function, which was "isPresent") |
|||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
{{Function | {{Function | ||
− | |name=peripheral. | + | |name=peripheral.getType |
|args= [[string (type)|(string)]] side | |args= [[string (type)|(string)]] side | ||
|returns=[[string (type)|(string)]] the type of peripheral that is present on ''side'', or ''nil'' if nothing was found. | |returns=[[string (type)|(string)]] the type of peripheral that is present on ''side'', or ''nil'' if nothing was found. |
Revision as of 14:53, 10 October 2012
Function peripheral.getType | |
Tells you what is attached to a side of a computer. | |
Syntax | peripheral.getType((string) side) |
Returns | (string) the type of peripheral that is present on side, or nil if nothing was found. |
Part of | ComputerCraft |
API | peripheral |
Examples
Example | |
Prints what has been attached to the computer or turtle's right side. | |
Code |
print(peripheral.getType("right")) |
Output | Either "modem", "computer", "turtle", "drive", "monitor", or nil if nothing was detected on the computer's right side. |