Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

FindTypesArrayEx

Searches for objects matching any combination from the arrays of types ObjTypes, colors Colors, and containers Containers.

Internally, the method iterates through each type/color/container combination and executes a simple search for each. All results are aggregated.

Returns the ID of the last found object, or 0 if nothing was found or the character is disconnected.

Search radius is controlled by FindDistance (max 90) and FindVertical (max 120).

After a successful search, FindItem, FindCount, FindFullQuantity, and GetFindedList are updated.

Ищет объекты, соответствующие любой комбинации из массивов типов ObjTypes, цветов Colors и контейнеров Containers.

Внутри метод перебирает каждую комбинацию тип/цвет/контейнер и выполняет простой поиск для каждой. Все результаты агрегируются.

DWS

function FindTypesArrayEx(ObjTypes: array of Word; Colors: array of Word;
  Containers: array of Cardinal; InSub: Boolean): Cardinal;

Pascal Script

function FindTypesArrayEx(ObjTypes: TWordDynArray; Colors: TWordDynArray;
  Containers: TCardinalDynArray; InSub: Boolean): Cardinal;

Parameters:

  • ObjTypes — array of graphic types to search for. Use [$FFFF] for any type.
  • Colors — array of colors. Use [$FFFF] for any color.
  • Containers — array of container IDs (including Ground).
  • InSubTrue to search subcontainers recursively.

Python

def FindTypesArrayEx(ObjTypes: list[int], Colors: list[int], Containers: list[int], InSub: bool) -> int: ...

Pascal Example

begin
  FindDistance := 20;
  FindVertical := 10;
  // Search for multiple mobile types on the ground
  FindTypesArrayEx(
    [$29A, $29B, $190, $191, $25D, $25E],
    [$FFFF],
    [Ground],
    False
  );
  AddToSystemJournal('Mobiles found: ' + IntToStr(FindCount));
  FindDistance := 2;
end.

Python Example

SetFindDistance(20)
SetFindVertical(10)
FindTypesArrayEx(
    [0x29A, 0x29B, 0x190, 0x191, 0x25D, 0x25E],
    [0xFFFF],
    [Ground()],
    False
)
AddToSystemJournal(f'Mobiles found: {FindCount()}')
SetFindDistance(2)

See Also

FindTypeEx, FindType, FindItem, FindCount