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

CountGround

Searches for items with type ObjType on the ground and returns the total quantity including stack contents (FindFullQuantity).

The search radius is limited by FindDistance (horizontal) and FindVertical.

The method saves and restores the current find fields internally, so it does not affect an in-progress search.

Ищет предметы с типом ObjType на земле и возвращает общее количество с учётом стеков (FindFullQuantity).

Радиус поиска ограничен FindDistance (по горизонтали) и FindVertical (по вертикали).

Метод сохраняет и восстанавливает текущие поля поиска.

Pascal

function CountGround(ObjType: Word): Integer;

Parameters:

  • ObjType — graphic (type) of the item to count on the ground.

Python

def CountGround(obj_type: int) -> int: ...

Pascal Example

const
  ORE_TYPE = $19B9;
begin
  if CountGround(ORE_TYPE) > 0 then
    AddToSystemJournal('Ore on the ground: ' + IntToStr(CountGround(ORE_TYPE)));
end.

Python Example

ORE_TYPE = 0x19B9
if CountGround(ORE_TYPE) > 0:
    AddToSystemJournal(f'Ore on the ground: {CountGround(ORE_TYPE)}')

See Also

Count, CountEx, FindTypeEx