Difference between revisions of "Os.getComputerID"

From ComputerCraft Wiki
Jump to: navigation, search
m (Updated references from "os" to "OS")
(Add return type, example output, and more notes)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=os.getComputerID
 
|name=os.getComputerID
|returns=the ID of the Computer
+
|returns=[[int (type)|int]] the disk ID
 
|api=OS
 
|api=OS
 
|addon=ComputerCraft
 
|addon=ComputerCraft
|desc=returns the ID of the computer this command is executed on.
+
|desc=Returns a number which uniquely identifies the computer and which is the name of the directory in the world’s <code>computer</code> directory containing the computer’s data.
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=prints the Computer ID
+
|desc=Prints the computer ID.
 
|code=print(os.getComputerID())
 
|code=print(os.getComputerID())
 +
|output=1
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Revision as of 20:00, 21 April 2013


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.
Syntax os.getComputerID()
Returns int the disk ID
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Prints the computer ID.
Code
print(os.getComputerID())
Output 1