Skip to content

EN API UO WaitGump

LIHACHTETAN edited this page Nov 28, 2026 · 3 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

UO.WaitGump

Home · C# · IDE · UO API · A–Z · Examples · Languages

C# signatures

void UO.WaitGump(object? value);
void UO.WaitGump(object? trigger1, object? trigger2);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11, object? trigger12);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11, object? trigger12, object? trigger13);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11, object? trigger12, object? trigger13, object? trigger14);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11, object? trigger12, object? trigger13, object? trigger14, object? trigger15);
void UO.WaitGump(object? trigger1, object? trigger2, object? trigger3, object? trigger4, object? trigger5, object? trigger6, object? trigger7, object? trigger8, object? trigger9, object? trigger10, object? trigger11, object? trigger12, object? trigger13, object? trigger14, object? trigger15, object? trigger16);

Registers a sequence of one-time responses to buttons. The script continues running immediately; the absence of a window does not cause a 30-second delay.

Parameters

  • value — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger1 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger2 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger3 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger4 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger5 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger6 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger7 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger8 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger9 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger10 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger11 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger12 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger13 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger14 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger15 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.
  • trigger16 — Sequence element: int ButtonID, numeric string, string with |/comma, or Array of such elements. The order is from left to right. General boundaries and rules triggerId apply. Value is the name of the only parameter of the form object?, which also accepts an array.

Return value

void - returns nothing: neither success, nor a new value, nor server confirmation.

Behavior

  • Looks for a real Activate button with the desired ButtonID; Buttons for switching pages and windows without the required button are skipped. Subsequent ID do not bypass the first one waiting. For one markup delivery - no more than one response in one window. The updated markup can use the same window object.
  • The next WaitGump of the same script completes its pending sequence. The search is not limited to GumpID: use NumGumpButton or SendGumpSelect for precise selection. ButtonID=0 will only work if there is an existing Activate button with ID 0; This is not a universal closure.
  • Normal completion of the procedure saves the wait. Canceling an owner or Terminate with its name removes its pendings; TerminateAll deletes everything, including those remaining after completion of procedures. Changing the world clears the queue. Expectations are not saved to the profile.

Standalone C# scripts

Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.

Simple example

Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.

The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.

UO.Print("Calling UO.WaitGump");
UO.WaitGump(100);

1. One answer - direct script

Parameters and execution flow:

  • 100 — ButtonID of the response. WaitGump registers it before UseObject; further execution does not mean that the server has already accepted the response.
UO.WaitGump(100);
UO.UseObject("0x40001234");

2. Multiple Steps - Script Function

Parameters and execution flow:

  • 7, 22 and 1 are the ButtonIDs of the sequential forms. These ID are checked in order. The number of arguments does not specify the delay; the call logs the entire sequence.
return  RunScenario();
 object? RunScenario()
{
    UO.WaitGump(7, 22, 1);
    UO.UseObject("0x40001234");
    return null;
}

3. Cancel Expectations - Script Class

Parameters and execution flow:

  • The line 7|22|1 specifies the same sequence. TerminateAll then clears all pending gumps and stops all procedures; this is a global action.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.WaitGump("7|22|1");
        UO.TerminateAll();
        return null;
    }
}

Command implementation

C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.

UO.WaitGump(value) — UO.WaitGump(Any)

Parameters: value (Any/Integer/String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "waitgump": CompactWaitGump(arguments); return InjectionValue.Unit;

UO.WaitGump(value) — UO.WaitGump(Integer)

Parameters: value (Any/Integer/String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void WaitGump(int triggerId)

        {

            if (bridge is IApiGumpAutomation automation) automation.QueueGumpButtons(new[] { triggerId });

            else bridge.WaitGumpSelect(triggerId, 30_000);

        }

UO.WaitGump(value) — UO.WaitGump(String)

Parameters: value (Any/Integer/String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void WaitGump(string triggerId)

        {

            string text = (triggerId ?? string.Empty).Trim();

            if (text.Contains('|') || text.Contains(','))

            {

                InjectionValue[] chain = text.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries)

                    .Select(value => new InjectionValue(value.Trim())).ToArray();

                CompactWaitGump(chain);

                return;

            }

            WaitGump(NumberConversions.ToInt(triggerId));

        }

UO.WaitGump(trigger1, trigger2) — UO.WaitGump(Any,Any)

Parameters: trigger1 (Any), trigger2 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3) — UO.WaitGump(Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4) — UO.WaitGump(Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5) — UO.WaitGump(Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6) — UO.WaitGump(Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11, trigger12) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any), trigger12 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11, trigger12, trigger13) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any), trigger12 (Any), trigger13 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11, trigger12, trigger13, trigger14) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any), trigger12 (Any), trigger13 (Any), trigger14 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11, trigger12, trigger13, trigger14, trigger15) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any), trigger12 (Any), trigger13 (Any), trigger14 (Any), trigger15 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

UO.WaitGump(trigger1, trigger2, trigger3, trigger4, trigger5, trigger6, trigger7, trigger8, trigger9, trigger10, trigger11, trigger12, trigger13, trigger14, trigger15, trigger16) — UO.WaitGump(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

Parameters: trigger1 (Any), trigger2 (Any), trigger3 (Any), trigger4 (Any), trigger5 (Any), trigger6 (Any), trigger7 (Any), trigger8 (Any), trigger9 (Any), trigger10 (Any), trigger11 (Any), trigger12 (Any), trigger13 (Any), trigger14 (Any), trigger15 (Any), trigger16 (Any)

Result: void / Unit.

During a call:

The call executes the stored handler delegate. The registration method creates this delegate while building the API.

Internal implementation code; this is not a standalone script.

values =>

                    {

                        CompactWaitGump(values);

                        return InjectionValue.Unit;

                    }

Clone this wiki locally