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

WaitTargetGround

Pre-sets a target hook that will automatically target the first object of the specified type found on the ground.

ObjType — graphic (type) of the object to search for on the ground.

The method performs a FindType search on the ground (Ground container). If a matching object is found, a target hook is installed for that object’s ID.

If a target cursor is already active at the moment of the call, the hook fires immediately. Otherwise, the hook waits for the next incoming target cursor and responds to it automatically.

If no matching object is found on the ground, an error is logged and no hook is installed.

Предустанавливает ловушку таргета, которая автоматически нацелится на первый объект указанного типа, найденный на земле.

ObjType — graphic (тип) искомого объекта на земле.

Метод выполняет поиск FindType на земле (контейнер Ground). Если объект найден, устанавливается ловушка таргета на его ID.

Если курсор цели уже активен в момент вызова, ловушка срабатывает немедленно. Иначе ловушка ожидает следующий входящий курсор цели и автоматически отвечает на него.

Если подходящий объект на земле не найден, логируется ошибка и ловушка не устанавливается.

Pascal

procedure WaitTargetGround(ObjType: Word);

Python

def WaitTargetGround(ObjType: int) -> None: ...

Pascal Example

const
  TREE_TYPE = $0CD0;
begin
  FindDistance := 3;
  WaitTargetGround(TREE_TYPE);
  UseSkill('Lumberjacking');
  Wait(2000);
  FindDistance := 2;
end.

Python Example

TREE_TYPE = 0x0CD0
SetFindDistance(3)
WaitTargetGround(TREE_TYPE)
UseSkill(44)  # Lumberjacking
Wait(2000)
SetFindDistance(2)

See Also

WaitTargetTile, WaitTargetType