noticed 1 bug, the items in the inner () with || should not also be outside that section 1002 1003 1004 are listed twice.
Code:
if ((itemcount(1001) == 1 || itemcount(1002) == 1 || itemcount(1003) == 1 || itemcount(1004) == 1 || itemcount(1005) == 1 || itemcount(1006) == 1 || itemcount(1007) == 1 || itemcount(1008) == 1 || itemcount(1009) == 1 || itemcount(1010) == 1 || itemcount(1011) == 1 || itemcount(1012) == 1) && $itemcount(1013) == 1 && $itemcount(1014) == 1 && $itemcount(1015) == 1)
so 1013, 1014, and 1015 should always be needed along with ANY one of 1001-1012
The length could be throwing it off, try testing with just 2 items in the || section
Code:
if ((itemcount(1001) == 1 || itemcount(1002) == 1) && $itemcount(1013) == 1 && $itemcount(1014) == 1 && $itemcount(1015) == 1)
see if 1001, 1013, 1014, 1015
or 1002, 1013, 1014, 1015 work in any order
But nothing else should