Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Media Player 9000")
- function play()
- pause = true
- print()
- print("Press Space to Play/Pause")
- print("Press Tab to Eject")
- while true do
- local e,k = os.pullEvent("key")
- if k == keys.space then
- if pause then
- disk.playAudio("left")
- pause = false
- else
- disk.stopAudio("left")
- pause = true
- end
- elseif k == keys.tab then
- disk.eject("left")
- end
- end
- end
- if disk.hasAudio("left") then
- print(" "..disk.getAudioTitle("left"))
- play()
- else
- print("Please insert disc")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement