Difference between revisions of "Computer.getID"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) (Fixed/Expanded) |
MKlegoman357 (Talk | contribs) (Variable renaming) |
||
Line 3: | Line 3: | ||
|name=''computer''.getID | |name=''computer''.getID | ||
|api=peripheral | |api=peripheral | ||
− | |returns={{type|number}} | + | |returns={{type|number}} computerID |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Returns the ID of a [[Computer]] or [[Turtle]] wrapped to the <var>computer</var> variable. | |desc=Returns the ID of a [[Computer]] or [[Turtle]] wrapped to the <var>computer</var> variable. |
Latest revision as of 11:03, 1 June 2014
Function computer.getID | |
Returns the ID of a Computer or Turtle wrapped to the computer variable. | |
Syntax | computer.getID() |
Returns | number computerID |
Part of | ComputerCraft |
API | peripheral |
Examples
Example | |
Prints the ID of a computer or turtle on the right side of the calling machine. | |
Code |
local computer = peripheral.wrap("right") print(computer.getID()) |
Output | The ID of any computer or turtle to the right of the calling machine. |