Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- SkunkWorks Logistics
- -- Automatic music-disc player
- diskSide = "bottom" -- Disk drive location for this install
- version = "1.0"
- print("SkunkWorks Logistics")
- print("Music Player v"..version)
- print("Checking for disk...")
- while true do
- if disk.isPresent(diskSide) then
- if disk.hasAudio(diskSide) then
- print("Audio disc found.") -- Note that the official name of these discs uses a c, not a k, while CC's uses a k
- print("Now playing: \""..disk.getLabel(diskSide).."\" Enjoy!")
- disk.playAudio(diskSide)
- else
- print("Data disk found. Please eject this disk and insert an audio disc.")
- end
- os.pullEvent("disk_eject") -- Wait for disk to eject - rather than spinning through the loop if a data disk is in
- print("Disk ejected.")
- else
- print("Waiting for disc...")
- os.pullEvent("disk") -- Wait for a disk to be inserted
- print("Disk inserted.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement