I made this with an array where each row is a new recipe that contains the 2 items required and the result. Then you can select your items by whatever method and you set their names to 2 global variables.
Then when you confirm the crafting you run through the recipe array at Y=1 checking if GV 1 matches anything in Y=1, if it does then grab that X and compare the same item in Y=2 at that X if it matches GV 2, if so then you craft the named item in Y=3
Of course sometimes the first craft item is in Y=2 and not Y=1, so if it's not in 1 then check 2.