over_fritz

[1.5.6] C.C. - Jukebox

Oct 9th, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. --Settings
  2. drive == "back" --Replace with the side of the drive
  3.  
  4. --Entry Menu
  5. peripheral.wrap(drive)
  6. print("What would you like to do?")
  7. print("Check / Play / Stop")
  8. print("The 'Play' command will fail if 'Check' returns False")
  9.  
  10. --Check Command
  11. if input == "check" then
  12.     disk.hasAudio(drive)
  13.     if disk.hasAudio() = true then
  14.         disk.getAudioTitle(drive)
  15.         print("The song is"...
  16.     else
  17.     print("Sorry, there is no audio disk in the drive.")
  18.     end
  19.     end
  20. end
  21.  
  22. --Play Command
  23. if input == "play" then
  24.     print("Preparing to play the song!")
  25.     print("Playing!")
  26.     disk.playAudio(drive)
  27. end
  28.  
  29. --Stop Command
  30. if input == "stop" then
  31.     write("Stopping the Jam")
  32.     textutils.slowPrint("...")
  33.     disk.stopAudio(drive)
  34.     print("The Jam has been stopped. Do you want your disk back? y/n")
  35.     if input == "y" or "yes" then
  36.         print("Ejecting disk...")
  37.         disk.eject(drive)
  38.         print("Disk Ejected.")
  39.     elseif input == "n" or "no" then
  40.         print("OK. Keeping disk in the drive.")
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment