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

TargetID

Returns the current target cursor ID.

If a target cursor is active (IsTargeting = True) but the cursor ID is 0, a special constant is returned for backward compatibility.

Returns 0 if no target cursor is active.

Возвращает ID текущего курсора цели.

Если курсор цели активен (IsTargeting = True), но его ID равен 0, возвращается специальная константа для обратной совместимости.

Возвращает 0, если курсор цели не активен.

Pascal

function TargetID: Cardinal;

Python

def TargetID() -> int: ...

Pascal Example

begin
  if TargetID > 0 then
    AddToSystemJournal('Target cursor active, ID: $' + IntToHex(TargetID, 8))
  else
    AddToSystemJournal('No target cursor');
end.

Python Example

tid = TargetID()
if tid > 0:
    AddToSystemJournal(f'Target cursor active, ID: ${tid:08X}')
else:
    AddToSystemJournal('No target cursor')

See Also

WaitForTarget, TargetToObject, CancelTarget