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

WaitTargetType

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

ObjType — graphic (type) of the object to search for in the backpack.

The method performs a FindType search in the backpack. 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 in the backpack, an error is logged and no hook is installed.

For searching on the ground instead of the backpack, use WaitTargetGround.

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

ObjType — graphic (тип) искомого объекта в рюкзаке.

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

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

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

Для поиска на земле вместо рюкзака используйте WaitTargetGround.

Pascal

procedure WaitTargetType(ObjType: Word);

Python

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

Pascal Example

const
  BANDAGE_TYPE = $0E21;
begin
  WaitTargetType(BANDAGE_TYPE);
  UseSkill('Healing');
  Wait(2000);
end.

Python Example

BANDAGE_TYPE = 0x0E21
WaitTargetType(BANDAGE_TYPE)
UseSkill(17)  # Healing
Wait(2000)

See Also

WaitTargetGround, WaitTargetObject