Difference between revisions of "Peripheral.getMethods"

From ComputerCraft Wiki
Jump to: navigation, search
m (Moved to CAT:LuaCoreFunctions)
m (Formatted example code)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=peripheral.getMethods
 
|name=peripheral.getMethods
|args= [[string (type)|(string)]] side
+
|args= {{type|string}} side
 
|returns=A table with all available methods for the peripheral on ''side''.
 
|returns=A table with all available methods for the peripheral on ''side''.
 
|api=peripheral
 
|api=peripheral
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=Prints all of the available methods for the peripheral on the right side of the computer/turtle.
 
|desc=Prints all of the available methods for the peripheral on the right side of the computer/turtle.
|code=for i,v in ipairs(peripheral.getMethods("right")) do print(i..". "..v) end
+
|code= for i,v in ipairs(peripheral.getMethods("right"))
 +
  do print(i..". "..v)
 +
end
 
|output=Depends on whatever is attached to the right hand side of the computer; there is a list on the page for the [[Peripheral (API)|peripheral API]].
 
|output=Depends on whatever is attached to the right hand side of the computer; there is a list on the page for the [[Peripheral (API)|peripheral API]].
 
}}
 
}}

Latest revision as of 12:50, 14 August 2015


Grid Redstone.png  Function peripheral.getMethods
Returns a table with all available methods for the peripheral on side.
Syntax peripheral.getMethods(string side)
Returns A table with all available methods for the peripheral on side.
Part of ComputerCraft
API peripheral

Examples

Grid paper.png  Example
Prints all of the available methods for the peripheral on the right side of the computer/turtle.
Code
for i,v in ipairs(peripheral.getMethods("right"))
  do print(i..". "..v)
end
Output Depends on whatever is attached to the right hand side of the computer; there is a list on the page for the peripheral API.