WaitGump
Searches for a gump button with the specified return value and clicks it; if not found, hooks incoming gumps.
Value — the button return value (as a string in Pascal, as an integer in Python). In Pascal, the string is converted to an integer internally.
The method first iterates through all gumps currently cached by Stealth, looking for the first button whose ReturnValue matches the given value. If a matching button is found, it is clicked immediately.
If no matching button is found in existing gumps, a hook is installed on incoming gumps — when a new gump arrives from the server that contains a button with the matching return value, it will be clicked automatically.
Deprecated. This method is imprecise because it searches across all gumps indiscriminately. The NumGumpButton family of methods is recommended instead, as they target a specific gump by index and provide much more precise control.
Ищет кнопку гампа с указанным значением возврата и нажимает её; если не найдена — устанавливает ловушку на входящие гампы.
Value — значение возврата кнопки (строка в Pascal, целое число в Python). В Pascal строка преобразуется в целое число.
Метод сначала перебирает все гампы, хранящиеся в кеше Stealth, в поисках первой кнопки с совпадающим ReturnValue. Если найдена — нажимается немедленно.
Если среди существующих гампов совпадение не найдено, устанавливается ловушка на входящие гампы — при получении нового гампа от сервера с подходящей кнопкой она будет нажата автоматически.
Устарел. Этот метод неточен, поскольку ищет по всем гампам без разбора. Рекомендуется использовать методы семейства NumGumpButton, которые нацеливаются на конкретный гамп по индексу и обеспечивают гораздо более точный контроль.
procedure WaitGump(Value: String);
def WaitGump(Value: int) -> None: ...
begin
// Simple usage (deprecated approach)
WaitGump('1');
// Recommended approach: use NumGumpButton instead
if GetGumpsCount > 0 then
NumGumpButton(0, 1);
end.
# Simple usage (deprecated approach)
WaitGump(1)
# Recommended approach: use NumGumpButton instead
if GetGumpsCount() > 0:
NumGumpButton(0, 1)