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

NumGumpButton

Presses a button on the gump at the specified index.

GumpIndex — index of the gump (0-based, as used by GetGumpsCount).

Value — the button ID to press.

Returns True if the button was successfully pressed, False if the gump index is invalid or the character is disconnected.

Unlike WaitGump, this method targets a specific gump by its index, which is more reliable when multiple gumps are open.

Нажимает кнопку на гампе с указанным индексом.

GumpIndex — индекс гампа (начиная с 0, как в GetGumpsCount).

Value — ID кнопки для нажатия.

Возвращает True, если кнопка успешно нажата, False — если индекс гампа недействителен или персонаж не подключён.

В отличие от WaitGump, этот метод обращается к конкретному гампу по индексу, что надёжнее при наличии нескольких открытых гампов.

Pascal

function NumGumpButton(GumpIndex: Word; Value: Integer): Boolean;

Python

def NumGumpButton(GumpIndex: int, Value: int) -> bool: ...

Pascal Example

begin
  if GetGumpsCount > 0 then
  begin
    if NumGumpButton(0, 1) then
      AddToSystemJournal('Button pressed on gump 0')
    else
      AddToSystemJournal('Failed to press button');
  end;
end.

Python Example

if GetGumpsCount() > 0:
    if NumGumpButton(0, 1):
        AddToSystemJournal('Button pressed on gump 0')
    else:
        AddToSystemJournal('Failed to press button')

See Also

WaitGump, GetGumpInfo, NumGumpCheckBox, NumGumpRadiobutton, NumGumpTextEntry