Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local timerID
- os.loadAPI("cd")
- -- Start first disc
- cd.eject()
- sleep(0.1)
- if cd.load() then
- timerID = os.startTimer(cd.play())
- else
- cd.reset()
- timerID = os.startTimer(5)
- end
- -- Main loop
- while true do
- local e,p1,p2,p3 = os.pullEvent()
- -- Change disc
- if (e == "timer" and p1==timerID) then
- cd.stop()
- cd.eject()
- sleep(0.1)
- if cd.load() then
- timerID = os.startTimer(cd.play())
- else
- cd.reset()
- timerID = os.startTimer(5)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement