disk.hasAudio
Checks if a disk drive has an item attached, and if that item is 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. | ||
Functions  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua | 
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked | 
  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disk.hasAudio Function  | |
|---|---|
| 
Syntax disk.hasAudio( 
  | |
| Returns | boolean result | 
| API | disk | 
| Source | CC:Tweaked (source) | 
    This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.