bloodtap

Untitled

Dec 2nd, 2021 (edited)
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. print("Playing ", disk.getLabel(command))
  2. local lenght = lenghts[disk.getLabel(command)]
  3. local timer = os.startTimer(lenght)
  4. while true do
  5.   local evt, arg = os.pullEvent()
  6.   if evt == "disk_ejected" then
  7.         if arg == command then
  8.           break
  9.         end
  10.   elseif evt == "timer" then
  11.         if arg == timer then
  12.           disk.playAudio(command)
  13.           timer = os.startTimer(lenght)
  14.         end
  15.   end
  16. end
Add Comment
Please, Sign In to add comment