Skip to content

EN UO Topic speech chat

Codex edited this page Oct 12, 2026 · 4 revisions

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

Speech & Chat

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

Character speech, emotions, chat channels and filters. Local message printing in the client is located in Client UI.

Sections

Topic Commands and explanations
Say UO.Say
SayU UO.SayU
UOSay UO.UOSay
Emote UO.EmoteAction · UO.Bow · UO.Salute
Speech Filters UO.FilterSpeech
Global Chat UO.GlobalChatSendMsg · UO.GlobalChatActiveChannel
Channels UO.GlobalChatChannelsList · UO.GlobalChatJoinChannel · UO.GlobalChatLeaveChannel
Ignore Users UO.AddChatUserIgnore · UO.ClearChatUserIgnore

All theme commands

Speech

UO.Say · UO.SayU · UO.UOSay · UO.UOSayColor · UO.Msg · UO.UOAMessage · UO.FixTalk

Emote

UO.Bow · UO.Salute · UO.EmoteAction

Filters / Channels

UO.FilterSpeech · UO.AddChatUserIgnore · UO.ClearChatUserIgnore · UO.GlobalChatActiveChannel · UO.GlobalChatChannelsList · UO.GlobalChatJoinChannel · UO.GlobalChatLeaveChannel · UO.GlobalChatSendMsg

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.Say

Parameters, result and all scenarios

if (Truth(UO.Connected()))
{
    UO.Say("bank");
}

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

UO.GlobalChatSendMsg

Parameters, result and all scenarios

UO.GlobalChatSendMsg("Hello");

Complete command reference


UO.AddChatUserIgnore

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

C# signatures

void UO.AddChatUserIgnore(object? userName);

Adds the sender's name to the local log message filtering list. The filter operates on this client and does not send a request to the server.

Parameters

  • userName is the name of the log sender. A value that is empty or contains spaces is ignored; edge spaces are removed.

Return value

void. The command does not return a successful addition.

Behavior

  • The sender name comparison is not case sensitive. Messages from a matched name are hidden by a local log filter; This is not blocking a player on the server. UO.ClearChatUserIgnore() clears the entire local list of names. Clearing the filter does not restore records that have already been excluded from display.

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

1. Hide new log entries under this name in the current tenant. - direct script

Parameters and execution flow:

  • Hide new log entries under this name in the current tenant.
UO.AddChatUserIgnore("ExampleVendor");

2. Pass the name via a string variable. - script function

Parameters and execution flow:

  • Pass the name via a string variable.
return  RunScenario();
 object? RunScenario()
{
    var sender = "ExampleVendor";
    UO.AddChatUserIgnore(sender);
    return null;
}

3. Add two names to the local filter; the call does not block them on the server. - script class

Parameters and execution flow:

  • Add two names to the local filter; the call does not block them on the server.
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.AddChatUserIgnore("ExampleVendor");
        UO.AddChatUserIgnore("ExamplePlayer");
        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.AddChatUserIgnore(userName) — UO.AddChatUserIgnore(Any)

Parameters: userName (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "addchatuserignore": bridge.AddChatUserIgnore(Text(0)); return InjectionValue.Unit;

UO.Bow

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

C# signatures

void UO.Bow();

Sends the bow character's action via GameActions.EmoteAction.

Parameters

There are no parameters.

Return value

void - no return value.

Behavior

  • This is the character's animation/action. The command does not return a server confirmation and does not wait for the animation to finish.

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

1. Bow - direct script

Parameters and execution flow:

  • Send one bow.
UO.Bow();

2. Bow when connecting - script function

Parameters and execution flow:

  • Checking the connection precedes sending the action.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.Connected()))
    {
        UO.Bow();
    }

    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. Hello Procedure - Script Class

Parameters and execution flow:

  • The fully declared procedure dispatches the same 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()
    {
        Greet();
        return null;
    }

    void Greet()
    {
        UO.Bow();
    }
}

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

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "bow": bridge.Bow(); return InjectionValue.Unit;

UO.ClearChatUserIgnore

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

C# signatures

void UO.ClearChatUserIgnore();

Removes all case-insensitive sender name filters JournalManager.

Parameters

There are no parameters.

Return value

void - no return value.

Behavior

  • Removing filters does not delete history entries or cancel AddJournalIgnore text filters.

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

1. Clear state - direct script

Parameters and execution flow:

  • Removes all case-insensitive sender name filters JournalManager.
UO.ClearChatUserIgnore();

2. Clear after setup - script function

Parameters and execution flow:

  • Re-enable display of messages on behalf of Vendor.
return  RunScenario();
 object? RunScenario()
{
    UO.AddChatUserIgnore("Vendor");
    UO.ClearChatUserIgnore();
    return null;
}

3. Re-Purge - Script Class

Parameters and execution flow:

  • Clearing an empty set is acceptable and does not create a new setting.
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.ClearChatUserIgnore();
        UO.ClearChatUserIgnore();
        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.ClearChatUserIgnore() — UO.ClearChatUserIgnore()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "clearchatuserignore": bridge.ClearChatUserIgnore(); return InjectionValue.Unit;

UO.EmoteAction

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

C# signatures

void UO.EmoteAction(object? action);

Sends the character action/animation string name to GameActions.EmoteAction.

Parameters

  • action — Action name, such as bow or salute; is converted to string. Action recognition is performed by GameActions.

Return value

void - no return value.

Behavior

  • This is a character action, not printing a phrase into a journal. The command does not return a server confirmation and does not wait for animation.

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

1. Bow - direct script

Parameters and execution flow:

  • The action name is bow.
UO.EmoteAction("bow");

2. Welcome — script function

Parameters and execution flow:

  • The action name salute is passed.
return  RunScenario();
 object? RunScenario()
{
    UO.EmoteAction("salute");
    return null;
}

3. Name from variable - script class

Parameters and execution flow:

  • The action string is passed without assigning an object target.
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 action = "bow";
        UO.EmoteAction(action);
        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.EmoteAction(action) — UO.EmoteAction(Any)

Parameters: action (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "emoteaction": bridge.EmoteAction(Text(0)); break;

UO.FilterSpeech

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

C# signatures

void UO.FilterSpeech();
void UO.FilterSpeech(object? enabled);

Enables or disables the client speech filter.

Parameters

  • enabled — Optional value: without an argument, the filter is turned on; 0 turns off, non-zero int turns on.

Return value

void - no return value.

Behavior

  • Writes the normalized flag to the runtime state and passes it to the manager. The filter affects the client's processing; server events and other log settings remain separate.

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

1. Enable without argument - direct script

Parameters and execution flow:

  • A zero number of arguments means include, not read.
UO.FilterSpeech();

2. Turn off - script function

Parameters and execution flow:

  • An explicit 0 turns off the client filter.
return  RunScenario();
 object? RunScenario()
{
    UO.FilterSpeech(0);
    return null;
}

3. Turn On and Then Turn Off - Script Class

Parameters and execution flow:

  • The filter turns on and clearly returns to the off state.
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.FilterSpeech(1);
        UO.FilterSpeech(0);
        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.FilterSpeech() — UO.FilterSpeech()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "filterspeech": state.SpeechFilter = arguments.Length == 0 || Arg(0) != 0 ? 1 : 0; bridge.SetSpeechFilter(state.SpeechFilter); break;

UO.FilterSpeech(enabled) — UO.FilterSpeech(Any)

Parameters: enabled (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "filterspeech": state.SpeechFilter = arguments.Length == 0 || Arg(0) != 0 ? 1 : 0; bridge.SetSpeechFilter(state.SpeechFilter); break;

UO.FixTalk

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

C# signatures

void UO.FixTalk();

Prints a notice that the legacy native client patch FixTalk is not required by ClassicUO.

Parameters

There are no parameters.

Return value

void - no return value.

Behavior

  • The ExecuteLegacyManualAlias branch only calls SystemMessage. It does not correct motion, speech, containers, or network protocol.

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

1. Compatibility Notice - Direct Script

Parameters and execution flow:

  • The message describes the lack of need for the old patch.
UO.FixTalk();

2. Call in procedure - script function

Parameters and execution flow:

  • The compatibility procedure does not change the game world.
return  RunScenario();
 object? RunScenario()
{
    CompatibilityNotice();
    return null;
}

void CompatibilityNotice()
{
    UO.FixTalk();
}

3. Script Continuation - Script Class

Parameters and execution flow:

  • After the diagnostic message, execution continues.
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.FixTalk();
        UO.Print("continued");
        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.FixTalk() — UO.FixTalk()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "boxhack":

                case "fixtalk":

                case "fixwalk":

                    SystemMessage($"{name}: obsolete native-client patch; ClassicUO does not require it.");

                    break;

UO.GlobalChatActiveChannel

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

C# signatures

dynamic UO.GlobalChatActiveChannel();

Reads ChatManager.CurrentChannelName.

Parameters

There are no parameters.

Return value

string - CurrentChannelName or an empty line if the channel is not selected.

Behavior

  • Reads ChatManager.CurrentChannelName. Empty line - no name, no error code; the channel itself is not entered.
  • 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.GlobalChatActiveChannel();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Direct call - direct script

Parameters and execution flow:

  • Reads ChatManager.CurrentChannelName.
UO.Print(UO.GlobalChatActiveChannel());

2. Explicit option - script function

Parameters and execution flow:

  • Reads ChatManager.CurrentChannelName. Empty line - no name, no error code; the channel itself is not entered.
return  RunScenario();
 object? RunScenario()
{
    var channel = UO.GlobalChatActiveChannel();
    if (Truth(Len(channel) > 0))
    {
        UO.Print(channel);
    }

    return null;
}

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;

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.GlobalChatActiveChannel();
        UO.Wait(500);
        var after = UO.GlobalChatActiveChannel();
        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.GlobalChatActiveChannel() — UO.GlobalChatActiveChannel()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "globalchatactivechannel": return new InjectionValue(bridge.GlobalChatActiveChannel());

UO.GlobalChatChannelsList

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

C# signatures

dynamic UO.GlobalChatChannelsList();

Bridge returns ChatManager.Channels.Keys.OrderBy(name => name).

Parameters

There are no parameters.

Return value

Array of channel name strings, sorted by name. An empty local table produces an empty array.

Behavior

  • Bridge returns ChatManager.Channels.Keys.OrderBy(name => name). The list is known to the client and may not be complete until the server updates.
  • 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.GlobalChatChannelsList();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Direct call - direct script

Parameters and execution flow:

  • Bridge returns ChatManager.Channels.Keys.OrderBy(name => name).
var channels = UO.GlobalChatChannelsList();
UO.Print(UO.GetArrayLength(channels));

2. Explicit option - script function

Parameters and execution flow:

  • Bridge returns ChatManager.Channels.Keys.OrderBy(name => name). The list is known to the client and may not be complete until the server updates.
return  RunScenario();
 object? RunScenario()
{
    var channels = UO.GlobalChatChannelsList();
    if (Truth(UO.GetArrayLength(channels) > 0))
    {
        UO.Print(channels[0]);
    }

    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:

  • 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.GlobalChatChannelsList();
        UO.Wait(500);
        var after = UO.GlobalChatChannelsList();
        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.GlobalChatChannelsList() — UO.GlobalChatChannelsList()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "globalchatchannelslist": return StringArray(bridge.GlobalChatChannels());

UO.GlobalChatJoinChannel

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

C# signatures

void UO.GlobalChatJoinChannel(object? chName);

Requests entry into the global chat channel.

Parameters

  • chName — 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

  • Sends a Send_ChatJoinCommand with the given channel name. The presence of a channel and permission to enter is determined by the server. The name of the local active channel is read separately.
  • 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.GlobalChatJoinChannel");
UO.GlobalChatJoinChannel("General");

1. Direct call - direct script

Parameters and execution flow:

  • Requests entry into the global chat channel.
UO.GlobalChatJoinChannel("General");

2. Explicit option - script function

Parameters and execution flow:

  • Sends a Send_ChatJoinCommand with the given channel name. The presence of a channel and permission to enter is determined by the server. The name of the local active channel is read separately.
return  RunScenario();
 object? RunScenario()
{
    var message = "General";
    if (Truth(UO.IsOnline()))
    {
        UO.GlobalChatJoinChannel(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("General");
        return null;
    }

    void SendText(dynamic message)
    {
        if (Truth(Len(message) > 0))
        {
            UO.GlobalChatJoinChannel(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.GlobalChatJoinChannel(chName) — UO.GlobalChatJoinChannel(Any)

Parameters: chName (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "globalchatjoinchannel": bridge.GlobalChatJoin(Text(0)); return InjectionValue.Unit;

UO.GlobalChatLeaveChannel

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

C# signatures

void UO.GlobalChatLeaveChannel();

Requests to leave the global chat channel.

Parameters

There are no parameters.

Return value

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

Behavior

  • GlobalChatLeave sends Send_ChatLeaveChannelCommand. The local channel name will change after the chat data is processed.
  • 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.GlobalChatLeaveChannel");
UO.GlobalChatLeaveChannel();

1. Direct call - direct script

Parameters and execution flow:

  • Requests to leave the global chat channel.
UO.GlobalChatLeaveChannel();

2. Explicit option - script function

Parameters and execution flow:

  • GlobalChatLeave sends Send_ChatLeaveChannelCommand. The local channel name will change after the chat data is processed.
return  RunScenario();
 object? RunScenario()
{
    UO.Print(UO.GlobalChatActiveChannel());
    UO.GlobalChatLeaveChannel();
    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.GlobalChatLeaveChannel();
        UO.Wait(500);
        UO.Print(UO.GlobalChatActiveChannel());
        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.GlobalChatLeaveChannel() — UO.GlobalChatLeaveChannel()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "globalchatleavechannel": bridge.GlobalChatLeave(); return InjectionValue.Unit;

UO.GlobalChatSendMsg

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

C# signatures

void UO.GlobalChatSendMsg(object? msgText);

Sends a message to the global chat.

Parameters

  • msgText — 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

  • Sends a Send_ChatMessageCommand with the transmitted text. The channel uses the client/server chat state; the team does not choose the channel itself.
  • 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.GlobalChatSendMsg");
UO.GlobalChatSendMsg("Hello");

1. Direct call - direct script

Parameters and execution flow:

  • Sends a message to the global chat.
UO.GlobalChatSendMsg("Hello");

2. Explicit option - script function

Parameters and execution flow:

  • Sends a Send_ChatMessageCommand with the transmitted text. The channel uses the client/server chat state; the team does not choose the channel itself.
return  RunScenario();
 object? RunScenario()
{
    var message = "Hello";
    if (Truth(UO.IsOnline()))
    {
        UO.GlobalChatSendMsg(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("Hello");
        return null;
    }

    void SendText(dynamic message)
    {
        if (Truth(Len(message) > 0))
        {
            UO.GlobalChatSendMsg(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.GlobalChatSendMsg(msgText) — UO.GlobalChatSendMsg(Any)

Parameters: msgText (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "globalchatsendmsg": bridge.GlobalChatSend(Text(0)); return InjectionValue.Unit;

UO.Msg

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

C# signatures

void UO.Msg(object? message);

Shows a local message about script progress or stopping condition. You see it, not other players.

Parameters

Return value

A call to a method with a return type void is written as a standalone statement C#; the result cannot be assigned or checked. Completing the statement does not constitute confirmation from the game server.

Behavior

  • The message goes to the lower left area of ​​the game window and the local log. A copy is available in output IDE. In the manager's general log, enable the script message filter: the entry is available without the game window. The server system message filter does not select such records. The network voice packet is not sent. For the inscription above the head there is UO.CharPrint.
  • UO.Print adds a new entry to the game message log: first read or save the desired search string/result, then record the diagnostic message. In a fast loop, record messages when changes occur rather than every iteration.
  • Without color, hue 0x03B2 is used. UO.Print(text, color) accepts text first; UO.ColorPrint(color, text) – color first.
  • Despite the Server in the name or the similarity to a network message, the command only prints local text. To speak to the world, use UO.Say.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

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 and has no return value (void). The message text appears directly in the call.

UO.Msg("Hello from C#");

1. Brief report - direct script

Parameters and execution flow:

  • processed=12 — demo number of items already processed. Convert.ToString turns it into a string. This example only reports a number; it does not transfer the objects themselves.
var processed = 12;
UO.Msg("Processed item entries: " + Convert.ToString(processed));

2. Overload Warning - Script Function

Parameters and execution flow:

  • The character's weight and maximum are read. A zero/unknown maximum is not considered an overload. If weight >= maximum, one line is printed and Main ends; items are not thrown away.
return  RunScenario();
 object? RunScenario()
{
    var weight = UO.Weight();
    var maximum = UO.MaxWeight();
    if (Truth(maximum > 0) && Truth(weight >= maximum))
    {
        UO.Msg("Too heavy: " + Convert.ToString(weight) + "/" + Convert.ToString(maximum));
        return null;
    }

    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. Report Weight Changes Only - Script Class

Parameters and execution flow:

  • Main remembers the weight, waits 1000 milliseconds, and calls the fully declared ReportWeight. The assistant prints only if the weight has changed and returns the new weight for the next check. It does not itself create an infinite loop.
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 previous = UO.Weight();
        UO.Wait(1000);
        previous = ReportWeight(previous, UO.Weight());
        return null;
    }

    dynamic ReportWeight(dynamic previous, dynamic current)
    {
        if (Truth(previous != current))
        {
            UO.Msg("Weight changed: " + Convert.ToString(current));
        }

        return current;
    }

    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.Msg(message) — UO.Msg(String)

Parameters: message (String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void Msg(string message) => bridge.ServerPrint(message);

UO.Salute

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

C# signatures

void UO.Salute();

Requests a greeting animation.

Parameters

There are no parameters.

Return value

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

Behavior

  • Salute calls GameActions.EmoteAction("salute") via Invoke. This is a character action, not UO.Say text.
  • 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.Salute");
UO.Salute();

1. Direct call - direct script

Parameters and execution flow:

  • Requests a greeting animation.
UO.Salute();

2. Explicit option - script function

Parameters and execution flow:

  • Salute calls GameActions.EmoteAction("salute") via Invoke. This is a character action, not UO.Say text.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.IsOnline()))
    {
        UO.Salute();
    }

    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.Salute();
        UO.Wait(1000);
        UO.Print("Salute requested");
        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.Salute() — UO.Salute()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "salute": bridge.Salute(); return InjectionValue.Unit;

UO.Say

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

C# signatures

void UO.Say(object? message);

Sends the character's normal speech to the server: for example, an address to a banker or a command to a pet.

Parameters

Return value

A call to a method with a return type void is written as a standalone statement C#; the result cannot be assigned or checked. Completing the statement does not constitute confirmation from the game server.

Behavior

  • For protocol version 2.0.0 and later, the client sends Unicode speech; for the older one - ASCII speech. The name SayU does not force the old protocol to Unicode. Without an explicit color, SpeechHue of the profile is taken; 0xFFFF in UO.UOSayColor also selects this color. The text is sent to the server, but the script does not execute it as code.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

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

1. Contact a banker - direct script

Parameters and execution flow:

  • Connected is checked before sending. bank is one line of speech, not the name API. To open a bank you usually need a suitable NPC nearby; if the server uses a different phrase, replace it.
if (Truth(UO.Connected()))
{
    UO.Say("bank");
}

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

2. Command to a pet selected by name - script function

Parameters and execution flow:

  • petName is the name of your pet, here Shadow. It makes up one line Shadow follow me. This is an order for your pet to follow you, rather than UO.Follow, which moves your character.
return  RunScenario();
 object? RunScenario()
{
    var petName = "Shadow";
    if (Truth(UO.Connected()))
    {
        UO.Say(petName + " follow me");
    }

    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. Ask bank only when overloaded - script class

Parameters and execution flow:

  • RequestBankIfHeavy checks connection and reliable positive maximum weight. Only when overloaded, it sends bank and returns 1 as a sign of a sent request. 0—request not sent. This result belongs to the assistant, not the speech command.
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()
    {
        return RequestBankIfHeavy();
        return null;
    }

    dynamic RequestBankIfHeavy()
    {
        if (!(Truth(UO.Connected())))
        {
            return 0;
        }

        var maximum = UO.MaxWeight();
        if (Truth(maximum <= 0) || Truth(UO.Weight() < maximum))
        {
            return 0;
        }

        UO.Say("bank");
        return 1;
    }

    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.Say(message) — UO.Say(String)

Parameters: message (String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void Say(string message) => bridge.Say(message);

UO.SayU

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

C# signatures

void UO.SayU(object? text);

Sends the character's normal speech to the server: for example, an address to a banker or a command to a pet.

Parameters

Return value

A call to a method with a return type void is written as a standalone statement C#; the result cannot be assigned or checked. Completing the statement does not constitute confirmation from the game server.

Behavior

  • For protocol version 2.0.0 and later, the client sends Unicode speech; for the older one - ASCII speech. The name SayU does not force the old protocol to Unicode. Without an explicit color, SpeechHue of the profile is taken; 0xFFFF in UO.UOSayColor also selects this color. The text is sent to the server, but the script does not execute it as code.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

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

1. Contact a banker - direct script

Parameters and execution flow:

  • Connected is checked before sending. bank is one line of speech, not the name API. To open a bank you usually need a suitable NPC nearby; if the server uses a different phrase, replace it.
if (Truth(UO.Connected()))
{
    UO.SayU("bank");
}

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

2. Command to a pet selected by name - script function

Parameters and execution flow:

  • petName is the name of your pet, here Shadow. It makes up one line Shadow follow me. This is an order for your pet to follow you, rather than UO.Follow, which moves your character.
return  RunScenario();
 object? RunScenario()
{
    var petName = "Shadow";
    if (Truth(UO.Connected()))
    {
        UO.SayU(petName + " follow me");
    }

    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. Ask bank only when overloaded - script class

Parameters and execution flow:

  • RequestBankIfHeavy checks connection and reliable positive maximum weight. Only when overloaded, it sends bank and returns 1 as a sign of a sent request. 0—request not sent. This result belongs to the assistant, not the speech command.
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()
    {
        return RequestBankIfHeavy();
        return null;
    }

    dynamic RequestBankIfHeavy()
    {
        if (!(Truth(UO.Connected())))
        {
            return 0;
        }

        var maximum = UO.MaxWeight();
        if (Truth(maximum <= 0) || Truth(UO.Weight() < maximum))
        {
            return 0;
        }

        UO.SayU("bank");
        return 1;
    }

    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.SayU(text) — UO.SayU(Any)

Parameters: text (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "sayu": Say(arguments.Length > 0 ? arguments[0].ToString() : string.Empty); break;

UO.UOAMessage

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

C# signatures

void UO.UOAMessage(object? text);

Prints a local message in ClassicUO with hue set to UO.FontColor. Suitable for script notifications about inventory, route status or stage completion.

Parameters

Return value

void: Does not return text, log index, or true/false. The call performs local output; There is no display confirmation returned.

Behavior

  • Uses state.FontColor of the current runtime, originally 0x03B2. The recording goes through the lower message area and the client log, as well as the IDE output.
  • Does not send speech to the server, does not cause a pop-up window, does not send a message to another player. The regular UO.Print has its own color.
  • For the color of one message without changing state.FontColor you can use UO.Print(text,color).

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 and has no return value (void). The message text appears directly in the call.

UO.UOAMessage("Hello from C#");

1. Highlight Inventory Alert - Direct Script

Parameters and execution flow:

  • 0x0021 — hue index; The final shade depends on the client's hues files. The message is visible locally; it is not spoken by the character.
UO.FontColor(0x0021);
var first = UO.FindList("0x0EED", "backpack");
if (Truth(first == ""))
{
    UO.UOAMessage("No gold in the loaded backpack");
}
else
{
    UO.UOAMessage("Gold units: " + Convert.ToString(UO.FindFullQuantity()));
}

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

2. General Color Notification Procedure - Script Function

Parameters and execution flow:

  • Full Notice accepts text and hue. The last set hue remains for the next UOAMessage of this runtime. There is no built-in FontColor() for reading here.
return  RunScenario();
 object? RunScenario()
{
    Notice("Supplies checked", 0x0044);
    Notice("Restock needed", 0x0021);
    return null;
}

void Notice(dynamic text, dynamic hue)
{
    UO.FontColor(hue);
    UO.UOAMessage(text);
}

3. Revert to Known Base Color - Script Class

Parameters and execution flow:

  • 0x03B2 — initial value FontColor of the new runtime. Finally returns exactly the selected base on normal completion/error handling; it does not restore the unknown previous value.
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 baseHue = 0x03B2;
        try
        {
            UO.FontColor(0x0021);
            UO.UOAMessage("Check the route before moving");
        }
        finally
        {
            UO.FontColor(baseHue);
        }

        UO.UOAMessage("Ready");
        UO.Print("Regular Print keeps its own color");
        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.UOAMessage(text) — UO.UOAMessage(Any)

Parameters: text (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "uoamessage": bridge.Print(state.FontColor, Text(0)); break;

UO.UOSay

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

C# signatures

void UO.UOSay(object? text);

Sends the character's normal speech to the server: for example, an address to a banker or a command to a pet.

Parameters

Return value

A call to a method with a return type void is written as a standalone statement C#; the result cannot be assigned or checked. Completing the statement does not constitute confirmation from the game server.

Behavior

  • For protocol version 2.0.0 and later, the client sends Unicode speech; for the older one - ASCII speech. The name SayU does not force the old protocol to Unicode. Without an explicit color, SpeechHue of the profile is taken; 0xFFFF in UO.UOSayColor also selects this color. The text is sent to the server, but the script does not execute it as code.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

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

1. Contact a banker - direct script

Parameters and execution flow:

  • Connected is checked before sending. bank is one line of speech, not the name API. To open a bank you usually need a suitable NPC nearby; if the server uses a different phrase, replace it.
if (Truth(UO.Connected()))
{
    UO.UOSay("bank");
}

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

2. Command to a pet selected by name - script function

Parameters and execution flow:

  • petName is the name of your pet, here Shadow. It makes up one line Shadow follow me. This is an order for your pet to follow you, rather than UO.Follow, which moves your character.
return  RunScenario();
 object? RunScenario()
{
    var petName = "Shadow";
    if (Truth(UO.Connected()))
    {
        UO.UOSay(petName + " follow me");
    }

    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. Ask bank only when overloaded - script class

Parameters and execution flow:

  • RequestBankIfHeavy checks connection and reliable positive maximum weight. Only when overloaded, it sends bank and returns 1 as a sign of a sent request. 0—request not sent. This result belongs to the assistant, not the speech command.
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()
    {
        return RequestBankIfHeavy();
        return null;
    }

    dynamic RequestBankIfHeavy()
    {
        if (!(Truth(UO.Connected())))
        {
            return 0;
        }

        var maximum = UO.MaxWeight();
        if (Truth(maximum <= 0) || Truth(UO.Weight() < maximum))
        {
            return 0;
        }

        UO.UOSay("bank");
        return 1;
    }

    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.UOSay(text) — UO.UOSay(Any)

Parameters: text (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "uosay": Say(Text(0)); return InjectionValue.Unit;

UO.UOSayColor

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

C# signatures

void UO.UOSayColor(object? text, object? color);

Sends the character's normal speech to the server: for example, an address to a banker or a command to a pet.

Parameters

  • color is UO hue, not RGB. Number or hex string; the bridge uses the low 16 bits. Not to be confused with graphic/type. 0x0044 in the example is the selected hue. For protocol version 2.0.0 and later, the client sends Unicode speech; for the older one - ASCII speech. The name SayU does not force the old protocol to Unicode. Without an obvious color, SpeechHue of the profile is taken; 0xFFFF in UO.UOSayColor also selects this color. The text is sent to the server, but the script does not execute it as code.

Return value

A call to a method with a return type void is written as a standalone statement C#; the result cannot be assigned or checked. Completing the statement does not constitute confirmation from the game server.

Behavior

  • For protocol version 2.0.0 and later, the client sends Unicode speech; for the older one - ASCII speech. The name SayU does not force the old protocol to Unicode. Without an explicit color, SpeechHue of the profile is taken; 0xFFFF in UO.UOSayColor also selects this color. The text is sent to the server, but the script does not execute it as code.
  • UO.Print · UO.CharPrint · UO.Say · UO.ConColor

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.UOSayColor");
UO.UOSayColor("bank", 0x0044);

1. Contact a banker - direct script

Parameters and execution flow:

  • Connected is checked before sending. bank is one line of speech, not the name API. To open a bank you usually need a suitable NPC nearby; if the server uses a different phrase, replace it.
if (Truth(UO.Connected()))
{
    UO.UOSayColor("bank", 0x0044);
}

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

2. Command to a pet selected by name - script function

Parameters and execution flow:

  • petName is the name of your pet, here Shadow. It makes up one line Shadow follow me. This is an order for your pet to follow you, rather than UO.Follow, which moves your character.
return  RunScenario();
 object? RunScenario()
{
    var petName = "Shadow";
    if (Truth(UO.Connected()))
    {
        UO.UOSayColor(petName + " follow me", 0x0044);
    }

    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. Ask bank only when overloaded - script class

Parameters and execution flow:

  • RequestBankIfHeavy checks connection and reliable positive maximum weight. Only when overloaded, it sends bank and returns 1 as a sign of a sent request. 0—request not sent. This result belongs to the assistant, not the speech command.
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()
    {
        return RequestBankIfHeavy();
        return null;
    }

    dynamic RequestBankIfHeavy()
    {
        if (!(Truth(UO.Connected())))
        {
            return 0;
        }

        var maximum = UO.MaxWeight();
        if (Truth(maximum <= 0) || Truth(UO.Weight() < maximum))
        {
            return 0;
        }

        UO.UOSayColor("bank", 0x0044);
        return 1;
    }

    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.UOSayColor(text, color) — UO.UOSayColor(Any,Any)

Parameters: text (Any), color (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

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

Clone this wiki locally