Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rng=true
- playing=false
- loop=0
- term.setBackgroundcolor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- while rng do
- if disk.hasAudio("left") and playing==false then
- loop=0
- n = disk.getAudioTitle("left")
- term.clear()
- if n==nil then n="No Title" end
- term.setCursorPos(15,1)
- term.write("playing "..n)
- disk.playAudio("left")
- playing=true
- elseif playing==true and disk.hasAudio("left") then
- loop=0
- local e,k = os.pullEvent("key")
- if k==keys.w then
- rng=false
- term.clear()
- term.setCursorPos(1,1)
- disk.stopAudio("left")
- elseif k==keys.e then
- disk.eject("left")
- playing=false
- term.clear()
- term.setCursorPos(20,1)
- term.setTextColor(colors.red)
- term.write("ejected")
- term.setTextColor(colors.white)
- disk.stopAudio("left")
- sleep(1)
- elseif k==keys.r then
- disk.stopAudio("left")
- playing=false
- end
- else
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- term.write("No DISK!!")
- term.setTextColor(colors.white)
- sleep(.5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement