Skip to content

EN UO Topic party

Codex edited this page Oct 12, 2026 · 4 revisions

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

Party

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

Group invitations, members, exit and messages. These transactions differ from general speech and commercial exchange.

Sections

Topic Commands and explanations
InParty UO.InParty
Invite UO.InviteToParty
Accept UO.PartyAcceptInvite
Decline UO.PartyDeclineInvite
Leave UO.PartyLeave
Remove Member UO.RemoveFromParty
Members List UO.PartyMembersList
PartySay UO.PartySay
Private Party Message UO.PartyPrivateMessageTo

All theme commands

Party

UO.InParty · UO.InviteToParty · UO.PartyAcceptInvite · UO.PartyDeclineInvite · UO.PartyLeave · UO.RemoveFromParty · UO.PartyMembersList · UO.PartyCanLootMe · UO.PartySay · UO.PartyPrivateMessageTo

Examples on the topic

Each command card has several independent scenarios: direct code, functions and classes. Below are selected short scenarios; restrictions and full analysis are in the cards.

UO.PartyMembersList

Parameters, result and all scenarios

var members = UO.PartyMembersList();
UO.Print(UO.GetArrayLength(members));

UO.PartySay

Parameters, result and all scenarios

UO.PartySay("Ready");

Complete command reference


UO.InParty

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

C# signatures

int UO.InParty();

Checks the presence of a current group based on the client's Party status.

Parameters

There are no parameters.

Return value

int 1 — non-zero serial of the leader is known in Party. int 0 - there is no leader. This is not the number of participants or the index of your own character in the list.

The result of the command is a numeric flag: 1 means a fulfilled condition, 0 means an unfulfilled one. After var result = command(...) check if (result != 0) or if (result == 0). Save the result of one call: a repeated call can perform the action again or read the state that has already changed.

Behavior

  • The local client model is read; There are no requests to the server, no waiting or moving.
  • The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.
  • This client checks Party.Leader, not just the number of non-empty list lines. If the invitation is accepted, the status will change after the server update.

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 result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

var result = UO.InParty();
UO.Print("InParty: " + Convert.ToString(result));

1. Fork script based on group presence - direct script

Parameters and execution flow:

  • There are no arguments. The current character's group is checked.
  • The team does not create a group and does not accept the invitation.
if (Truth(UO.InParty()))
{
    UO.Print("Party is active");
}
else
{
    UO.Print("No active party");
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2. Save State Once - Script Function

Parameters and execution flow:

  • inParty is a bool number, not the number of participants.
  • Reusing a variable does not reread the changed group.
return  RunScenario();
 object? RunScenario()
{
    var inParty = UO.InParty();
    UO.Print("Party 1/0: " + Convert.ToString(inParty));
    return null;
}

3. Wait for an update no more than a few checks - script class

Parameters and execution flow:

  • No more than 10 pauses for 200 ms; The cycle is limited to approximately two seconds plus command execution.
  • Waiting does not send invitations or guarantee membership in the group.
return await new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenarioAsync();
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;
    }

    async public Task<object?> RunScenarioAsync()
    {
        var attempts = 0;
        while (Truth(UO.InParty() == 0) && Truth(attempts < 10))
        {
            await Delay(200);
            attempts = attempts + 1;
        }

        if (Truth(UO.InParty()))
        {
            UO.Print("Party state received");
        }
        else
        {
            UO.Print("Party still absent");
        }

        return null;
    }

    Task Delay(object? milliseconds) => WaitAsync(checked((int)Convert.ToDouble(milliseconds)));
    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

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.InParty() — UO.InParty()

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "inparty": return new InjectionValue(bridge.InParty());

UO.InviteToParty

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

C# signatures

void UO.InviteToParty(object? objID);

Requests an invitation for a character to join the group.

Parameters

  • objID — Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyInvite puts serial through _manager.QueueTarget, then calls RequestPartyInviteByTarget. First, the target's queue is prepared, then the invitation request is sent.
  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.

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.InviteToParty");
UO.InviteToParty(UO.GetSerial("lasttarget"));

1. Direct call - direct script

Parameters and execution flow:

  • Requests an invitation for a character to join the group.
var id = UO.GetSerial("lasttarget");
if (Truth(UO.Exists(id)))
{
    UO.InviteToParty(id);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2. Explicit option - script function

Parameters and execution flow:

  • PartyInvite puts serial through _manager.QueueTarget, then calls RequestPartyInviteByTarget. First, the target's queue is prepared, then the invitation request is sent.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.GetSerial("self");
    if (Truth(UO.Exists(id)))
    {
        UO.InviteToParty(id);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
    {
        ApplyToLoaded(UO.GetSerial("lasttarget"));
        return null;
    }

    void ApplyToLoaded(dynamic id)
    {
        if (Truth(UO.Exists(id)))
        {
            UO.InviteToParty(id);
        }
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

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.InviteToParty(objID) — UO.InviteToParty(Any)

Parameters: objID (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "invitetoparty": bridge.PartyInvite(Arg(0)); return InjectionValue.Unit;

UO.PartyAcceptInvite

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

C# signatures

void UO.PartyAcceptInvite();

Accepts the saved invitation to the group.

Parameters

There are no parameters.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyAcceptInvite if Party.Inviter is non-zero, sends RequestPartyAccept, locally assigns Leader=Inviter and clears Inviter. Without an invitation there is no action.
  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.

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.PartyAcceptInvite");
UO.PartyAcceptInvite();

1. Direct call - direct script

Parameters and execution flow:

  • Accepts the saved invitation to the group.
UO.PartyAcceptInvite();

2. Explicit option - script function

Parameters and execution flow:

  • PartyAcceptInvite if Party.Inviter is non-zero, sends RequestPartyAccept, locally assigns Leader=Inviter and clears Inviter. Without an invitation there is no action.
return  RunScenario();
 object? RunScenario()
{
    UO.PartyAcceptInvite();
    UO.Print(UO.InParty());
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyAcceptInvite();
        UO.Wait(500);
        UO.Print(UO.GetArrayLength(UO.PartyMembersList()));
        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.PartyAcceptInvite() — UO.PartyAcceptInvite()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partyacceptinvite": bridge.PartyAcceptInvite(); return InjectionValue.Unit;

UO.PartyCanLootMe

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

C# signatures

void UO.PartyCanLootMe(object? value);

Changes whether party members are allowed to remove items from a corpse.

Parameters

  • value - 0 turns off; any non-zero integer includes.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyCanLoot locally sets Party.CanLoot and calls RequestPartyLootState(enabled). Non-zero Value turns on, 0 turns off. The server still checks the rules.
  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.

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.PartyCanLootMe");
UO.PartyCanLootMe(1);

1. Direct call - direct script

Parameters and execution flow:

  • Changes whether party members are allowed to remove items from a corpse.
UO.PartyCanLootMe(1);

2. Explicit option - script function

Parameters and execution flow:

  • PartyCanLoot locally sets Party.CanLoot and calls RequestPartyLootState(enabled). Non-zero Value turns on, 0 turns off. The server still checks the rules.
return  RunScenario();
 object? RunScenario()
{
    UO.PartyCanLootMe(0);
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
    {
        ApplyMode(1);
        return null;
    }

    void ApplyMode(dynamic mode)
    {
        UO.PartyCanLootMe(mode);
    }
}

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.PartyCanLootMe(value) — UO.PartyCanLootMe(Any)

Parameters: value (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partycanlootme": bridge.PartyCanLoot(Arg(0) != 0); return InjectionValue.Unit;

UO.PartyDeclineInvite

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

C# signatures

void UO.PartyDeclineInvite();

Declines a saved group invitation.

Parameters

There are no parameters.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyDeclineInvite if Party.Inviter is non-zero, sends Send_PartyDecline and clears Inviter. Without an invitation there is no action.
  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.

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.PartyDeclineInvite");
UO.PartyDeclineInvite();

1. Direct call - direct script

Parameters and execution flow:

  • Declines a saved group invitation.
UO.PartyDeclineInvite();

2. Explicit option - script function

Parameters and execution flow:

  • PartyDeclineInvite if Party.Inviter is non-zero, sends Send_PartyDecline and clears Inviter. Without an invitation there is no action.
return  RunScenario();
 object? RunScenario()
{
    UO.PartyDeclineInvite();
    UO.Print(UO.InParty());
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyDeclineInvite();
        UO.Wait(500);
        UO.Print(UO.GetArrayLength(UO.PartyMembersList()));
        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.PartyDeclineInvite() — UO.PartyDeclineInvite()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partydeclineinvite": bridge.PartyDeclineInvite(); return InjectionValue.Unit;

UO.PartyLeave

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

C# signatures

void UO.PartyLeave();

Requests the current character to leave the group.

Parameters

There are no parameters.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyLeave if there is a Player, calls GameActions.RequestPartyQuit(_world.Player); without Player it does not send anything.
  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.

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.PartyLeave");
UO.PartyLeave();

1. Direct call - direct script

Parameters and execution flow:

  • Requests the current character to leave the group.
UO.PartyLeave();

2. Explicit option - script function

Parameters and execution flow:

  • PartyLeave if there is a Player, calls GameActions.RequestPartyQuit(_world.Player); without Player it does not send anything.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.InParty()))
    {
        UO.PartyLeave();
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyLeave();
        UO.Wait(500);
        UO.Print(UO.InParty());
        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.PartyLeave() — UO.PartyLeave()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partyleave": bridge.PartyLeave(); return InjectionValue.Unit;

UO.PartyMembersList

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

C# signatures

dynamic UO.PartyMembersList();

Bridge filters out non-empty Party.Members entries and stores them serial in list order.

Parameters

There are no parameters.

Return value

Array int serial participants from local Party.Members. Empty entries/Serial=0 are excluded. The array may be empty.

Behavior

  • Bridge filters out non-empty Party.Members entries and stores them serial in list order. The call does not update the group from the server and does not invite members.
  • Reads the current local state. There is no package, target or automatic update; individual reads may see different states.

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 result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

object? result = UO.PartyMembersList();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Direct call - direct script

Parameters and execution flow:

  • Bridge filters out non-empty Party.Members entries and stores them serial in list order.
var members = UO.PartyMembersList();
UO.Print(UO.GetArrayLength(members));

2. Explicit option - script function

Parameters and execution flow:

  • Bridge filters out non-empty Party.Members entries and stores them serial in list order. The call does not update the group from the server and does not invite members.
return  RunScenario();
 object? RunScenario()
{
    var members = UO.PartyMembersList();
    if (Truth(UO.GetArrayLength(members) > 0))
    {
        UO.Print(Hex(members[0]));
    }

    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Reads the current local state. There is no package, target or automatic update; individual reads may see different states.
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()
    {
        var before = UO.PartyMembersList();
        UO.Wait(500);
        var after = UO.PartyMembersList();
        UO.Print(before);
        UO.Print(after);
        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.PartyMembersList() — UO.PartyMembersList()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "partymemberslist":

                    return new InjectionValue(bridge.PartyMembersList().Select(serial => new InjectionValue(serial)).ToArray());

UO.PartyPrivateMessageTo

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

C# signatures

void UO.PartyPrivateMessageTo(object? objID, object? msg);

Sends a private message to a group member.

Parameters

  • objID — Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action.
  • msg — Text through ToString; saved as transmitted.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartySay gets Text(1) and Arg(0); GameActions.SayParty(text, serial) addresses the message to the transmitted serial. The order is ObjID first, then Msg.
  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.

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.PartyPrivateMessageTo");
UO.PartyPrivateMessageTo("lasttarget", "Ready");

1. Direct call - direct script

Parameters and execution flow:

  • Sends a private message to a group member.
UO.PartyPrivateMessageTo("lasttarget", "Ready");

2. Explicit option - script function

Parameters and execution flow:

  • PartySay gets Text(1) and Arg(0); GameActions.SayParty(text, serial) addresses the message to the transmitted serial. The order is ObjID first, then Msg.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.GetSerial("lasttarget");
    if (Truth(UO.Exists(id)))
    {
        UO.PartyPrivateMessageTo(id, "Ready");
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
    {
        SendPartyMessage(UO.GetSerial("lasttarget"), "Ready");
        return null;
    }

    void SendPartyMessage(dynamic id, dynamic message)
    {
        if (Truth(id != "0x00000000") && Truth(Len(message) > 0))
        {
            UO.PartyPrivateMessageTo(id, message);
        }
    }

    int Len(object? value) => Convert.ToString(value)?.Length ?? 0;
    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

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.PartyPrivateMessageTo(objID, msg) — UO.PartyPrivateMessageTo(Any,Any)

Parameters: objID (Any), msg (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partyprivatemessageto": bridge.PartySay(Text(1), Arg(0)); return InjectionValue.Unit;

UO.PartySay

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

C# signatures

void UO.PartySay(object? msg);

Sends a message to the entire group.

Parameters

  • msg — Text through ToString; saved as transmitted.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • Calls GameActions.SayParty(text, 0). Zero serial means group message; group composition and delivery are determined by the server.
  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.

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.PartySay");
UO.PartySay("Ready");

1. Direct call - direct script

Parameters and execution flow:

  • Sends a message to the entire group.
UO.PartySay("Ready");

2. Explicit option - script function

Parameters and execution flow:

  • Calls GameActions.SayParty(text, 0). Zero serial means group message; group composition and delivery are determined by the server.
return  RunScenario();
 object? RunScenario()
{
    var message = "Ready";
    if (Truth(UO.IsOnline()))
    {
        UO.PartySay(message);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
    {
        SendText("Ready");
        return null;
    }

    void SendText(dynamic message)
    {
        if (Truth(Len(message) > 0))
        {
            UO.PartySay(message);
        }
    }

    int Len(object? value) => Convert.ToString(value)?.Length ?? 0;
    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

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.PartySay(msg) — UO.PartySay(Any)

Parameters: msg (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "partysay": bridge.PartySay(Text(0), 0); return InjectionValue.Unit;

UO.RemoveFromParty

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

C# signatures

void UO.RemoveFromParty(object? objID);

Requests the removal of a group member via serial.

Parameters

  • objID — Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action.

Return value

void - no value. Call on a separate line; completion does not confirm the server's action.

Behavior

  • PartyRemove calls RequestPartyRemoveMember. Resolution depends on the role of the current character and server; the list of participants is not changed synchronously by this command.
  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.

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.RemoveFromParty");
UO.RemoveFromParty(UO.GetSerial("lasttarget"));

1. Direct call - direct script

Parameters and execution flow:

  • Requests the removal of a group member via serial.
var id = UO.GetSerial("lasttarget");
if (Truth(UO.Exists(id)))
{
    UO.RemoveFromParty(id);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2. Explicit option - script function

Parameters and execution flow:

  • PartyRemove calls RequestPartyRemoveMember. Resolution depends on the role of the current character and server; the list of participants is not changed synchronously by this command.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.GetSerial("self");
    if (Truth(UO.Exists(id)))
    {
        UO.RemoveFromParty(id);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
    {
        ApplyToLoaded(UO.GetSerial("lasttarget"));
        return null;
    }

    void ApplyToLoaded(dynamic id)
    {
        if (Truth(UO.Exists(id)))
        {
            UO.RemoveFromParty(id);
        }
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

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.RemoveFromParty(objID) — UO.RemoveFromParty(Any)

Parameters: objID (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "removefromparty": bridge.PartyRemove(Arg(0)); return InjectionValue.Unit;

Clone this wiki locally