Advertisement
norway240

Computer Craft: Music Player

Aug 29th, 2012
2,715
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 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. if (disk.isPresent(side) == true) and (disk.hasAudio(side) == true) then -- if there is a disk and it has audio it will play
  7.  local diskname = disk.getAudioTitle(side)
  8.  print("Now Playing: " , diskname)
  9.  disk.playAudio(side)
  10. end
  11.  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
  12.  print("Invalid Disk")
  13.  disk.eject(side)
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement