Computer.getID

From ComputerCraft Wiki
Revision as of 02:52, 12 May 2013 by TheVarmari (Talk | contribs) (Added function page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Grid Redstone.png  Function computer.getID
Returns the ID of a computer or turtle wrapped to the "computer" variable
Syntax computer.getID()
Returns int ID
Part of ComputerCraft
API peripheral

Examples

Grid paper.png  Example
Prints the ID of a computer or turtle on the right side of the calling machine.
Code
local handle = peripheral.wrap("right") 
print(handle.getID())
Output The ID of any computer or turtle to the right of the calling machine.