You can set it to compare to certain blocks, store them in variables, then run compare against those variables, no?
Example (probably not formatted well, sorry I'm getting back into lua still and turtle api):
turtle.suckup() //chest above with items you don't want to be mined)
Item1 =...