Skip to content

EN Examples and Recipes

Codex edited this page Oct 11, 2026 · 1 revision

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

Examples of C#-scripts

All examples are saved as .csx. They use game data from the current session.

Local message

UO.Print("Hello from C#!");
await WaitAsync(100);

Several coordinate checks

for (int i = 0; i < 3; i++)
{
    UO.Print($"Position: {UO.GetX()}, {UO.GetY()}, {UO.GetZ()}");
    await WaitAsync(500);
}

Collections and calculations

var values = new List<int> { 2, 3, 4 };
int total = values.Sum();
UO.Print($"Total = {total}");

Launch arguments

string message = Args.Length > 0 ? Args[0] : "No arguments";
UO.Print(message);

Syntax, async, UO calls and argument splitting are checked by the automatic C#-probe. The real server response is checked separately.

Clone this wiki locally