This is more complex analog of Generator of combinations which satisfy a condition. Again, it generates all possible combinations then filters them, this time, from series of conditions checks. With default values the conditions are:
Limit: Combination total limit should be less than or equal to specified value
Team: 'Team 1' or 'Team 2' count should be any number between 4 to 7 in a combination
Role: 'Bat' count should be any number between 3 to 5 in a combination, 'All' count should be any number between 1 to 3 in a combination, 'Bowl' count should be any number between 3 to 5 in a combination, 'Keeper' count should be 1 in a combination
Conditions can be edited, of course, values should match player's data table.