forgot all those $item# variables, just use $itemcount. Ex:
Code:
if($itemcount(101)==1 && $itemcount(102)==1 && $itemcount(103)==1 && $itemcount(104)==1) { say("Ha! pwned.") }
oh and btw, depending on what system your compiling on, you might or might not have to put quotes around the item numbers.