Posted 31 March 2015 - 07:39 PM
I am trying to make a program similar to the dj program included in computer craft. I planned on making a interface that would show a list of all the disks attached to a computer (most of which are on wired modems) and play the one that the user wants. To do this i am getting all attached peripherals and checking to see if it has audio with the disk.hasAudio and putting all that do have audio in a table to be returned. When i receive that table from from the function it only has values of nil. I do not know what is going wrong any help would be appreciated in advanced.
function hasAudio()
local names = peripheral.getNames()
local audio = {}
for i = 1 , #names do
if disk.hasAudio(names[i]) == true then
audio[i] = names[i]
end
end
print()
return audio
end
function getAudioTitle()
local audio = hasAudio()
local title = {}
for i = 1 , #audio do
title[i] = disk.getAudioTitle(audio[i])
end
return title
end
getAudioTitle()