disk.getID

From ComputerCraft
Jump to: navigation, search

disk.getID
Function
Syntax
disk.getID(
  • side or network name : string
)

Returns number ID
API disk
Source CC:Tweaked (source)

Returns the ID of the disk drive attached at the specified side or network name. Returns nil if there is no disk drive attached at the specified side or network name or there is no disk in the disk drive.

ExampleExampleGet disk ID
Gets and prints the ID of the disk inserted in the disk drive on the top.
Code
print(disk.getID("top"))
Output If a disk drive is attached on the top, it would return the disk's ID.