disk.hasAudio

From ComputerCraft
Jump to navigation Jump to search

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

Returns boolean result
API disk
Source CC:Tweaked (source)

Checks if a disk drive has an item attached, and if that item is a music disk.

Error creating thumbnail: Unable to save thumbnail to destination
ExampleIs there a music disk?
Check if a music disk is present in the top disk drive.
Code
if disk.hasAudio("top") then
  print("The top disk drive contains a music disk!");
else
  print("There is no music disk present in the top disk drive!");
end
Output If a music disk is present in the top disk drive it says so, otherwise it says there are no music disk present.