This is a simple Snipped to expand FindTypeEx. FindTypeEx only can scan 1 Type, 1 Color, 1 Location. With this Snipped you can Scan Multiple Types, in Multiple Colors at Multiple Places.
function FindTypeArray(TypeList:Array of Cardinal;ColorList:Array of Cardinal;ContainerList:Array of Cardinal;Distance:Integer;UseSubContainer:Boolean):Integer;
var
  TypeArray:Integer;
  ColorArray:Integer;
  ContainerArray:Integer;  
  TmpResult:Integer;
begin
  for TypeArray:=0 to Length(TypeList) do
  begin
    for ColorArray:=0 to Length(ColorList) do
    begin
    for ContainerArray:=0 to Length(ContainerList) do
      begin
        Finddistance:=Distance;
        if (FindTypeEx(TypeList[TypeArray],ColorList[ColorArray],ContainerList[ContainerArray],UseSubContainer)>0)then
        begin
          Result:=FindItem();
          exit;
        end;
      end;    
    end;
  end; 
  Result:=TmpResult;
end;
Example of Using:
PetID:=FindTypeArray([22,33,44,55],[0,100,250,9999],[Ground(),BackPack()],1,false);
the Syntax is:
FindTypeArray(Array of Types,Array of Color,Array of Container,GroundmaxDistance,ScanSubContainer);for those who wondering:
-GroundmaxDistance must be 0 or greater(max 25), if you dont want to scan grounds you can set it how you like. If grounds are on your list it will use the maxdistance
-ScanSubContainer is a setting for the special ability of FindTypeEx. It can scan all Items in all Sub Containers inside the ID.
Best example would be the Giant Beetle. In my experimental Code i scan for Ressources in beetle, using the ID of beetle.No real need for Exevent Popup like Easyuo;)