2021-05-06 04:24:30 +00:00
|
|
|
accentColor = colors.gray
|
|
|
|
buttonColor = colors.lightGray
|
|
|
|
backgroundColor = colors.black
|
2021-05-06 04:49:37 +00:00
|
|
|
peripherals = peripheral.getNames()
|
|
|
|
if #peripherals < 0 then
|
2021-05-06 04:24:30 +00:00
|
|
|
print "No drive"
|
2021-05-06 04:49:37 +00:00
|
|
|
else
|
2021-05-06 04:51:37 +00:00
|
|
|
driveCount = 0
|
2021-05-06 04:49:37 +00:00
|
|
|
for n = 1, #peripherals do
|
|
|
|
local driveCheck = peripherals[n]
|
|
|
|
if peripheral.getType(driveCheck) == "drive" then
|
|
|
|
drive = driveCheck
|
|
|
|
driveCount = driveCount + 1
|
|
|
|
end
|
|
|
|
end
|
2021-05-06 04:50:35 +00:00
|
|
|
if driveCount > 1 then
|
2021-05-06 04:49:37 +00:00
|
|
|
print("Too many disk drives. Please remove some and try again")
|
|
|
|
exit()
|
|
|
|
end
|
2021-05-06 04:24:30 +00:00
|
|
|
end
|
2021-05-06 03:55:24 +00:00
|
|
|
|
2021-05-06 04:20:44 +00:00
|
|
|
function playDisc()
|
2021-05-06 04:15:32 +00:00
|
|
|
disk.playAudio(drive)
|
2021-05-06 04:57:47 +00:00
|
|
|
print(disk.getAudioTitle(drive))
|
2021-05-06 04:13:16 +00:00
|
|
|
end
|
2021-05-06 03:55:24 +00:00
|
|
|
|
2021-05-06 04:20:44 +00:00
|
|
|
function ejectDisc()
|
2021-05-06 04:57:47 +00:00
|
|
|
disk.eject()
|
2021-05-06 04:20:44 +00:00
|
|
|
end
|
|
|
|
|
2021-05-06 04:21:31 +00:00
|
|
|
function stopDisc()
|
2021-05-06 04:57:47 +00:00
|
|
|
disk.stopAudio()
|
2021-05-06 04:20:44 +00:00
|
|
|
end
|
|
|
|
|
2021-05-06 04:16:32 +00:00
|
|
|
if disk.isPresent(drive) and disk.hasAudio(drive) then
|
2021-05-06 04:20:44 +00:00
|
|
|
playDisc(drive)
|
2021-05-06 04:52:26 +00:00
|
|
|
elseif disk.isPresent(drive) then
|
2021-05-06 03:55:24 +00:00
|
|
|
print "Not a music disc"
|
|
|
|
else
|
|
|
|
print "No disc"
|
2021-05-06 04:13:16 +00:00
|
|
|
end
|
2021-05-06 03:55:24 +00:00
|
|
|
|