Difference between revisions of "Disk.hasAudio"
From ComputerCraft Wiki
Scarfacial (Talk | contribs) (Created page with "{{lowercase}} {{Function |name=disk.hasAudio |args=string side |api=disk |returns=boolean there is audio saved on the disk |addon=ComputerCraft |examples...") |
Magiczocker (Talk | contribs) m |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=disk.hasAudio | |name=disk.hasAudio | ||
− | |args= | + | |args={{Type|string}} side |
|api=disk | |api=disk | ||
− | |returns= | + | |returns={{Type|boolean}} whether there is audio saved on the disk |
|addon=ComputerCraft | |addon=ComputerCraft | ||
+ | |desc=Checks whether the current disk is a [https://minecraft.gamepedia.com/Music_Disc music disk], as opposed to a [[Floppy Disk|floppy disk]] or other item. | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
Line 13: | Line 14: | ||
}} | }} | ||
}} | }} | ||
+ | |||
+ | [[Category:API_Functions]] |
Latest revision as of 07:02, 4 August 2020
Function disk.hasAudio | |
Checks whether the current disk is a music disk, as opposed to a floppy disk or other item. | |
Syntax | disk.hasAudio(string side) |
Returns | boolean whether there is audio saved on the disk |
Part of | ComputerCraft |
API | disk |
Examples
Example | |
Checks for audio saved on the disk in the bottom drive | |
Code |
print(disk.hasAudio("bottom")) |
Output | true if there is audio, otherwise false |