How to make script like this?

I can’t figure out how to write a script like in this site ( http://www.because-recollection.com/breakbot ), so when 3 parts of the picture match, some action occurs, like turning on a song.