This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dragon53535's profile picture

Detecting the name of a music disc

Started by Dragon53535, 07 December 2012 - 03:23 PM
Dragon53535 #1
Posted 07 December 2012 - 04:23 PM
I'm trying to make a program for FTB that detects the name of the music disc inside the drive, and if it is still alive from portal or want you gone i want it to do specific things for each, now i've tried getting it to work but i can't get it to. The code so far for finding the name is:



HAHA i got it working!


local label = disk.getAudioTitle("right")
if label == ("pg.stillalive") then
print("hi")
elseif label == ("pg.wantyougone") then
print("Hello")
else
os.shutdown()
end


i need some help figuring this out since that's the last piece i need to complete the code.
Lyqyd #2
Posted 07 December 2012 - 04:25 PM
Check out the disk API page in the wiki–there is a specific method to get exactly this information.
Dragon53535 #3
Posted 07 December 2012 - 04:28 PM
Check out the disk API page in the wiki–there is a specific method to get exactly this information.
hehe my bad i didn't know there was an API for the disks, i went straight for trying to code it. thanks :D/>
Dlcruz129 #4
Posted 07 December 2012 - 06:28 PM
You spelled peripheral wrong…
Dragon53535 #5
Posted 08 December 2012 - 11:49 AM
You spelled peripheral wrong…
thanks, i've edited the code to another that i'm getting to work.