Difference between revisions of "Disk (API)"
From ComputerCraft Wiki
(clarify hasData / hasAudio) |
|||
Line 1: | Line 1: | ||
− | ''If you were looking for disks as | + | ''If you were looking for disks as in Floppies, go to [[Floppy Disk]].'' |
Line 13: | Line 13: | ||
|- | |- | ||
|[[disk.hasData|disk.hasData]]([[string (type)|string]] side ) | |[[disk.hasData|disk.hasData]]([[string (type)|string]] side ) | ||
− | |Checks the disk | + | |Checks whether the current disk is a [[Floppy Disk|floppy disk]], as opposed to a [http://www.minecraftwiki.net/wiki/Music_Discs music disk]. |
|- | |- | ||
|[[disk.getMountPath|disk.getMountPath]]([[string (type)|string]] side ) | |[[disk.getMountPath|disk.getMountPath]]([[string (type)|string]] side ) | ||
Line 29: | Line 29: | ||
|- | |- | ||
|[[disk.hasAudio|disk.hasAudio]]([[string (type)|string]] side ) | |[[disk.hasAudio|disk.hasAudio]]([[string (type)|string]] side ) | ||
− | |Checks | + | |Checks whether the current disk is a [http://www.minecraftwiki.net/wiki/Music_Discs music disk], as opposed to a [[Floppy Disk|floppy disk]]. |
|- | |- | ||
|[[disk.getAudioTitle|disk.getAudioTitle]]([[string (type)|string]] side ) | |[[disk.getAudioTitle|disk.getAudioTitle]]([[string (type)|string]] side ) |
Revision as of 06:49, 25 October 2012
If you were looking for disks as in Floppies, go to Floppy Disk.
The Disk API allows you to interact with disk drives.
Methods
Method name | Description |
---|---|
disk.isPresent(string side ) | Checks the given side for a disk |
disk.hasData(string side ) | Checks whether the current disk is a floppy disk, as opposed to a music disk. |
disk.getMountPath(string side ) | Returns the directory path on which the disk on side has been mount (ex. /disk) |
disk.setLabel(string side, string label ) | Sets the label |
disk.getLabel(string side ) | Finds label |
disk.getDiskID(string side ) | Finds ID (unique for every disk) |
disk.hasAudio(string side ) | Checks whether the current disk is a music disk, as opposed to a floppy disk. |
disk.getAudioTitle(string side ) | Returns the audio title on the disk |
disk.playAudio(string side ) | Plays the audio |
disk.stopAudio(string side ) | Stops the audio |
disk.eject(string side ) | Ejects the disk. |