Rhythmblock/neodj.lua

39 lines
716 B
Lua

accentColor = colors.gray
buttonColor = colors.lightGray
backgroundColor = colors.black
peripherals = peripheral.getNames()
if #peripherals < 0 then
print "No drive"
else
for n = 1, #peripherals do
local driveCheck = peripherals[n]
if peripheral.getType(driveCheck) == "drive" then
drive = driveCheck
driveCount = driveCount + 1
end
end
if driveCount => 1 then
print("Too many disk drives. Please remove some and try again")
exit()
end
end
function playDisc()
disk.playAudio(drive)
end
function ejectDisc()
end
function stopDisc()
end
if disk.isPresent(drive) and disk.hasAudio(drive) then
playDisc(drive)
elseif disk.isPresent() then
print "Not a music disc"
else
print "No disc"
end