Advertisement
Guest User

music

a guest
Oct 27th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. print("Enter the side the disk drive is on")
  2. local side = read()
  3. if disk.isPresent(side) == false then -- detects if there is a disk
  4.  print("No Disk")
  5. end
  6.  
  7. while(true) do
  8. if (disk.isPresent(side) == true) and (disk.hasAudio(side) == true) then -- if there is a disk and it has audio it will play
  9.  local diskname = disk.getAudioTitle(side)
  10.  print("Now Playing: " , diskname)
  11.  disk.playAudio(side)
  12.  sleep(136)
  13. end
  14.  
  15. if (disk.isPresent(side) == true) and (disk.hasAudio(side) == false) then -- if there is a disk and it dosent have audio aka a floppy disk, then it will eject it
  16.  print("Invalid Disk")
  17.  disk.eject(side)
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement