Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Settings
- drive == "back" --Replace with the side of the drive
- --Entry Menu
- peripheral.wrap(drive)
- print("What would you like to do?")
- print("Check / Play / Stop")
- print("The 'Play' command will fail if 'Check' returns False")
- --Check Command
- if input == "check" then
- disk.hasAudio(drive)
- if disk.hasAudio() = true then
- disk.getAudioTitle(drive)
- print("The song is"...
- else
- print("Sorry, there is no audio disk in the drive.")
- end
- end
- end
- --Play Command
- if input == "play" then
- print("Preparing to play the song!")
- print("Playing!")
- disk.playAudio(drive)
- end
- --Stop Command
- if input == "stop" then
- write("Stopping the Jam")
- textutils.slowPrint("...")
- disk.stopAudio(drive)
- print("The Jam has been stopped. Do you want your disk back? y/n")
- if input == "y" or "yes" then
- print("Ejecting disk...")
- disk.eject(drive)
- print("Disk Ejected.")
- elseif input == "n" or "no" then
- print("OK. Keeping disk in the drive.")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment