EN UO Topic diagnostics introspection - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Home · C# · IDE · UO API · A–Z · Examples · Languages
Inspection of objects, tiles and gumps, checking names, parameters and signatures API. The presence of a signature does not confirm the possibility of a game action in the current state.
| Topic | Commands and explanations |
|---|---|
| Help | UO.Help |
| Dump | UO.Dump |
| Info | UO.Info |
| InfoTile | UO.InfoTile |
| InfoGump | UO.InfoGump |
| API Name Exists | UO.ApiNameExists |
| API Signature Exists | UO.ApiSignatureExists |
| API Parameter Exists | UO.ApiParameterExists |
| Version | UO.Version |
UO.Help · UO.Dump · UO.Info · UO.InfoColor · UO.GetInfo · UO.ExtendedInfo · UO.InfoTile · UO.InfoGump · UO.InfoGumps · UO.ApiNameExists · UO.ApiParameterExists · UO.ApiSignatureExists · UO.Version · UO.ClientInfo
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.
Parameters, result and all scenarios
UO.InfoGump();Parameters, result and all scenarios
return UO.ApiNameExists("UO.GetType");Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
int UO.ApiNameExists(object? name);Checks the registration of the name of the native function being called.
-
name— Required string: exact registered name, not a calling expression. Case and edge spaces are not important; UO. is not added automatically. An empty or unknown name gives 0. User procedures are not taken into account.
int: 1 means the name is registered; 0 means it is not. In C#, use result != 0 or result == 0. Comparing int with true or false is invalid. Registration does not confirm a server action.
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.
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.ApiNameExists("UO.GetType");
UO.Print("ApiNameExists: " + Convert.ToString(result));Parameters and execution flow:
- The first example tests the game name with an explicit UO. and returns 1. The exact name being tested and the number of arguments when it is required are visible in the call.
return UO.ApiNameExists("UO.GetType");This checks native name registration only. Convert.ToInt32 is a .NET method, not a UO API entry, so ApiNameExists returns 0. The method remains available in normal C#.
return RunScenario();
object? RunScenario()
{
var name = "Convert.ToInt32";
return UO.ApiNameExists(name);
return null;
}Each numeric result is compared with 0; && then combines two bool values. For these names, the result is false.
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 HasBoth("GetType", "UO.GetType");
return null;
}
dynamic HasBoth(dynamic first, dynamic second)
{
return UO.ApiNameExists(first) != 0 && UO.ApiNameExists(second) != 0;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: name (String)
Result: int / Integer.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ApiNameExists. -
InjectionScript.Runtime.InjectionApiUO.NormalizeApiName:NormalizeApiName(name).
Internal implementation code; this is not a standalone script.
public int ApiNameExists(string name)
{
string normalized = NormalizeApiName(name);
return metadata.NativeSubrutines.Any(definition =>
definition.Name.Equals(normalized, StringComparison.OrdinalIgnoreCase)) ? 1 : 0;
}Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
int UO.ApiParameterExists(object? name);Checks whether a runtime value or named object is registered.
-
name— Required string: exact registered name, not a calling expression. Case and edge spaces are not important; UO. is not added automatically. An empty or unknown name gives 0. User procedures are not taken into account.
int: 1 means the name is registered; 0 means it is not. In C#, use result != 0 or result == 0. Comparing int with true or false is invalid. Registration does not confirm a server action.
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.
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.ApiParameterExists("backpack");
UO.Print("ApiParameterExists: " + Convert.ToString(result));Parameters and execution flow:
- The first example tests the game name with an explicit UO. and returns 1. The exact name being tested and the number of arguments when it is required are visible in the call.
return UO.ApiParameterExists("UO.GetHP");The registered backpack selector is checked and returns 1. This does not inspect C# method parameters or prove that a backpack exists in the game world.
return RunScenario();
object? RunScenario()
{
var name = "backpack";
return UO.ApiParameterExists(name);
return null;
}Parameters and execution flow:
- The third example contains a complete helper function. It compares the removed short form or unsupported arity with the available form. The parameters name, first, second and count pass names/counts unchanged. The result is 0 for call checks and 0:1 for value checks.
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 CompareNames("GetHP", "UO.GetHP");
return null;
}
dynamic CompareNames(dynamic first, dynamic second)
{
return Convert.ToString(UO.ApiParameterExists(first)) + ":" + Convert.ToString(UO.ApiParameterExists(second));
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: name (String)
Result: int / Integer.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ApiParameterExists. -
InjectionScript.Runtime.Metadata.IntrinsicVariableExists:metadata.IntrinsicVariableExists(value).
Internal implementation code; this is not a standalone script.
public int ApiParameterExists(string name)
{
string value = (name ?? string.Empty).Trim();
if (value.Length == 0)
return 0;
if (Metadata.ShortcutVariables.Any(item => item.Equals(value, StringComparison.OrdinalIgnoreCase)))
return 1;
return metadata.IntrinsicVariableExists(value) ? 1 : 0;
}Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
int UO.ApiSignatureExists(object? name, object? argumentCount);Tests the registration of a name with the given number of arguments.
-
name— Required string: exact registered name, not a calling expression. Case and edge spaces are not important; UO. is not added automatically. An empty or unknown name gives 0. User procedures are not taken into account. -
argumentCount— Required int: the total number of positional arguments, including optional ones explicitly passed. A negative or unsupported quantity gives 0. The types of the arguments themselves are not checked.
int: 1 means the name is registered; 0 means it is not. In C#, use result != 0 or result == 0. Comparing int with true or false is invalid. Registration does not confirm a server action.
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.
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.ApiSignatureExists("UO.GetType", 1);
UO.Print("ApiSignatureExists: " + Convert.ToString(result));Parameters and execution flow:
- The first example tests the game name with an explicit UO. and returns 1. The exact name being tested and the number of arguments when it is required are visible in the call.
return UO.ApiSignatureExists("UO.GetType",1);The one-argument and zero-argument forms of UO.FindType are checked. The result is the string "1:0"; the zero-argument form is not registered.
return RunScenario();
object? RunScenario()
{
return Convert.ToString(UO.ApiSignatureExists("UO.FindType", 1)) + ":" + Convert.ToString(UO.ApiSignatureExists("UO.FindType", 0));
return null;
}Parameters and execution flow:
- The third example contains a complete helper function. It compares the removed short form or unsupported arity with the available form. The parameters name, first, second and count pass names/counts unchanged. The result is 0 for call checks and 0:1 for value checks.
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 CheckForm("UO.GetType", 0);
return null;
}
dynamic CheckForm(dynamic name, dynamic count)
{
return UO.ApiSignatureExists(name, count);
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: name (String), argumentCount (Integer)
Result: int / Integer.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ApiSignatureExists. -
InjectionScript.Runtime.Metadata.NativeSubrutineExists:metadata.NativeSubrutineExists(NormalizeApiName(name), argumentCount). -
InjectionScript.Runtime.InjectionApiUO.NormalizeApiName:NormalizeApiName(name).
Internal implementation code; this is not a standalone script.
public int ApiSignatureExists(string name, int argumentCount)
=> metadata.NativeSubrutineExists(NormalizeApiName(name), argumentCount) ? 1 : 0;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.ClientInfo();Reads brief information about the running client.
There are no parameters.
Array of three strings: [0] - product name, [1] - version of the running client, [2] - client directory. The indices start with 0. This is not the string JSON, nor is it a dictionary.
- Data is read from RuntimeProductName, RuntimeProductVersion and ClientPath. The command does not change anything and does not send anything to the server.
- Use ArrayLength before indexing in a general helper function. Don't confuse client information with character stats or server version.
- Reads information about the current ClassicUO client.
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.
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.ClientInfo();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));Parameters and execution flow:
- 0 - product, 1 - version, 2 - catalog. The version value is taken at startup; in the example it is not fixed.
var info = UO.ClientInfo();
UO.Print("Product: " + info[0]);
UO.Print("Client version: " + info[1]);
UO.Print("Client folder: " + info[2]);Parameters and execution flow:
- ArrayLength returns the number of fields. The last valid index is equal to the length minus 1.
return RunScenario();
object? RunScenario()
{
var info = UO.ClientInfo();
var i = 0;
while (Truth(i < ArrayLength(info)))
{
UO.Print(Convert.ToString(i) + ": " + info[i]);
i = i + 1;
}
return null;
}
int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- ClientCaption returns a string of title and version. The original array is not changed.
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.Print(ClientCaption());
return null;
}
dynamic ClientCaption()
{
var info = UO.ClientInfo();
if (Truth(ArrayLength(info) < 2))
{
return "Client information unavailable";
}
return info[0] + " / " + info[1];
}
int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: dynamic / Array.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RuntimeProductName:bridge.RuntimeProductName. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RuntimeProductVersion:bridge.RuntimeProductVersion. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ClientPath:bridge.ClientPath.
Internal implementation code; this is not a standalone script.
case "clientinfo":
return new InjectionValue(new[]
{
new InjectionValue(bridge.RuntimeProductName),
new InjectionValue(bridge.RuntimeProductVersion),
new InjectionValue(bridge.ClientPath)
});Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.Dump();
void UO.Dump(object? @object);Prints a diagnostic snapshot of an object known to the client.
-
object— Optional serial/link. Without an argument, bridge.LastTarget is used.
void - no return value.
- The message contains serial as 0xXXXXXXXX, name, graphic/type, hue and X/Y/Z. The fields are read from the local model; a missing object gives an empty name and null fields. The command does not request the latest server properties.
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.
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.Dump");
UO.Dump();Parameters and execution flow:
- A missing argument means LastTarget.
UO.Dump();Parameters and execution flow:
- All fields are specific to your own character.
return RunScenario();
object? RunScenario()
{
UO.Dump("self");
return null;
}Parameters and execution flow:
- The Exists check separates a missing model from an object with null fields.
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 id = UO.LastTarget();
if (Truth(UO.Exists(id)))
{
UO.Dump(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;
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Arg:Arg(0, bridge.LastTarget). -
InjectionScript.Runtime.InjectionApiUO.SystemMessage:SystemMessage($"0x{id:X8} {bridge.GetName(id)} type=0x{bridge.GetGraphics(id):X4} hue=0x{bridge.GetColor(id):X4} xyz={bridge.GetX(id)},{bridge.GetY(id)},{bridge.GetZ(id)}"). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetName:bridge.GetName(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetGraphics:bridge.GetGraphics(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetColor:bridge.GetColor(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetX:bridge.GetX(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetY:bridge.GetY(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetZ:bridge.GetZ(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget:bridge.LastTarget.
Internal implementation code; this is not a standalone script.
case "dump":
{
int id = Arg(0, bridge.LastTarget);
SystemMessage($"0x{id:X8} {bridge.GetName(id)} type=0x{bridge.GetGraphics(id):X4} hue=0x{bridge.GetColor(id):X4} xyz={bridge.GetX(id)},{bridge.GetY(id)},{bridge.GetZ(id)}");
break;
}Parameters: object (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Arg:Arg(0, bridge.LastTarget). -
InjectionScript.Runtime.InjectionApiUO.SystemMessage:SystemMessage($"0x{id:X8} {bridge.GetName(id)} type=0x{bridge.GetGraphics(id):X4} hue=0x{bridge.GetColor(id):X4} xyz={bridge.GetX(id)},{bridge.GetY(id)},{bridge.GetZ(id)}"). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetName:bridge.GetName(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetGraphics:bridge.GetGraphics(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetColor:bridge.GetColor(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetX:bridge.GetX(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetY:bridge.GetY(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetZ:bridge.GetZ(id). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget:bridge.LastTarget.
Internal implementation code; this is not a standalone script.
case "dump":
{
int id = Arg(0, bridge.LastTarget);
SystemMessage($"0x{id:X8} {bridge.GetName(id)} type=0x{bridge.GetGraphics(id):X4} hue=0x{bridge.GetColor(id):X4} xyz={bridge.GetX(id)},{bridge.GetY(id)},{bridge.GetZ(id)}");
break;
}Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.ExtendedInfo();Returns four fields of the current client connection configuration.
There are no parameters.
Array [ClientPath:string, CurrentProfilePath:string, GameServerAddress:string, GameServerPort:int].
- The order of the fields is fixed. ClientPath and CurrentProfilePath are client paths. GameServerAddress and GameServerPort read global Settings.GlobalSettings.IP/Port: This is the configured address, not checking the actual peer manager session. The list does not contain a password and does not prompt the server for information. Blank values are possible before selecting a profile/connection.
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.
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.ExtendedInfo();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));Parameters and execution flow:
- The array contains mixed types, so Convert.ToString is used.
var info = UO.ExtendedInfo();
for (int i = (int)(0); i <= ArrayLength(info)-1; i += (int)(1))
{
UO.Print(Convert.ToString(info[i]));
}
int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;Parameters and execution flow:
- The indices 2 and 3 are the address and port.
return RunScenario();
object? RunScenario()
{
var info = UO.ExtendedInfo();
UO.Print(Convert.ToString(info[2]) + ":" + Convert.ToString(info[3]));
return null;
}Parameters and execution flow:
- Index 1 — CurrentProfilePath, not ClientPath.
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 info = UO.ExtendedInfo();
var path = info[1];
UO.Print(path);
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: dynamic / Any.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ClientPath:bridge.ClientPath. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CurrentProfilePath:bridge.CurrentProfilePath. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GameServerAddress:bridge.GameServerAddress. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GameServerPort:bridge.GameServerPort.
Internal implementation code; this is not a standalone script.
case "extendedinfo":
return new InjectionValue(new[] { new InjectionValue(bridge.ClientPath), new InjectionValue(bridge.CurrentProfilePath), new InjectionValue(bridge.GameServerAddress), new InjectionValue(bridge.GameServerPort) });Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
string UO.GetInfo(object? arg);Returns the character name only for the exact character selector.
-
arg— string. The exact case-sensitive value of character calls GetName("self"); any other value is not recognized.
string — name of your character for character; string literal UNKNOWN for all other arguments. If there is no character, the name may be empty.
- The comparison StringComparison.Ordinal is case sensitive. Only the character selector is supported. The command does not make network requests: it reads the name from the local character model. Window FillInfoWindow is controlled separately.
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.
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.GetInfo("character");
UO.Print("GetInfo: " + Convert.ToString(result));Parameters and execution flow:
- The exact character literal reads self.
var name = UO.GetInfo("character");
UO.Print(name);Parameters and execution flow:
- Character does not match and returns UNKNOWN.
return RunScenario();
object? RunScenario()
{
var value = UO.GetInfo("Character");
UO.Print(value);
return null;
}Parameters and execution flow:
- profile is not supported by this implementation.
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 value = UO.GetInfo("profile");
UO.Print(value);
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: arg (String)
Result: string / String.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.GetInfo. -
InjectionScript.Runtime.InjectionApiUO.GetName:GetName("self").
Internal implementation code; this is not a standalone script.
private string GetInfo(string arg)
{
if (arg.Equals("character", StringComparison.Ordinal))
return GetName("self");
return "UNKNOWN";
}Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.Help();There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- Modifies or displays only the specified local data. This command does not have server confirmation.
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.
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.Help");
UO.Help();Parameters and execution flow:
- Shows local hint about C# IDE.
UO.Help();Parameters and execution flow:
- ExecuteLegacyManualAlias displays a line about UO.*, the configured chat prefix and Options > C# IDE > Manual via SystemMessage. A help request is not sent to the server.
return RunScenario();
object? RunScenario()
{
UO.Help();
UO.OpenIDE();
return null;
}Parameters and execution flow:
- Modifies or displays only the specified local data. This command does not have server 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()
{
UO.Help();
UO.Print("Options > C# IDE > Manual");
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
InjectionScript.Runtime.InjectionApiUO.SystemMessage:SystemMessage("C# Scripts IDE: use UO.* in scripts or the configured chat prefix. Open Options > C# Scripts IDE > Manual.").
Internal implementation code; this is not a standalone script.
case "help": SystemMessage("C# Scripts IDE: use UO.* in scripts or the configured chat prefix. Open Options > C# Scripts IDE > Manual."); break;string UO.Info();
string UO.Info(object? serial);
string UO.Info(object? type, object? x, object? y);
string UO.Info(object? type, object? x, object? y, object? z);Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.
Parameterless Info and InfoTile arm a target in graphical chat. In a script, Info() reads the last object target or the player; InfoTile() reads the land under the player. Explicit serial, type and coordinates query the chosen object or tile. The third argument of InfoTile(x,y,map) is a map number.
-
serial— Object serial number or a saved alias. -
type— Item graphic ID; -1 matches any type at the specified position. -
x— World X coordinate. -
y— World Y coordinate. -
z— Z elevation; the shorter overload uses 0.
Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.
#info
#UO.Info id 0x40001234
#info type 0x0EED
#info xy 1450 1690
#info type 0x0EED xy 1450 1690 0
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
string report = UO.Info(0x40001234);
UO.Print(report);string InspectSelf() => UO.Info("self");
UO.Print(InspectSelf());foreach (int serial in new[] { 0x40001234, 0x40005678 })
{
string report = UO.Info(serial);
UO.Print(report);
}new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
string report = api.Info(0x40001234);
api.Print(report);
}
}CSharpGameApi.Info
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.Info
ClassicUOInjectionApiBridge -> YokoInfoReport -> YokoInfoGump
string UO.InfoColor();
string UO.InfoColor(object? serial);Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.
Parameterless Info and InfoTile arm a target in graphical chat. In a script, Info() reads the last object target or the player; InfoTile() reads the land under the player. Explicit serial, type and coordinates query the chosen object or tile. The third argument of InfoTile(x,y,map) is a map number.
-
serial— Object serial number or a saved alias.
Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.
#infocolor 0x40001234
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
UO.Print(UO.InfoColor(0x40001234));string report = UO.InfoColor();
UO.Print(report);foreach (int serial in new[] { 0x40001234, 0x40005678 })
UO.Print(UO.InfoColor(serial));new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
api.Print(api.InfoColor(0x40001234));
}
}CSharpGameApi.InfoColor
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.InfoColor
ClassicUOInjectionApiBridge -> YokoInfoReport -> YokoInfoGump
string UO.InfoGump();
string UO.InfoGump(object? gump);Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.
InfoGump() reads the latest active server dialog or local client window. Supply an ID or index to choose one; last, LastGump and Last Gump mean the latest window. InfoGumps returns the list. Inspector windows are excluded. Only graphical commands open an inspector table.
-
gump— Server gump ID or index; -1 selects the last active one.
Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.
#infogump
#infogump last
#info gump last gump
#infogump 0x12345678
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
string report = UO.InfoGump();
UO.Print(report);UO.Print(UO.InfoGump(0x12345678));string ReadLatestWindow() => UO.InfoGump();
UO.Print(ReadLatestWindow());new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
string report = api.InfoGump();
api.Print(report);
}
}CSharpGameApi.InfoGump
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.InfoGump
ClassicUOInjectionApiBridge -> YokoInfoReport -> YokoInfoGump
string UO.InfoGumps();
string UO.InfoGumps(object? gump);Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.
InfoGump() reads the latest active server dialog or local client window. Supply an ID or index to choose one; last, LastGump and Last Gump mean the latest window. InfoGumps returns the list. Inspector windows are excluded. Only graphical commands open an inspector table.
-
gump— Server gump ID or index; -1 selects the last active one.
Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.
#infogumps
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
UO.Print(UO.InfoGumps());string report = UO.InfoGumps(0x12345678);
UO.Print(report);string ReadAllWindows() => UO.InfoGumps();
UO.Print(ReadAllWindows());new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
api.Print(api.InfoGumps());
}
}CSharpGameApi.InfoGumps
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.InfoGumps
ClassicUOInjectionApiBridge -> YokoInfoReport -> YokoInfoGump
string UO.InfoTile();
string UO.InfoTile(object? x);
string UO.InfoTile(object? x, object? y);
string UO.InfoTile(object? x, object? y, object? map);
string UO.InfoTile(object? type, object? x, object? y, object? z);
string UO.InfoTile(object? type, object? x, object? y, object? z, object? map);Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.
Parameterless Info and InfoTile arm a target in graphical chat. In a script, Info() reads the last object target or the player; InfoTile() reads the land under the player. Explicit serial, type and coordinates query the chosen object or tile. The third argument of InfoTile(x,y,map) is a map number.
-
map— Map number; omitted means the current map. -
type— Item graphic ID; -1 matches any type at the specified position. -
x— World X coordinate. -
y— World Y coordinate. -
z— Z elevation; the shorter overload uses 0.
Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.
#infotile
#info tile xy 1450 1690
#infotile 1450 1690 0
#infotile type 0x0EED 1450 1690 0 0
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
UO.Print(UO.InfoTile(1450, 1690));string report = UO.InfoTile(1450, 1690, 0);
UO.Print(report);UO.Print(UO.InfoTile(0x0EED, 1450, 1690, 0, 0));new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
api.Print(api.InfoTile(1450, 1690));
}
}CSharpGameApi.InfoTile
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.InfoTile
ClassicUOInjectionApiBridge -> YokoInfoReport -> YokoInfoGump
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.Version();Prints the name and runtime version of the product.
There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- ExecuteLegacyManualAlias outputs bridge.RuntimeProductName and bridge.RuntimeProductVersion via SystemMessage. This is a log string, not the version number returned.
- Modifies or displays only the specified local data. This command does not have server confirmation.
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.
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.Version");
UO.Version();Parameters and execution flow:
- Prints the name and runtime version of the product.
UO.Version();Parameters and execution flow:
- ExecuteLegacyManualAlias outputs bridge.RuntimeProductName and bridge.RuntimeProductVersion via SystemMessage. This is a log string, not the version number returned.
return RunScenario();
object? RunScenario()
{
UO.Version();
UO.Help();
return null;
}Parameters and execution flow:
- Modifies or displays only the specified local data. This command does not have server 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()
{
UO.Version();
UO.Print(UO.GetUserCodepage());
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
InjectionScript.Runtime.InjectionApiUO.SystemMessage:SystemMessage($"{bridge.RuntimeProductName} v{bridge.RuntimeProductVersion}"). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RuntimeProductName:bridge.RuntimeProductName. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RuntimeProductVersion:bridge.RuntimeProductVersion.
Internal implementation code; this is not a standalone script.
case "version": SystemMessage($"{bridge.RuntimeProductName} v{bridge.RuntimeProductVersion}"); break;