Advertisement
dengmahalYT

music player

Aug 30th, 2022 (edited)
746
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. lengths = {["C418 - 13"]=180, ["C418 - cat"]=186, ["C418 - blocks"]=347, ["C418 - chirp"]=186, ["C418 - far"]=172, ["C418 - mall"]=197, ["C418 - mellohi"]=98, ["C418 - stal"]=151, ["C418 - strad"]=191, ["C418 - ward"]=250, ["C418 - 11"]=70,["Lena Raine - otherside"]=200}
  2. args = { ... }
  3. if #args == 0 then
  4. print("Usage: repeat <side>")
  5. return
  6. end
  7. command = args[1]
  8. if disk.isPresent(command) then
  9. if disk.hasAudio(command) then
  10.   while disk.isPresent(command) do
  11.    print("Playing ".. disk.getLabel(command))
  12.    disk.playAudio(command)
  13.  
  14.    timesSlept = 0
  15.    length = lengths[disk.getLabel(command)]
  16.    while timesSlept <= length do
  17.     if disk.isPresent(command) == false then
  18.   print("Disk removed")
  19.   return
  20. end
  21.     sleep(1)
  22. timesSlept = timesSlept + 1
  23.    end
  24.   end
  25. else
  26.   print("Disk in ".. command .. " drive is not an audio disk")
  27. end
  28. else
  29. print("No disk in ".. command .. " drive")
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement