Difference between revisions of "Peripheral.getType"
From ComputerCraft Wiki
MathManiac0 (Talk | contribs) m (Added printer to the list.) |
m (Moved to CAT:LuaCoreFunctions) |
||
| Line 15: | Line 15: | ||
}} | }} | ||
| + | |||
| + | [[Category:Lua_Core_Functions]] | ||
Latest revision as of 18:50, 28 November 2012
| 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
| 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", "printer", or nil if nothing was detected on the computer's right side. |