Difference between revisions of "Os.getComputerID"

From ComputerCraft Wiki
Jump to: navigation, search
m (Changed int to number)
m (Fixed)
 
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=os.getComputerID
 
|name=os.getComputerID
|returns=[[number (type)|number]] ID
+
|returns={{type|number}} computerID
 
|api=OS
 
|api=OS
 
|addon=ComputerCraft
 
|addon=ComputerCraft
Line 8: Line 8:
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=Prints the computer ID.
+
|desc=Prints the computer ID (assuming it's 5).
|code=print(os.getComputerID())
+
|code=[[print]]('''os.getComputerID()''')
|output=1
+
|output=5
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Latest revision as of 18:43, 10 April 2014


Grid Redstone.png  Function os.getComputerID
Returns a number which uniquely identifies the computer and which is the name of the directory in the world’s computer directory containing the computer’s data. This function is also available as os.computerID.
Syntax os.getComputerID()
Returns number computerID
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Prints the computer ID (assuming it's 5).
Code
print(os.getComputerID())
Output 5