Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Playing ", disk.getLabel(command))
- local lenght = lenghts[disk.getLabel(command)]
- local timer = os.startTimer(lenght)
- while true do
- local evt, arg = os.pullEvent()
- if evt == "disk_ejected" then
- if arg == command then
- break
- end
- elseif evt == "timer" then
- if arg == timer then
- disk.playAudio(command)
- timer = os.startTimer(lenght)
- end
- end
- end
Add Comment
Please, Sign In to add comment