Skip to content

EN UO Topic items

Codex edited this page Oct 12, 2026 · 4 revisions

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

Items

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

Properties, use and transfer of objects. Serial selects a specific item; type/graphic selects the view. The transfer of stack units and the number of items transferred have different parameters.

Sections

Topic Commands and explanations
Item Properties UO.GetSerial · UO.GetType · UO.GetGraphic · UO.GetColor · UO.GetQuantity · UO.GetName · UO.GetTooltip · UO.ContainerOf · UO.GetParent · UO.GetLayer · UO.IsMovable · UO.GetX · UO.GetY · UO.GetZ
Finding Items UO.FindType · UO.FindTypeEx · UO.FindTypesArrayEx · UO.FindItem · UO.FindAnyType · UO.FindAtCoord · UO.FindList · UO.FindDistance · UO.FindVertical
Using Items UO.UseObject · UO.UseType · UO.UseFromGround · UO.UseWorldObject · UO.UseItemOnMobile
Moving Items UO.Grab · UO.Drag · UO.Drop · UO.MoveItem · UO.MoveItems · UO.MassMove · UO.EmptyContainer
Ground Items UO.GetWorldItems · UO.FindType · UO.CountGround · UO.MoveItem
Container Items UO.GetContent · UO.FindTypeEx · UO.OpenContainer
Fake / Client Items UO.MakeFakeItem · UO.DeleteObject
Dye UO.Dye

All theme commands

Item Properties

UO.Exists · UO.IsObjectExists · UO.GetSerial · UO.GetType · UO.GetGraphic · UO.GetColor · UO.GetQuantity · UO.Name · UO.GetName · UO.GetAltName · UO.GetTooltip · UO.GetTooltipRec · UO.GetLayer · UO.GetLocked · UO.IsMovable · UO.GetFlags · UO.ReceiveObjectName · UO.UpdateObject

Using Items

UO.UseObject · UO.UseType · UO.UseFromGround · UO.UseWorldObject · UO.UseItemOnMobile · UO.ClickOnObject · UO.TicksUse

Moving Items

UO.Grab · UO.Drag · UO.DragItem · UO.Drop · UO.DropHere · UO.DropItem · UO.MoveItem · UO.MoveItems · UO.MassMove · UO.EmptyContainer · UO.DropDelay · UO.DropCheckCoord · UO.Picking

Fake / Client Items

UO.MakeFakeItem · UO.DeleteObject

Dye

UO.Dye

Stored Objects

UO.AddObject · UO.AddType · UO.EasyObject · UO.UserObject · UO.LastObject · UO.Forget

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

Parameters, result and all scenarios

var ok = UO.MoveItem("loot");
UO.Print("Move request: " + Convert.ToString(ok));

UO.MassMove

Parameters, result and all scenarios

UO.MassMove(350, 0);
UO.Print("Drag one sample item to the destination container");

Reference parts

1 · 2

Complete command reference


UO.AddObject

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

C# signatures

void UO.AddObject(object? name);
void UO.AddObject(object? name, object? objectRawId);

Stores a named serial object for later use by scripts. The two-argument form specifies the object immediately; one-argument triggers the selection of an object by the cursor.

Parameters

  • name is a non-empty name by which the object will be available at runtime.
  • objectRawId — serial or already saved object name. The one-argument overload does not accept this parameter, but instead requests the selection of an object.

Return value

void. Check the saved binding by reading the object by name; the call does not return serial.

Behavior

  • Given two arguments, runtime resolves objectRawId and stores serial under name. With one argument, the client requests the selection of an object: the item or mobile is selected, but not the map cell. Before selecting, the previous binding with the same name is deleted; canceling/losing the cursor does not restore it.

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

1. Save the serial of a known item under a convenient name. - direct script

Parameters and execution flow:

  • Save the serial of a known item under a convenient name.
UO.AddObject("supplyBox", "0x40012345");

2. Request the selection of an item or mobile with the cursor and name it target. - script function

Parameters and execution flow:

  • Request the selection of an item or mobile with the cursor and name it target.
return  RunScenario();
 object? RunScenario()
{
    UO.AddObject("target");
    return null;
}

3. Saving the name again replaces the binding with a new serial. - script class

Parameters and execution flow:

  • Saving the name again replaces the binding with a new serial.
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 selectedSerial = "0x40012345";
        UO.AddObject("supplyBox", selectedSerial);
        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.AddObject(name) — UO.AddObject(String)

Parameters: name (String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void AddObject(string name)

        {

            SystemMessage($"What is {name}");

            bridge.AddObject(name);

        }

UO.AddObject(name, objectRawId) — UO.AddObject(Any,Any)

Parameters: name (Any), objectRawId (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void AddObject(InjectionValue name, InjectionValue objectRawId) 

            => ObjectChecked(objectRawId, id => AddObject((string)name, id));

UO.AddType

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

C# signatures

void UO.AddType(object? name);
void UO.AddType(object? name, object? @type);

Stores a friendly name for the item or body graphic type mobile. For example, after UO.AddType("bandage", 0x0E21) you can search for or use bandages through the name "bandage" without repeating the numeric type on each line. This is setting up a name → Graphic mapping, not creating an item or remembering one specific ID.

Parameters

  • name - Required string in quotes - your type name. Edge spaces are removed, case is not important: "Bandage" and "bandage" are one entry. Empty string, numeric name, word any, character | and control characters are prohibited. This is the parameter value, not a new variable or UO command: subsequent calls also require quotes.
  • type - Optional int 0..65535: Graphic/type, such as 0x0E21 or 3617. A string with a decimal/hexadecimal number or the name of an already saved type is acceptable; the latter copies its current number, does not create a connection between names. ID of the form 0x40001001, negative number, fraction and unknown name are not accepted. If there is no argument, a selection cursor appears: click on the loaded item, including inside the container, or mobile. The Graphic of the selected object is saved; ground surface and static tile are not suitable.

Return value

void - no return value. Write on a separate line, without var result = and without comparison with true/1. The command does not return the selected type, serial, or success flag. When canceling with the mouse, the old entry is retained; if there was no name before, it remains undefined. The next line of script runs after a normal cancel, so don't automatically trigger the action assuming the user has definitely selected a new item.

Behavior

  • The form AddType(name, type) stores the number immediately, without a cursor and without a network action. A repeat with the same name replaces its type. An erroneous value does not destroy the previous entry. The form AddType(name) is waiting for selection; Esc, replacing the cursor with another action, or an inappropriate target leaves the entry unchanged. Forcibly stopping the script interrupts the wait and frees only the cursor that belongs to it.
  • Type names are kept separate from AddObject: the same word can denote type in FindType and serial in UseObject. AddType("supply", 0x0E21) does not by itself make UseObject("supply") valid. For a specific item, use AddObject/GetSerial; for a family of items - AddType and the type parameter.
  • Names are resolved in the type parameters FindType (all forms), FindTypeEx, FindTypesArrayEx, FindList, FindNotoriety, GetWorldItems, UseType, UseFromGround, Count, CountGround, CountEx, EquipT, WaitTargetType, WaitTargetGround and WaitTargetObjectType. In masks of types GetMobiles/FindAnyType/WaitTarget you can combine names via | or array; the rules of notoriety remain separate. The words human/near and other FindMobile filters are not overridden.
  • Only Graphic is saved, no color, quantity, container, item name, layer or properties. Two items of the same type of different colors require a separate color in the search. The entry does not confirm that the item currently exists, is available, or that the server will allow the action.

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

1. Raise one found stack of gold - direct script

Parameters and execution flow:

  • gold_stack - name; 0x0EED – Graphic gold. FindType: -1 - any color, ground - earth, 2 - search radius. The string serial or an empty string is returned.
  • MoveItem receives the found serial, 0 for the entire stack and backpack as the destination. This is one stack, not all the stacks in the radius. Transfer availability and actual results depend on the server; the type definition itself does not carry anything.
UO.AddType("gold_stack", 0x0EED);
var item = UO.FindType("gold_stack", -1, "ground", 2);
if (Truth(item == ""))
{
    UO.Print("No loaded gold stack within 2 tiles");
    return null;
}
var moved = UO.MoveItem(item, 0, "backpack");
if (Truth(moved == 0))
{
    UO.Print("Move request failed");
}

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

2. Use bandage only when low on health - script function

Parameters and execution flow:

  • The string number 0x0E21 is stored as an int Graphic. Life/MaxHP compares the character's HP. FindType searches for any color recursively in the knapsack; -1 in distance uses standard search behavior.
  • self is the purpose of application, bandage after FindType is a variable with serial. The target's queue is prepared before using the item. The script sends the usage and does not assert that the treatment has already completed; The timer/treatment rules depend on the server.
return  RunScenario();
 object? RunScenario()
{
    UO.AddType("bandage", "0x0E21");
    if (Truth(UO.Life() >= UO.MaxHP()))
    {
        return null;
    }

    var bandage = UO.FindType("bandage", -1, "backpack", -1, true);
    if (Truth(bandage == ""))
    {
        UO.Print("No loaded bandages in backpack");
        return null;
    }

    UO.WaitTargetObject("self");
    UO.UseObject(bandage);
    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. Assign your tool to the mouse, apply it as a separate procedure - script class

Parameters and execution flow:

  • Main contains only name, so the cursor opens. The tool type is saved, not its ID and not its color. UseSavedTool is a normal standalone procedure C#, not a built-in command.
  • UseType searches for an instance of a saved type of any color in the backpack and uses it; returns int serial or 0 if absent. If the name was never defined, it is an argument error, not the result of 0. After unassignment, Main does not call UseSavedTool.
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.AddType("my_tool");
        return null;
    }

    void UseSavedTool()
    {
        var used = UO.UseType("my_tool", -1, "backpack");
        if (Truth(used == 0))
        {
            UO.Print("No matching loaded tool in backpack");
        }
    }

    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.AddType(name) — UO.AddType(Any)

Parameters: name (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "addtype":

                    AddType(arguments);

                    break;

UO.AddType(name, type) — UO.AddType(Any,Any)

Parameters: name (Any), type (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "addtype":

                    AddType(arguments);

                    break;

UO.ClickOnObject

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

C# signatures

void UO.ClickOnObject(object? objID);

Sends a single click on an object via GameActions.SingleClick.

Parameters

  • objID — Serial of the object or supported name of self/backpack/lasttarget/saved object; numeric strings and 0x strings are resolved by runtime.

Return value

void - no return value.

Behavior

  • Click resolves the link via ObjectChecked. ClickOnObject first uses Arg for serial and calls Click(int). This is a request for the item's signature/information, not DoubleClick or use of the item. The server response comes asynchronously.

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

1. Click on character - direct script

Parameters and execution flow:

  • A single click is sent to self.
UO.ClickOnObject("self");

2. Click last target - script function

Parameters and execution flow:

  • Before sending, the local existence of the target is checked.
return  RunScenario();
 object? RunScenario()
{
    var target = UO.LastTarget();
    if (Truth(UO.Exists(target)))
    {
        UO.ClickOnObject(target);
    }

    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. They will click on the backpack - script class

Parameters and execution flow:

  • Single clicking on a backpack does not open it like double clicking it.
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 bag = UO.Backpack();
        if (Truth(bag != 0))
        {
            UO.ClickOnObject(bag);
        }

        return null;
    }

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

Parameters: objID (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "clickonobject": Click(Arg(0)); return InjectionValue.Unit;

UO.DeleteObject

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

C# signatures

void UO.DeleteObject(object? name);

Removes the stored object name from the runtime table.

Parameters

  • name — string name in the Objects table; Only this entry is deleted.

Return value

void - no return value.

Behavior

  • When a name is found, deletes the entry and prints a confirmation; If there is no name, it prints the message not found. The server object and its contents are not deleted.

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

1. Delete created name - direct script

Parameters and execution flow:

  • Only the temporary connection with the serial character is removed.
UO.AddObject("temporary",UO.Self());
UO.DeleteObject("temporary");

2. Missing Name - Script Function

Parameters and execution flow:

  • A missing name causes a diagnostic message.
return  RunScenario();
 object? RunScenario()
{
    UO.DeleteObject("missing-example-name");
    return null;
}

3. Store name in variable - script class

Parameters and execution flow:

  • The string variable specifies the exact entry to be deleted.
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 name = "temporary";
        UO.AddObject(name, UO.Self());
        UO.DeleteObject(name);
        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.DeleteObject(name) — UO.DeleteObject(String)

Parameters: name (String)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void DeleteObject(string name)

        {

            if (objects.TryGet(name, out int value))

            {

                objects.Remove(name);

                SystemMessage($"Object {name} has been deleted");

            }

            else

                SystemMessage($"Object {name} not found");

        }

UO.Drag

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

C# signatures

int UO.Drag(object? id);
int UO.Drag(object? id, object? amount);
int UO.Drag(object? id, object? amount, object? timeout);
void UO.Drag(object? fromX, object? fromY, object? toX, object? toY);

Raises a specific item to the cursor; a separate four-argument form drags the mouse in a Windows window.

Parameters

  • id — Serial of a specific item/character: number, hex/decimal string, self/backpack/lasttarget/lastobject/lastcontainer/lastcorpse/finditem/laststatus or saved name AddObject. This is not type. The object must be loaded; check Exists before taking action.
  • amount — Number of units inside one stack. 0 or a negative value means the entire stack; the positive is limited by the quantity available. It is NOT the number of stacks that limits MassMove. If absent, equals 0.
  • timeout - Optional third argument: wait for the observed Picking until the specified number of milliseconds; default is 0. A negative value is equivalent to 0.
  • fromX — Four int form only: the initial X of the mouse in client window pixels.
  • fromY — Initial mouse Y in client window pixels.
  • toX — The ending X of the mouse in pixels.
  • toY — The ending Y of the mouse in pixels.

Return value

With 1..3 int arguments: 1 — the lift request was accepted by the client (with timeout>0 a busy cursor was also observed); 0 — lift rejected or timeout expired. If four arguments are null: there is no return value. This is not a ID item.

Behavior

  • For game transfer, the preferred form is id[,amount[,timeout]] followed by DropItem or a single MoveItem.
  • The fromX/fromY/toX/toY form uses Windows mouse events: move, press, move, release. It has no server confirmation and depends on the actual content/focus of the window.
  • A busy cursor does not equal a successful transfer to the destination. Capture and release are separate actions.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Pick up the entire stack and put it in your backpack - direct script

Parameters and execution flow:

  • loot - serial via AddObject. amount=0 means the entire stack; -1/-1 sets the automatic place in the gump.
  • DropItem finishes capturing the same runtime. One means the request was sent, not the server's confirmation.
if (Truth(UO.Drag("loot", 0)))
{
    var dropped = UO.DropItem("backpack", -1, -1, 0);
    UO.Print("Drop request: " + Convert.ToString(dropped));
}

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

2. Take part of stack with limited wait - script function

Parameters and execution flow:

  • amount=10 — up to ten units of one stack; timeout=500 ms.
  • 44/55 - coordinates inside the backpack, not the map. If the item cannot be taken, DropItem is not called.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.Drag("loot", 10, 500)))
    {
        var dropped = UO.DropItem("backpack", 44, 55, 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. Check busy hands before grip - script class

Parameters and execution flow:

  • One Drag argument means the entire stack and timeout=0.
  • Picking checks the client's shared cursor. Do not run two independent migrations at the same time.
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()
    {
        if (Truth(UO.Picking() == 0))
        {
            if (Truth(UO.Drag("loot")))
            {
                var dropped = UO.DropItem("backpack", -1, -1, 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;
}

4. Four mouse coordinates - direct script

Parameters and execution flow:

  • These are the window pixels: start (100,120), end (260,180). There is no serial, amount or timeout here.
  • Use only when the desired elements are in these places; For items, serial addressing is more reliable.
UO.Drag(100, 120, 260, 180);

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.Drag(id) — UO.Drag(Any)

Parameters: id (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Drag(InjectionValue id) => Drag(id, InjectionValue.Zero, InjectionValue.Zero);

UO.Drag(id, amount) — UO.Drag(Any,Any)

Parameters: id (Any), amount (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Drag(InjectionValue id, InjectionValue amount) => Drag(id, amount, InjectionValue.Zero);

UO.Drag(id, amount, timeout) — UO.Drag(Any,Any,Any)

Parameters: id (Any), amount (Any), timeout (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Drag(InjectionValue id, InjectionValue amount, InjectionValue timeout)

        {

            int serial = GetObject(id);

            if (serial == 0)

                return 0;

            int requestedAmount = NumberConversions.ToInt(amount);

            int timeoutMs = Math.Max(0, NumberConversions.ToInt(timeout));

            int result = bridge.DragItem(serial, requestedAmount);

            if (result == 0 || timeoutMs <= 0)

                return result;



            DateTime deadline = DateTime.UtcNow.AddMilliseconds(timeoutMs);

            do

            {

                if (bridge.Picking() != 0)

                    return 1;

                if (DateTime.UtcNow >= deadline)

                    break;

                bridge.Wait(10);

            }

            while (true);



            SystemMessage($"UO.Drag: item pickup was not observable within {timeoutMs} ms.");

            return 0;

        }

UO.Drag(fromX, fromY, toX, toY) — UO.Drag(Integer,Integer,Integer,Integer)

Parameters: fromX (Integer), fromY (Integer), toX (Integer), toY (Integer)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void Drag(int fromX, int fromY, int toX, int toY) => bridge.Drag(fromX, fromY, toX, toY);

UO.DragItem

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

C# signatures

dynamic UO.DragItem(object? objID, object? count);

Picks up a specific item and remembers it for DropItem this runtime.

Parameters

  • objID — Serial of a specific item/character: number, hex/decimal string, self/backpack/lasttarget/lastobject/lastcontainer/lastcorpse/finditem/laststatus or saved name AddObject. This is not type. The object must be loaded; check Exists before taking action.
  • count — Number of units inside one stack. 0 or a negative value means the entire stack; the positive is limited by the quantity available. It is NOT the number of stacks that limits MassMove.

Return value

int 1 — the client accepted the rise; 0 - item not found or PickUp refused. Compatibility metadata object? does not mean an arbitrary result type. This is not serial.

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

Behavior

  • Both arguments are required. There is no built-in waiting for confirmation; the Drag(id,amount,timeout) form adds a wait for local Picking.
  • After a successful capture, complete action DropItem. An item manually picked up by the mouse does not set the DragItem memory of this runtime.

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.DragItem("lasttarget", 0);
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Raise the entire stack - direct script

Parameters and execution flow:

  • ObjID=loot via AddObject, Count=0 is the entire stack.
  • The second team drops the same picked up item.
if (Truth(UO.DragItem("loot", 0)))
{
    var ok = UO.DropItem("backpack", -1, -1, 0);
}

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

2. Raise five units - script function

Parameters and execution flow:

  • Replace ObjID with your serial. Count=5 refers to the units of one stack.
  • The location 44/55 is inside the backpack gump.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.DragItem(0x40001234, 5)))
    {
        var ok = UO.DropItem("backpack", 44, 55, 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. Show Failed Capture - Script Class

Parameters and execution flow:

  • picked — int 1/0.
  • Don't call DropItem after a failed capture: the cursor may belong to another activity.
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 picked = UO.DragItem("loot", 0);
        if (Truth(picked == 0))
        {
            UO.Print("Item was not picked up");
        }
        else
        {
            var ok = UO.DropItem("backpack", -1, -1, 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;
}

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

Parameters: objID (Any), count (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dragitem": return new InjectionValue(bridge.DragItem(Arg(0), Arg(1)));

UO.Drop

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

C# signatures

int UO.Drop(object? @object);
int UO.Drop(object? @object, object? count);
int UO.Drop(object? @object, object? count, object? destination);
dynamic UO.Drop(object? objID, object? count, object? x, object? y, object? z);

Performs a complete transfer of the specified item, by default to the ground under the character.

Parameters

  • object — Serial of a specific item/character: number, hex/decimal string, self/backpack/lasttarget/lastobject/lastcontainer/lastcorpse/finditem/laststatus or saved name AddObject. This is not type. The object must be loaded; check Exists before taking action.
  • objID — Serial of a specific item/character: number, hex/decimal string, self/backpack/lasttarget/lastobject/lastcontainer/lastcorpse/finditem/laststatus or saved name AddObject. This is not type. The object must be loaded; check Exists before taking action.
  • count — Number of units inside one stack. 0 or a negative value means the entire stack; the positive is limited by the quantity available. It is NOT the number of stacks that limits MassMove. In short form without count is 0.
  • destination - Only in the form with three arguments: Serial of the container or set name AddObject; backpack/self/my choose a backpack, receiving/catchbag - SetCatchBag, and without it a backpack. lastcontainer/lastobject/lasttarget/lastcorpse/finditem/laststatus are valid when resolved to the correct container. ground or 0 explicitly selects land; -1—the same backpack selector. An unknown or unspecified name causes an error before the item is captured. Without a destination argument, the backpack is used.
  • x - Only in five-argument form: world X destination on earth.
  • y — World Y for five-argument form.
  • z — World height for five-argument form.

Return value

int 1 — the full transfer request was accepted by the client; 0 - failed. The five-argument compatible form has a metadata object?, but actually also returns an int 1/0. This is not a reset of the previously taken DragItem: use DropItem for it.

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

Behavior

  • Forms with 1, 2, 3 and 5 arguments are registered. There is no form with four arguments.
  • Drop(item) transfers the entire stack to the ground below it; Drop(item,count) specifies units; Drop(item,count,destination) allows the container.
  • Drop(item,count,X,Y,Z) always means land. For a container with gump coordinates, use MoveItem.
  • Lifting, DropCheckCoord and server check restrictions apply. The team does not wait for separate confirmation of delivery.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. The whole stack is under your feet - a direct script

Parameters and execution flow:

  • object=loot via AddObject, count=0 by default.
  • Destination - the character's current point on the ground.
var ok = UO.Drop("loot");

2. Five units in a backpack - script function

Parameters and execution flow:

  • count=5 units of one stack; destination=backpack.
  • The third argument here is a container, not X.
return  RunScenario();
 object? RunScenario()
{
    var ok = UO.Drop("loot", 5, "backpack");
    return null;
}

3. Explicit point on the ground - scenario class

Parameters and execution flow:

  • Replace ObjID with your serial; Count=0 entire stack; X/Y/Z=1445/1690/0.
  • For this shape, the third value is X. No pre-Drag is needed.
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 ok = UO.Drop(0x40001234, 0, 1445, 1690, 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.Drop(object) — UO.Drop(Any)

Parameters: object (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "drop":

                    if (arguments.Length > 0)

                        return new InjectionValue(MoveItem(arguments[0], arguments.Length > 1 ? arguments[1] : InjectionValue.Zero, arguments.Length > 2 ? arguments[2] : new InjectionValue("ground")));

                    return InjectionValue.False;

UO.Drop(object, count) — UO.Drop(Any,Any)

Parameters: object (Any), count (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "drop":

                    if (arguments.Length > 0)

                        return new InjectionValue(MoveItem(arguments[0], arguments.Length > 1 ? arguments[1] : InjectionValue.Zero, arguments.Length > 2 ? arguments[2] : new InjectionValue("ground")));

                    return InjectionValue.False;

UO.Drop(object, count, destination) — UO.Drop(Any,Any,Any)

Parameters: object (Any), count (Any), destination (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "drop":

                    if (arguments.Length > 0)

                        return new InjectionValue(MoveItem(arguments[0], arguments.Length > 1 ? arguments[1] : InjectionValue.Zero, arguments.Length > 2 ? arguments[2] : new InjectionValue("ground")));

                    return InjectionValue.False;

UO.Drop(objID, count, x, y, z) — UO.Drop(Any,Any,Any,Any,Any)

Parameters: objID (Any), count (Any), x (Any), y (Any), z (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "drop": return new InjectionValue(MoveItemChecked(Arg(0), Arg(1), 0, Arg(2), Arg(3), Arg(4)) ? 1 : 0);

UO.DropCheckCoord

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

C# signatures

dynamic UO.DropCheckCoord();
dynamic UO.DropCheckCoord(object? value);

Reads or changes the coordinate range check when dropping items on the ground.

Parameters

  • value — Optional value: 0 disables, nonzero int enables. Without an argument, the state is only read.

Return value

int 0/1 — current state after possible recording; both forms return a number.

Behavior

  • MoveItemChecked when assigned to a ground and the flag is turned on, rejects the Chebyshev X/Y distance greater than 2 cells from the character. The check does not change the coordinates and does not check the server permission to transfer. Container assignments are not limited to this flag.

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.DropCheckCoord();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Read flag - direct script

Parameters and execution flow:

  • Read returns the current normalized setting.
var enabled = UO.DropCheckCoord();
UO.Print(Convert.ToString(enabled));

2. Enable range protection - script function

Parameters and execution flow:

  • Ground transfers through MoveItemChecked are now limited to two squares.
return  RunScenario();
 object? RunScenario()
{
    var enabled = UO.DropCheckCoord(1);
    UO.Print(Convert.ToString(enabled));
    return null;
}

3. Restore Setting - Script Class

Parameters and execution flow:

  • The original value is saved and restored explicitly.
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 old = UO.DropCheckCoord();
        var temporary = UO.DropCheckCoord(0);
        var restored = UO.DropCheckCoord(old);
        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.DropCheckCoord() — UO.DropCheckCoord()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dropcheckcoord":

                    if (arguments.Length > 0) state.DropCheckCoord = Arg(0) != 0 ? 1 : 0;

                    return new InjectionValue(state.DropCheckCoord);

UO.DropCheckCoord(value) — UO.DropCheckCoord(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dropcheckcoord":

                    if (arguments.Length > 0) state.DropCheckCoord = Arg(0) != 0 ? 1 : 0;

                    return new InjectionValue(state.DropCheckCoord);

UO.DropDelay

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

C# signatures

dynamic UO.DropDelay();
dynamic UO.DropDelay(object? value);

Reads or changes the GrabDelay runtime delay used by item transfers.

Parameters

  • value — Optional delay in milliseconds; bridge limits to 50..10000.

Return value

Without int argument with current GrabDelay. The entry form returns null even though both forms' metadata contains object?.

Behavior

  • SetDropDelay and GetDropDelay use State. GrabDelay. The setting specifies the client delay of transfers, rather than confirmation of their completion by the server.

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.DropDelay();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Read delay - direct script

Parameters and execution flow:

  • Read returns milliseconds.
var ms = UO.DropDelay();
UO.Print(Convert.ToString(ms));

2. Set Delay - Script Function

Parameters and execution flow:

  • The entry sets 250 ms.
return  RunScenario();
 object? RunScenario()
{
    UO.DropDelay(250);
    return null;
}

3. Border Bottom - Script Class

Parameters and execution flow:

  • Zero is limited to 50 ms, after which it is restored to its 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 previous = UO.DropDelay();
        UO.DropDelay(0);
        UO.Print(Convert.ToString(UO.DropDelay()));
        UO.DropDelay(previous);
        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.DropDelay() — UO.DropDelay()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dropdelay":

                    if (arguments.Length > 0) { bridge.SetDropDelay(Arg(0)); return InjectionValue.Unit; }

                    return new InjectionValue(bridge.GetDropDelay());

UO.DropDelay(value) — UO.DropDelay(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dropdelay":

                    if (arguments.Length > 0) { bridge.SetDropDelay(Arg(0)); return InjectionValue.Unit; }

                    return new InjectionValue(bridge.GetDropDelay());

UO.DropHere

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

C# signatures

int UO.DropHere(object? @object);

Transfers the entire specified item/stack to the ground at the character's current point.

Parameters

  • object — Serial of a specific item/character: number, hex/decimal string, self/backpack/lasttarget/lastobject/lastcontainer/lastcorpse/finditem/laststatus or saved name AddObject. This is not type. The object must be loaded; check Exists before taking action.

Return value

int 1 — transfer request accepted by the client; 0 - not completed. This is not serial or server confirmation.

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

Behavior

  • A form has been registered with exactly one argument. For part of the stack, use Drop(item,count) or MoveItem.
  • X/Y/Z are taken from the character during the call. No prior DragItem is required.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Throw a known item - direct script

Parameters and execution flow:

  • object - serial, replace with real.
  • The entire stack is transferred to the character.
var ok = UO.DropHere(0x40001234);

2. Use Saved Name - Script Function

Parameters and execution flow:

  • loot is specified via AddObject.
  • Exists checks availability, not the server's permission to migrate.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.Exists("loot")))
    {
        var ok = UO.DropHere("loot");
    }

    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. Handle Client Failure - Script Class

Parameters and execution flow:

  • ok — int 1/0.
  • To confirm the server result, check the position and container of the item separately.
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 ok = UO.DropHere("loot");
        if (Truth(ok == 0))
        {
            UO.Print("Drop request was not accepted");
        }

        return null;
    }

    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.DropHere(object) — UO.DropHere(Any)

Parameters: object (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "drophere":

                    if (arguments.Length > 0)

                        return new InjectionValue(MoveItem(arguments[0], arguments.Length > 1 ? arguments[1] : InjectionValue.Zero, new InjectionValue("ground"), new InjectionValue(GetX()), new InjectionValue(GetY()), new InjectionValue(GetZ())));

                    return InjectionValue.False;

UO.DropItem

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

C# signatures

dynamic UO.DropItem(object? moveIntoID, object? x, object? y, object? z);

Resets an item previously successfully picked up by Drag/DragItem in the same runtime.

Parameters

  • moveIntoID — Serial destination, backpack or set name AddObject. The number 0 means earth. Use backpack rather than self: This low-level argument resolves self to the character's serial.
  • x — For a container — place inside the gump (-1/65535 automatically); for the earth - world X.
  • y — For a container — place inside the gump (-1/65535 automatically); for the earth - world Y.
  • z — Reset height; in the container usually 0, on the ground the actual Z point.

Return value

int 1 - the reset has been sent and the cursor is marked Dropped; 0 - There was no successful DragItem, the cursor has changed/not accessible or the assignment is invalid. Metadata object? compatibility does not change this result. This is not a quantity or serial.

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

Behavior

  • All four arguments are required. This option does not retake the item; Drop and MoveItem perform a complete transfer over serial.
  • It is checked that it is the item memorized by this runtime that is being held. An item taken by someone else or taken by hand should not be dropped accidentally.
  • After sending, the capture memory is cleared. Setting GrabDelay adds a pause to the script flow. Server failure is possible after return.

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.DropItem("backpack", -1, -1, 0);
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Automatic backpack space - direct script

Parameters and execution flow:

  • MoveIntoID=backpack, X/Y=-1, Z=0.
  • Successful capture is verified before release.
if (Truth(UO.DragItem("loot", 0)))
{
    var ok = UO.DropItem("backpack", -1, -1, 0);
}

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

2. Space inside the chest - script function

Parameters and execution flow:

  • chest is specified via AddObject. X=60/Y=70 — coordinates in his gump.
  • amount=10 refers to Drag, DropItem does not have its own amount.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.Drag("loot", 10)))
    {
        var ok = UO.DropItem("chest", 60, 70, 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. Place on the ground under the character - scenario class

Parameters and execution flow:

  • MoveIntoID=0 clearly selects land.
  • X/Y/Z is the world point, not the coordinates of the container.
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 x = UO.GetX();
        var y = UO.GetY();
        var z = UO.GetZ();
        if (Truth(UO.DragItem("loot", 0)))
        {
            var ok = UO.DropItem(0, x, y, z);
        }

        return null;
    }

    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.DropItem(moveIntoID, x, y, z) — UO.DropItem(Any,Any,Any,Any)

Parameters: moveIntoID (Any), x (Any), y (Any), z (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "dropitem": return new InjectionValue(bridge.DropDraggedItem(Arg(0), Arg(1), Arg(2), Arg(3)));

UO.Dye

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

C# signatures

void UO.Dye(object? dyeObject);
void UO.Dye(object? dyeObject, object? target);

Uses the transferred coloring item; the second argument presets the object UO.Wait-target.

Parameters

  • dyeObject — Serial of the object or supported name of self/backpack/lasttarget/saved object; numeric strings and 0x strings are resolved by runtime.
  • target — Optional object/serial of the next target. Without the second argument, a new goal is not set.

Return value

void - no return value.

Behavior

  • The two-argument form first calls WaitTargetObject(target), then UseObject(dyeObject). The one-argument form only uses the subject. This is sending actions; color, coloring right and total are determined by the server.

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

1. Use Dye Item - Direct Script

Parameters and execution flow:

  • A one-argument call does not specify a target.
var dye = UO.LastObject();
if (Truth(UO.Exists(dye)))
{
    UO.Dye(dye);
}

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

2. Color selected target - script function

Parameters and execution flow:

  • Target is placed before double clicking on dye.
return  RunScenario();
 object? RunScenario()
{
    var dye = UO.LastObject();
    var target = UO.LastTarget();
    if (Truth(UO.Exists(dye)) && Truth(UO.Exists(target)))
    {
        UO.Dye(dye, target);
    }

    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. Saved Names - Script Class

Parameters and execution flow:

  • The example uses the previously saved names dye and cloth.
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()
    {
        if (Truth(UO.Exists("dye")) && Truth(UO.Exists("cloth")))
        {
            UO.Dye("dye", "cloth");
        }

        return null;
    }

    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.Dye(dyeObject) — UO.Dye(Any)

Parameters: dyeObject (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "dye":

                    if (arguments.Length > 1) bridge.WaitTargetObject(Arg(1));

                    bridge.UseObject(Arg(0, bridge.GetLastObject()));

                    break;

UO.Dye(dyeObject, target) — UO.Dye(Any,Any)

Parameters: dyeObject (Any), target (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "dye":

                    if (arguments.Length > 1) bridge.WaitTargetObject(Arg(1));

                    bridge.UseObject(Arg(0, bridge.GetLastObject()));

                    break;

UO.EasyObject

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

C# signatures

void UO.EasyObject(object? name);
void UO.EasyObject(object? name, object? @object);

Stores the object name without an interactive target query.

Parameters

  • name — The name of the runtime Objects entry, converted to string.
  • object — Optional serial/link. Without it, GetLastObject is preserved.

Return value

void - no return value.

Behavior

  • State.Objects.Set replaces the name entry. The one-argument form uses the last object used rather than LastTarget. The presence of an object in the world is not separately checked by this branch.

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.EasyObject");
UO.EasyObject("last-used");

1. Save last object - direct script

Parameters and execution flow:

  • The name is given to the current LastObject.
UO.EasyObject("last-used");

2. Save yourself - script function

Parameters and execution flow:

  • The two-argument form saves the passed serial.
return  RunScenario();
 object? RunScenario()
{
    UO.EasyObject("me", UO.Self());
    return null;
}

3. Delete Temporary Entry - Script Class

Parameters and execution flow:

  • Forget deletes only the stored name association.
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.EasyObject("temporary", UO.Self());
        UO.Forget("temporary");
        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.EasyObject(name) — UO.EasyObject(Any)

Parameters: name (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "easyobject":

                    if (arguments.Length > 1) state.Objects.Set(Text(0), Arg(1));

                    else if (arguments.Length > 0) state.Objects.Set(Text(0), bridge.GetLastObject());

                    break;

UO.EasyObject(name, object) — UO.EasyObject(Any,Any)

Parameters: name (Any), object (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "easyobject":

                    if (arguments.Length > 1) state.Objects.Set(Text(0), Arg(1));

                    else if (arguments.Length > 0) state.Objects.Set(Text(0), bridge.GetLastObject());

                    break;

UO.EmptyContainer

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

C# signatures

int UO.EmptyContainer(object? delay);
int UO.EmptyContainer(object? delay, object? source);
int UO.EmptyContainer(object? delay, object? source, object? destination);

Transfers all direct contents of a chest, bag, or corpse to the specified container. The first parameter is always the delay in milliseconds. If no source is specified, a local target cursor appears: select the source container. The default destination is the current character's backpack.

Parameters

  • delay — First required parameter: delay between transfers, in milliseconds. For example 350 - 0,35 seconds. Integer values ​​are used; negative ones are reduced to 0. GrabDelay is not added separately to this delay. The last pause is saved so that the next line does not overtake the last request.
  • source — Second optional parameter: serial of the source container, a numeric/hex string or saved object name. lastobject, lastcontainer, lasttarget, lastcorpse, backpack/my are supported. If the parameter is missing or equal to 0, a crosshair appears. Select a container item or a corpse; Esc cancels the action.
  • destination - The third optional parameter is serial or the saved name of the destination container. backpack/self/my select the character's backpack. receiving/catchbag select the installed SetCatchBag container (or backpack if not installed). lastcontainer/lastobject/lasttarget/lastcorpse/finditem/laststatus are valid if they resolve to an accessible container. An unknown or unset alias gives an error. If the parameter is not specified, the backpack is used; the receiving container setting does not change this choice. Destination must exist and be different from source. Ground/0 is not a valid destination container here.

Return value

int: 1 if the source was non-empty and a transfer request could be sent for each selected direct item; 0 when source is empty, target cursor cancelled, destination is incorrect, download timeout or partial/complete send failure. This is the result of client requests, not a guarantee of server-confirmed emptying.

Behavior

  • Exact forms: EmptyContainer(delay), EmptyContainer(delay, source), EmptyContainer(delay, source, destination). In game chat with the standard prefix: ,emptycontainer 350; from the script: UO.EmptyContainer(350).
  • When aiming, the command waits for selection, cancellation, or emergency stop. The client continues to update the image and network. Esc does not send any carries, does not use the old object, and returns 0. If another sight replaces this selection, the action is also canceled.
  • If the content has not yet been downloaded, the client opens the source and waits until 3000 ms for the server to respond. Content that is hidden from the client cannot be transferred without obtaining the server data. An inaccessible/too far away chest or a server ban will result in failure rather than selecting another container.
  • After receiving the data, a list of direct items is created. Each stack is migrated in its entirety, with one capture and reset request at a time. The enclosed bag is carried entirely; its contents are not searched separately. New items added later are not included in the current list.
  • Before each request, it is re-checked that the item is still in the original container. You cannot nest a container within itself or its own child. If the cursor is occupied by another item, the command does not reset it on your behalf.
  • A missing destination container is not replaced by a backpack. A result of 1 does not mean that the server has accepted all actions: if necessary, check the contents after updating the server. An emergency stop interrupts the wait; Actions already sent are not rolled back.
  • An unknown stored name or invalid argument format causes a API error rather than a 0 return. Distinguish this from a valid serial missing object: for this the operation returns 0.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Select a chest or corpse with a sight and transfer it to the backpack - direct script

Parameters and execution flow:

  • The only parameter delay=350 specifies the interval 350 ms. source is missing, so the crosshair appears.
  • destination is also missing: the contents go to the character’s backpack. Choose the container/corpse itself, not just one item inside it.
  • sent receives 1 or 0. The meaning of 0 combines cancellation, emptiness and failure; See also the journal for details.
UO.Print("Select a chest or corpse");
var sent = UO.EmptyContainer(350);
if (Truth(sent == 0))
{
    UO.Print("Cancelled, empty, unavailable, or a transfer failed");
}

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

2. From a famous chest to a backpack without a target cursor - script function

Parameters and execution flow:

  • delay=350; source - the real serial of the chest, replace the approximate ID with yours. The sight does not appear.
  • The third parameter is not specified, so destination=backpack. All types of direct items and full stacks are included in the carryover.
  • Print prints the client's send result, not the number of items or the server's confirmation.
return  RunScenario();
 object? RunScenario()
{
    var source = "0x40001234";
    var sent = UO.EmptyContainer(350, source);
    UO.Print("Client request result: " + Convert.ToString(sent));
    return null;
}

3. Between two selected containers - script class

Parameters and execution flow:

  • AddObject with one parameter prompts you to select an object and saves its name. The two selections are made sequentially.
  • U EmptyContainer delay=350; source=source_bag; destination=destination_bag. The third parameter specifies a specific bag instead of a backpack.
  • The names must refer to different containers. The canceled AddObject removes the previous meaning of its name, so the old bag is not accidentally used.
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("Select source");
        UO.AddObject("source_bag");
        UO.Print("Select destination");
        UO.AddObject("destination_bag");
        var sent = UO.EmptyContainer(350, "source_bag", "destination_bag");
        UO.Print("Client request result: " + Convert.ToString(sent));
        return null;
    }
}

4. From the last opened container to a given chest - direct script

Parameters and execution flow:

  • delay=500 — half-second interval. source=lastcontainer - the last container opened by the server in this client.
  • destination - explicit ID of your chest; replace example. lastcontainer and lastobject have different meanings: the last container opened and the last object used.
  • Before starting, make sure that the last source you opened was the one you need. The carry does not open its nested bags recursively.
var destination = "0x40005678";
UO.EmptyContainer(500, "lastcontainer", destination);

5. Select a source by sight, specify the destination in advance - script function

Parameters and execution flow:

  • delay=350; source=0 specifically calls the target cursor, while retaining the ability to pass a third parameter.
  • destination=storage points to a previously saved chest. Once you select a source, the content is transferred there.
  • Esc returns sent=0 without wrapping. If storage is unknown or does not exist, another container is not automatically selected.
return  RunScenario();
 object? RunScenario()
{
    UO.AddObject("storage", "0x40005678");
    var sent = UO.EmptyContainer(350, 0, "storage");
    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.EmptyContainer(delay) — UO.EmptyContainer(Any)

Parameters: delay (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "emptycontainer": return ExecuteEmptyContainer(arguments);

UO.EmptyContainer(delay, source) — UO.EmptyContainer(Any,Any)

Parameters: delay (Any), source (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "emptycontainer": return ExecuteEmptyContainer(arguments);

UO.EmptyContainer(delay, source, destination) — UO.EmptyContainer(Any,Any,Any)

Parameters: delay (Any), source (Any), destination (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "emptycontainer": return ExecuteEmptyContainer(arguments);

UO.Exists

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

C# signatures

int UO.Exists(object? id);

Checks the presence of a non-deleted object in the client's local world.

Parameters

  • id — Mandatory serial/ID of a specific object: int, hex-string or alias self, backpack, lasttarget, lastobject, lastcontainer, laststatus, finditem, lastcorpse or name AddObject. This is not a graphic/type. Unspecified name resolves to 0; the command does not open any new target.

Return value

int 1 - serial is now resolved into the loaded item or mobile. int 0 — the object is unknown to the client, deleted or the alias is not set. This is not a server response about the existence of an object: an item outside the visible area may exist on the server and give 0 here.

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

Behavior

  • The local client model is read; There are no requests to the server, no waiting or moving.
  • The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Check if backpack is available - direct script

Parameters and execution flow:

  • Argument backpack is an alias serial of your own character’s backpack.
  • 1 does not mean that the contents of the backpack have already been fully received or that it has been opened.
var present = UO.Exists("backpack");
if (Truth(present))
{
    UO.Print("Backpack is loaded");
}
else
{
    UO.Print("Backpack is unavailable");
}

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

2. Recheck saved serial - script function

Parameters and execution flow:

  • target saves a specific serial. The new lasttarget value will not replace it.
  • After the pause 500 ms, the object could have gone out of visibility, so the check is performed again.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var target = UO.GetSerial("lasttarget");
    await Delay(500);
    if (Truth(UO.Exists(target)))
    {
        UO.Print(UO.GetName(target));
    }
    else
    {
        UO.Print("Saved target is no longer loaded");
    }

    return null;
}

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

3. Distinguish ID formatting from object presence - script class

Parameters and execution flow:

  • GetSerial formats the number 1073746484 as 0x40001234 even if there is no object.
  • Only the next check reports the presence of this serial in the current local world.
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 serial = UO.GetSerial("1073746484");
        UO.Print("Serial: " + serial);
        var present = UO.Exists(serial);
        UO.Print("Present 1/0: " + Convert.ToString(present));
        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.Exists(id) — UO.Exists(Integer)

Parameters: id (Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Exists(int id) => bridge.Exists(id);

UO.Exists(id) — UO.Exists(String)

Parameters: id (Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Exists(string id) => Exists(GetObject(id));

UO.Forget

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

C# signatures

void UO.Forget(object? name);

Without a message, removes the stored name from runtime Objects.

Parameters

  • name — Record name, converted to string.

Return value

void - no return value.

Behavior

  • The branch calls state.Objects.Remove. Unlike DeleteObject, this form does not print a confirmation or report a missing name. The game world object is not deleted.

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

1. Delete temporary name - direct script

Parameters and execution flow:

  • Only the connection between the name and serial is removed.
UO.EasyObject("temporary",UO.Self());
UO.Forget("temporary");

2. Missing Name - Script Function

Parameters and execution flow:

  • A missing name is allowed without a message.
return  RunScenario();
 object? RunScenario()
{
    UO.Forget("missing-example-name");
    return null;
}

3. Name from variable - script class

Parameters and execution flow:

  • The deletion refers to the exact name string.
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 name = "temporary";
        UO.EasyObject(name, UO.Self());
        UO.Forget(name);
        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.Forget(name) — UO.Forget(Any)

Parameters: name (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "forget": if (arguments.Length > 0) state.Objects.Remove(Text(0)); break;

UO.GetAltName

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

C# signatures

dynamic UO.GetAltName(object? objID);

Reads the character's title known to the client: for example, profession or signature after the name.

Parameters

  • objID — Required serial/ID object, not type and not cliloc. Allows int, decimal/hex string, self, backpack, lasttarget, finditem or name AddObject. 0 means no object.

Return value

string — text of the Title field for Mobile. Empty string if title is unknown, the object is not a character, or ID is missing. It is not serial, a full name, or an array of properties. GetAltName uses the same field as GetTitle.

Behavior

  • The call itself reads local data, does not wait for the server and does not send a single click. To request a name/title, use ClickOnObject alone; the response comes asynchronously.
  • An empty string is also acceptable for an existing character. The Exists check answers another question: whether the object is loaded.
  • In this implementation, the alternate name is mapped to the character's Title field.

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.GetAltName("self");
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Title of your character - direct script

Parameters and execution flow:

  • ObjID=self — character of the current client.
  • title contains only the title; an empty field does not mean a script error.
var title = UO.GetAltName("self");
UO.Print(title);

2. Check selected character - script function

Parameters and execution flow:

  • ObjID=id — serial of the last target. GetName and title are read separately.
  • The item target does not have a Title field and will give an empty string.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.GetSerial("lasttarget");
    if (Truth(UO.Exists(id)))
    {
        var title = UO.GetAltName(id);
        if (Truth(title != ""))
        {
            UO.Print(UO.GetName(id) + " " + title);
        }
    }

    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. Prompt for name before reading - script class

Parameters and execution flow:

  • 350 — example of a pause in milliseconds after a single click; this is not a getter parameter.
  • The server may respond later or may not transfer the title. Preserve handling of empty string.
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.GetSerial("lasttarget");
        if (Truth(UO.Exists(id)))
        {
            UO.ClickOnObject(id);
            UO.Wait(350);
            UO.Print(UO.GetAltName(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;
}

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

Parameters: objID (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "getaltname": return new InjectionValue(bridge.GetAltName(Arg(0)));

UO.GetColor

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

C# signatures

string UO.GetColor();
string UO.GetColor(object? id);

Reads the hue of an object and formats it as a hexadecimal string.

Parameters

  • id — Serial/ID of the object, not the graphic/type. A number, a hex string, the standard name self/backpack/lasttarget/lastobject/lastcontainer/laststatus/finditem/lastcorpse, or the name AddObject. The alias must be set; existence is checked by Exists. The registered form without arguments uses self.

Return value

string of the form "0x0481" - hue/color code, four hex digits after 0x. For a missing object, "0x0000" is returned; the same code occurs for an unpainted item. Color is not graphic/type or unique serial.

Behavior

  • The latest data already known to the client is read; the update request is not sent to the server.
  • An unknown object and a property that has not yet been retrieved can have a null/empty value. Check Exists and conditions for a specific action.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Find out the color of the last item - direct script

Parameters and execution flow:

  • id=lastobject - last used object.
  • The result is already a hex string and does not require Int2Hex.
var hue = UO.GetColor("lastobject");
UO.Print(hue);

2. Search for an object of the same color - script function

Parameters and execution flow:

  • type and hue are different characteristics of the sample; FindType accepts both hex representations.
  • match — found serial or empty string. Color does not replace type.
return  RunScenario();
 object? RunScenario()
{
    var sample = UO.GetSerial("lastobject");
    if (Truth(UO.Exists(sample)))
    {
        var type = UO.GetGraphic(sample);
        var hue = UO.GetColor(sample);
        var match = UO.FindType(type, hue, "backpack");
        UO.Print(match);
    }

    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. Convert hue to integer for comparison - script class

Parameters and execution flow:

  • GetColor reads self; Hex2Int converts hex text to int.
  • A null hue by itself does not indicate whether a character is present in the world.
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 hue = UO.Hex2Int(UO.GetColor("self"));
        if (Truth(hue == 0))
        {
            UO.Print("Hue is zero");
        }

        return null;
    }

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

Parameters: No parameters.

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetColor() => GetColor(new InjectionValue(bridge.Self));

UO.GetColor(id) — UO.GetColor(Any)

Parameters: id (Any)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetColor(InjectionValue id) => NumberConversions.ToHex((short)bridge.GetColor(GetObject(id)));

UO.GetFlags

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

C# signatures

int UO.GetFlags(object? id);

Reads the Entity.Flags bitmask from a local known object.

Parameters

  • id — Serial of the object or supported name of self/backpack/lasttarget/saved object; numeric strings and 0x strings are resolved by runtime.

Return value

int - original Entity.Flags. Unknown/missing Entity returns 0; it is a mask, not a logical result.

Behavior

  • GetObject resolves the link, then bridge.World.Get reads Entity.Flags on the game thread. A null value could mean an object with no flags or no model; Exists separates these cases. The command does not request a status update.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Flags yourself - direct script

Parameters and execution flow:

  • The mask of the current character is displayed.
var flags = UO.GetFlags("self");
UO.Print(Convert.ToString(flags));

2. Known Target Flags - Script Feature

Parameters and execution flow:

  • The Exists check distinguishes a missing model.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.LastTarget();
    if (Truth(UO.Exists(id)))
    {
        var flags = UO.GetFlags(id);
        UO.Print(Convert.ToString(flags));
    }

    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. Missing serial - script class

Parameters and execution flow:

  • A null serial usually does not match an Entity and returns 0.
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 flags = UO.GetFlags(0);
        UO.Print(Convert.ToString(flags));
        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.GetFlags(id) — UO.GetFlags(Any)

Parameters: id (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int GetFlags(InjectionValue id) => bridge.GetFlags(GetObject(id));

UO.GetGraphic

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

C# signatures

string UO.GetGraphic();
string UO.GetGraphic(object? id);

Reads the graphic of an item or body of a character and returns it in hexadecimal text.

Parameters

  • id — Serial of a specific object or a resolvable alias, such as "self", "backpack", "lasttarget" or the name stored by AddObject. Graphic/type is not passed here. The no-argument form uses self.

Return value

string of the form "0x0EED" - graphical type/body of the object. This is not a unique ID/serial. For an unknown object, bridge returns the graphic 0, which is formatted as "0x0000". The command does not return true/false.

Behavior

  • The command reads the client's local data. It does not send target and does not change the object on the server.
  • The number 0 may be a valid data value. Check for the absence of an object by Exists(serial), and not just by the value of its property.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Check the type of found item - direct script

Parameters and execution flow:

  • FindType gets the gold type and returns serial.
  • GetGraphic(serial) returns the text "0x0EED"; the item and graphic variables have different meanings.
var item = UO.FindType(0x0EED, -1, "backpack");
if (Truth(item != ""))
{
    var graphic = UO.GetGraphic(item);
    UO.Print("Graphic: " + graphic);
}

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

2. Read your character's body - script function

Parameters and execution flow:

  • The no-argument form uses self.
  • body is the character's appearance code, not its serial.
return  RunScenario();
 object? RunScenario()
{
    var body = UO.GetGraphic();
    UO.Print("Body graphic: " + body);
    return null;
}

3. Pass read graphic to new search - script class

Parameters and execution flow:

  • lastobject - sample; graphic is a hex string that FindType accepts as type.
  • -1 allows any color, backpack specifies the search area. sameType is again serial.
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 graphic = UO.GetGraphic("lastobject");
        var sameType = UO.FindType(graphic, -1, "backpack");
        if (Truth(sameType != ""))
        {
            UO.Print("Matching serial: " + sameType);
        }

        return null;
    }

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

Parameters: No parameters.

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetGraphics() => GetGraphics(bridge.Self);

UO.GetGraphic(id) — UO.GetGraphic(Integer)

Parameters: id (Integer/String)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetGraphics(int id) => $"0x{bridge.GetGraphics(id):X4}";

UO.GetGraphic(id) — UO.GetGraphic(String)

Parameters: id (Integer/String)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetGraphics(string id) => GetGraphics(GetObject(id));

UO.GetLayer

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

C# signatures

string UO.GetLayer();
string UO.GetLayer(object? id);

Parameters

  • id — Serial of a specific object or a resolvable alias, such as "self", "backpack", "lasttarget" or the name stored by AddObject. Graphic/type is not passed here. The no-argument form uses self.

Return value

string is the name of the layer, such as "Rhand", "Lhand", "Hat", "Bpack" or "Mount". The first canonical name for the layer number is returned, so Helmet is output as "Hat" and Backpack as "Bpack". Zero layer, unknown item or self give "Invalid". An unknown non-zero number is formatted as "0xNN". It's not serial, not graphic, and not Z height.

Behavior

  • The command reads the client's local data. It does not send target and does not change the object on the server.
  • The number 0 may be a valid data value. Check for the absence of an object by Exists(serial), and not just by the value of its property.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Determine the layer of an object in the right hand - direct script

Parameters and execution flow:

  • ObjAtLayer("Rhand") selects an item on the right hand; 0 means empty slot.
  • GetLayer gets the serial of the found item and returns the string "Rhand".
object? item = UO.ObjAtLayer("Rhand");
if (item is string serial)
{
    var layer = UO.GetLayer(serial);
    UO.Print(layer);
}

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

2. Check Backpack Layer Name - Script Function

Parameters and execution flow:

  • id="backpack" — serial of the current character’s backpack.
  • The canonical name Bpack is checked, not the alias Backpack.
return  RunScenario();
 object? RunScenario()
{
    var layer = UO.GetLayer("backpack");
    if (Truth(layer == "Bpack"))
    {
        UO.Print("Player backpack layer");
    }
    else
    {
        UO.Print("Layer: " + layer);
    }

    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. Handle Lack of Equipment - Script Class

Parameters and execution flow:

  • lastobject must be an actual alias of the item.
  • Invalid means layer zero. This in itself does not prove the item is missing: the item in the bag is also not equipped.
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 layer = UO.GetLayer("lastobject");
        if (Truth(layer == "Invalid"))
        {
            UO.Print("No equipment layer");
        }
        else
        {
            UO.Print("Equipment layer: " + layer);
        }

        return null;
    }

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

Parameters: No parameters.

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetLayer() => GetLayer(new InjectionValue(bridge.Self));

UO.GetLayer(id) — UO.GetLayer(Any)

Parameters: id (Any)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetLayer(InjectionValue id) => ConvertLayer(bridge.GetLayer(GetObject(id)));

UO.GetLocked

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

C# signatures

int UO.GetLocked(object? id);

Checks mobile paralysis.

Parameters

  • id — Mandatory serial/ID of a specific object: int, hex-string or alias self, backpack, lasttarget, lastobject, lastcontainer, laststatus, finditem, lastcorpse or name AddObject. This is not a graphic/type. Unspecified name resolves to 0; the command does not open any new target. The argument is required; for yourself, pass self.

Return value

int 1 — the loaded mobile has the attribute IsParalyzed. int 0 - the attribute is missing, the object is not mobile, unknown or deleted. Despite the name Locked, it is not a chest lock, an item being secured, or any reason for being unable to move. The same flag is read as Paralyzed.

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

Behavior

  • The local client model is read; There are no requests to the server, no waiting or moving.
  • The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.
  • Despite the name Locked, it is not a chest lock, an item being secured, or any reason for being unable to move. The same flag is read as Paralyzed.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Check your own state - direct script

Parameters and execution flow:

  • The self argument explicitly selects its character. state - 1/0 only.
  • Despite the name Locked, it is not a chest lock, an item being secured, or any reason for being unable to move. The same flag is read as Paralyzed.
var state = UO.GetLocked("self");
var paralyzed = UO.Paralyzed();
UO.Print("GetLocked: " + Convert.ToString(state));
UO.Print("Paralyzed: " + Convert.ToString(paralyzed));

2. Check selected mobile - script function

Parameters and execution flow:

  • IsNpc excludes subject and unknown object. target stores one serial, not a live link to a changing lasttarget.
  • The result refers to the field IsParalyzed. The data is updated only after the client receives the appropriate state.
return  RunScenario();
 object? RunScenario()
{
    var target = UO.GetSerial("lasttarget");
    if (Truth(UO.IsNPC(target)))
    {
        var state = UO.GetLocked(target);
        UO.Print("Selected mobile state 1/0: " + Convert.ToString(state));
    }
    else
    {
        UO.Print("No loaded mobile selected");
    }

    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. Compare state before and after pause - script class

Parameters and execution flow:

  • UO.Wait(500) — pause in milliseconds. After it, it is separately checked that mobile still exists.
  • Two photographs are compared. Intermediate changes may be missed, and this is not a continuous subscription to server events.
return await new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenarioAsync();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

    async public Task<object?> RunScenarioAsync()
    {
        var target = UO.GetSerial("lasttarget");
        if (Truth(UO.IsNPC(target)))
        {
            var before = UO.GetLocked(target);
            await Delay(500);
            if (Truth(UO.IsNPC(target)))
            {
                var after = UO.GetLocked(target);
                if (Truth(before != after))
                {
                    UO.Print("Flag changed: " + Convert.ToString(before) + " -> " + Convert.ToString(after));
                }
            }
            else
            {
                UO.Print("Mobile left the local world");
            }
        }

        return null;
    }

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

Command implementation

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

UO.GetLocked(id) — UO.GetLocked(Any)

Parameters: id (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int GetLocked(InjectionValue id) => bridge.GetLocked(GetObject(id));

UO.GetName

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

C# signatures

string UO.GetName();
string UO.GetName(object? id);

Reads the name of an item or character known to the client.

Parameters

  • id — Serial/ID of the object, not the graphic/type. A number, a hex string, the standard name self/backpack/lasttarget/lastobject/lastcontainer/laststatus/finditem/lastcorpse, or the name AddObject. The alias must be set; existence is checked by Exists. The registered form without arguments uses self.

Return value

string — object name. An unknown object or a name that has not yet been obtained results in the empty string "". This is not serial, not type, or the complete list of properties from the tooltip.

Behavior

  • The latest data already known to the client is read; the update request is not sent to the server.
  • An unknown object and a property that has not yet been retrieved can have a null/empty value. Check Exists and conditions for a specific action.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Print character name - direct script

Parameters and execution flow:

  • Without an argument, self is used.
  • The result is the text of the name, it can be displayed directly.
var name = UO.GetName();
UO.Print(name);

2. Process unknown target name - script function

Parameters and execution flow:

  • lasttarget — object alias. GetName does not open a new target.
  • An empty name does not prove the absence of an object: first, information about serial could have come without a name.
return  RunScenario();
 object? RunScenario()
{
    var name = UO.GetName("lasttarget");
    if (Truth(name == ""))
    {
        UO.Print("Name is not available");
    }
    else
    {
        UO.Print("Target: " + name);
    }

    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. Compare name case insensitive - script class

Parameters and execution flow:

  • ToLowerInvariant converts the string to lowercase for comparison.
  • The name is set by the server and can be localized. To filter by graphic type, use FindType/GetGraphic.
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 name = UO.GetName("lastobject");
        if (Truth(Convert.ToString(name) == "gold"))
        {
            UO.Print("Known name matches");
        }

        return null;
    }

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

Parameters: No parameters.

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetName() => GetName("self");

UO.GetName(id) — UO.GetName(Any)

Parameters: id (Any/Integer/String)

Result: string / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "getname":

                case "charname": return new InjectionValue(bridge.GetName(Arg(0, bridge.Self)));

UO.GetName(id) — UO.GetName(Integer)

Parameters: id (Any/Integer/String)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetName(int id) => bridge.GetName(id);

UO.GetName(id) — UO.GetName(String)

Parameters: id (Any/Integer/String)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetName(string id) => GetName(GetObject(id));

UO.GetQuantity

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

C# signatures

int UO.GetQuantity(object? id);

Reads the number of units in one item stack.

Parameters

  • id — Serial/ID of the object, not the graphic/type. A number, a hex string, the standard name self/backpack/lasttarget/lastobject/lastcontainer/laststatus/finditem/lastcorpse, or the name AddObject. The alias must be set; existence is checked by Exists. The registered form without arguments uses self. For this command, id is required.

Return value

int — Amount field of a specific item. A stack of 1000 units typically returns 1000; single item - 1. For unknown serial and for character, 0 is returned. This is not the number of child items of the chest and not the items limit of the MassMove command.

Behavior

  • The latest data already known to the client is read; the update request is not sent to the server.
  • An unknown object and a property that has not yet been retrieved can have a null/empty value. Check Exists and conditions for a specific action.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. View the size of the found stack - direct script

Parameters and execution flow:

  • FindType searches for a type of gold of any color in a backpack.
  • gold contains one serial, so amount only applies to one stack found.
var gold = UO.FindType(0x0EED, -1, "backpack");
if (Truth(gold != ""))
{
    var amount = UO.GetQuantity(gold);
    UO.Print("Units in this stack: " + Convert.ToString(amount));
}

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

2. Check minimum quantity - script function

Parameters and execution flow:

  • id=sample - last used item.
  • 50 means the ones in the given stack. 50 individual items are not counted here.
return  RunScenario();
 object? RunScenario()
{
    var sample = UO.GetSerial("lastobject");
    if (Truth(UO.Exists(sample)))
    {
        if (Truth(UO.GetQuantity(sample) >= 50))
        {
            UO.Print("At least 50 units in this item");
        }
    }

    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. Distinguish number of stacks from ones - scenario class

Parameters and execution flow:

  • FindCount refers to the last search results; GetQuantity - to one serial.
  • Numbers can vary greatly. MassMove quantity limits entire items, including stacks.
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 item = UO.FindType(0x0EED, -1, "backpack");
        var stacks = UO.FindCount();
        if (Truth(item != ""))
        {
            var units = UO.GetQuantity(item);
            UO.Print("Matching items: " + Convert.ToString(stacks));
            UO.Print("Units in selected item: " + Convert.ToString(units));
        }

        return null;
    }

    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.GetQuantity(id) — UO.GetQuantity(Any)

Parameters: id (Any/Integer/String)

Result: int / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "getquantity": return new InjectionValue(bridge.GetQuantity(Arg(0)));

UO.GetQuantity(id) — UO.GetQuantity(Integer)

Parameters: id (Any/Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int GetQuantity(int id) => bridge.GetQuantity(id);

UO.GetQuantity(id) — UO.GetQuantity(String)

Parameters: id (Any/Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int GetQuantity(string id) => GetQuantity(GetObject(id));

UO.GetSerial

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

C# signatures

string UO.GetSerial();
string UO.GetSerial(object? id);

Resolves the object's name to its serial and formats serial as a hex string.

Parameters

  • id - Optional string: standard alias, name AddObject or numeric text (decimal/hex). Without an argument, the serial of the current character is used.

Return value

string of the form "0x40001234" - a unique serial/ID object, eight hex digits after 0x. The unresolved name is given by "0x00000000". This is not type. Numeric text is formatted even if no such object is loaded; GetSerial does not check Exists by itself.

Behavior

  • Alias ​​names are read from the current script/client state. The stored string serial does not change automatically if the alias subsequently points to another object.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Get ID of your character - direct script

Parameters and execution flow:

  • There are no parameters, self is selected.
  • serial — hex string. The value 0x00000000 means no serial character.
var serial = UO.GetSerial();
UO.Print(serial);

2. Safely Use Last Name Selected - Script Function

Parameters and execution flow:

  • id="lasttarget" resolves to serial of the last target.
  • Exists checks for the existence of an object, GetName reads its name known to the client.
return  RunScenario();
 object? RunScenario()
{
    var serial = UO.GetSerial("lasttarget");
    if (Truth(UO.Exists(serial)))
    {
        UO.Print(UO.GetName(serial));
    }
    else
    {
        UO.Print("Target is not loaded");
    }

    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. Compare Numeric Representations - Script Class

Parameters and execution flow:

  • id is a string with decimal serial 1073746484.
  • The result 0x40001234 shows the formatting. This is an example of a number, it does not create an object and does not guarantee its existence.
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 serial = UO.GetSerial("1073746484");
        UO.Print(serial);
        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.GetSerial() — UO.GetSerial()

Parameters: No parameters.

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetSerial() => NumberConversions.ToHex(bridge.Self);

UO.GetSerial(id) — UO.GetSerial(String)

Parameters: id (String)

Result: string / String.

During a call:

Internal implementation code; this is not a standalone script.

public string GetSerial(string id) => NumberConversions.ToHex(GetObject(id));

UO.GetTooltip

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

C# signatures

dynamic UO.GetTooltip(object? objID);

Reads the finished object properties text from OPL. GetTooltip and GetCliloc are synonyms.

Parameters

  • objID — Required serial/ID object, not type and not cliloc. Allows int, decimal/hex string, self, backpack, lasttarget, finditem or name AddObject. 0 means no object.

Return value

string — name and text of properties, separated by line feed, or only the non-empty part. Empty string if ObjID=0 or if properties are not received. This is a ready-made text; numeric ID cliloc and parameters are returned by GetTooltipRec.

Behavior

  • If the entry already exists in OPL, its text is returned immediately. If there is no entry, a property request is sent and a response is expected up to 200 ms with a check every 10 ms. A pause does not guarantee a response.
  • We need an accessible object and support for properties by the server. An empty result is not proof that the object does not exist: use Exists separately.
  • The text may contain server markup. Don't parse numeric properties by line position; use GetTooltipRec for this.

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.GetTooltip("backpack");
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Properties of an item in a backpack - direct script

Parameters and execution flow:

  • FindType: gold 0x0EED, any hue=-1, direct contents of the backpack. ObjID=item — found serial.
  • The getter result is text, not the amount of gold. For quantity use FindCount(item).
var item = UO.FindType(0x0EED, -1, "backpack");
if (Truth(item != ""))
{
    UO.Print(UO.GetTooltip(item));
}

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

2. Handle No Response - Script Function

Parameters and execution flow:

  • ObjID=lasttarget must point to the desired object.
  • An empty string is processed separately; There is no need to automatically repeat the request in an endless loop.
return  RunScenario();
 object? RunScenario()
{
    var text = UO.GetTooltip("lasttarget");
    if (Truth(text == ""))
    {
        UO.Print("No properties received");
    }
    else
    {
        UO.Print(text);
    }

    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. Save text until next action - script class

Parameters and execution flow:

  • id and saved are separate variables: the unique ID of the object and a snapshot of its text.
  • saved will not change automatically if the properties on the server later change.
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.GetSerial("lasttarget");
        var saved = UO.GetTooltip(id);
        UO.Print("Object: 0x" + Hex(id));
        UO.Print(saved);
        return null;
    }

    string Hex(object? value) => Convert.ToInt64(value).ToString("X");
}

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

Parameters: objID (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "getcliloc":

                case "gettooltip":

                    return new InjectionValue(bridge.GetTooltip(Arg(0)));

UO.GetTooltipRec

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

C# signatures

dynamic UO.GetTooltipRec(object? objID);

Reads structured properties: cliloc ID and parameters of each entry OPL.

Parameters

  • objID — Required serial/ID object, not type and not cliloc. Allows int, decimal/hex string, self, backpack, lasttarget, finditem or name AddObject. 0 means no object.

Return value

Array is a single snapshot of property rows. Each line is equal to [clilocID:int, parameters:Array]. rows[i][0] is the number of the localized message, rows[i][1] is an array of parameters. ArrayLength(rows) — number of properties; ArrayLength(parameters) — the number of parameters for one property. An empty array if ObjID=0 or no records received. This is not a list of ID items or a finished text.

Behavior

  • The cache entry is returned immediately. If OPL is missing, properties are queried with a wait of up to 120 ms; canceling the procedure interrupts the wait. The known empty OPL does not cause anticipation.
  • Initial service tabs are skipped as in ClilocLoader. Empty internal parameters save positions; #The number is saved as a string for subsequent localization. Unknown parameters produce an empty array.
  • Changing the returned array does not change the client's cache. For text use GetTooltip/GetCliloc; to translate one line - GetClilocByID(clilocID, parameters).

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.GetTooltipRec("lasttarget");
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. View all property numbers - direct script

Parameters and execution flow:

  • ObjID=lasttarget - object. rows contains properties, i is the index from 0. row[0] is cliloc, not serial.
  • The loop does not run for an empty array. Each entry is processed once.
var rows = UO.GetTooltipRec("lasttarget");
var i = 0;
while (Truth(i < ArrayLength(rows)))
{
    var row = rows[i];
    UO.Print("Cliloc: " + Convert.ToString(row[0]));
    i = i + 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;

2. Translate each record with its parameters - script function

Parameters and execution flow:

  • GetClilocByID receives clilocID=row[0] and substitution array=row[1].
  • The parameters are kept in order. Don't pass the entire row instead of an array of parameters.
return  RunScenario();
 object? RunScenario()
{
    var rows = UO.GetTooltipRec("lasttarget");
    var i = 0;
    while (Truth(i < ArrayLength(rows)))
    {
        var row = rows[i];
        var text = UO.GetClilocByID(row[0], row[1]);
        UO.Print(text);
        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;

3. Get the numeric parameter of a known property - script class

Parameters and execution flow:

  • wanted - example of ID properties; replace with the desired cliloc. args[0] is the first parameter, initially a string.
  • The number of parameters and the number format are checked before Val. The parameter can be text or a #cliloc link.
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 rows = UO.GetTooltipRec("lasttarget");
        var wanted = 1060401;
        var i = 0;
        while (Truth(i < ArrayLength(rows)))
        {
            var row = rows[i];
            var args = row[1];
            if (Truth(row[0] == wanted) && Truth(ArrayLength(args) > 0))
            {
                if (Truth(IsNumeric(args[0])))
                {
                    UO.Print("Value: " + Convert.ToString(Val(args[0])));
                }
            }

            i = i + 1;
        }

        return null;
    }

    int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;
    bool IsNumeric(object? value) => double.TryParse(Convert.ToString(value), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out _);
    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
    double Val(object? value) => double.TryParse(Convert.ToString(value), System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out var number) ? number : 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.GetTooltipRec(objID) — UO.GetTooltipRec(Any)

Parameters: objID (Any)

Result: dynamic / Array.

During a call:

Internal implementation code; this is not a standalone script.

case "gettooltiprec":

                    return new InjectionValue(bridge.GetTooltipRecords(Arg(0)).Select(entry =>

                        new InjectionValue(new[]

                        {

                            new InjectionValue(entry.ClilocID),

                            new InjectionValue(entry.Parameters.Select(value => new InjectionValue(value)).ToArray())

                        })).ToArray());

UO.GetType

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

C# signatures

dynamic UO.GetType(object? objID);

Reads the numeric graphic of an item or character's body.

Parameters

Return value

int — graphic/type of an item or character's body, for example 0x0EED (3821) for gold. The value 0 is returned if the object is not found. GetType does not return serial or the text "0x..."; the string form is given by GetGraphic.

Behavior

  • The command reads the client's local data. It does not send target and does not change the object on the server.
  • The number 0 may be a valid data value. Check for the absence of an object by Exists(serial), and not just by the value of its property.

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.GetType("lastobject");
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Compare numeric type with constant - direct script

Parameters and execution flow:

  • ObjID="lastobject" - alias of a specific object.
  • 0x0EED is the number graphic; The comparison does not look for an object with this serial.
var graphic = UO.GetType("lastobject");
if (Truth(graphic == 0x0EED))
{
    UO.Print("Gold graphic");
}

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

2. Get the type of your own backpack - script function

Parameters and execution flow:

  • ObjID="backpack" - current backpack.
  • Convert.ToString formats the returned number for output.
return  RunScenario();
 object? RunScenario()
{
    var graphic = UO.GetType("backpack");
    UO.Print("Backpack type: " + Convert.ToString(graphic));
    return null;
}

3. Check the existence of an object before reading type - script class

Parameters and execution flow:

  • The empty string FindType is checked before Exists.
  • Exists returns the boolean 1/0; GetType returns the number of the graphic.
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 item = UO.FindType(0x0EED, -1, "backpack");
        if (Truth(item != ""))
        {
            if (Truth(UO.Exists(item)))
            {
                UO.Print("Type: " + Convert.ToString(UO.GetType(item)));
            }
        }

        return null;
    }

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

Parameters: objID (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "gettype": return new InjectionValue(bridge.GetGraphics(Arg(0)));

UO.Grab

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

C# signatures

int UO.Grab();
int UO.Grab(object? id);
int UO.Grab(object? amount, object? id);
int UO.Grab(object? amount, object? item, object? container);
int UO.Grab(object? amount, object? item, object? container, object? timeout);

Transfers an item to the specified/receiving container, or opens the item selection.

Parameters

  • id — Serial/alias of the item. Without arguments, interactive selection begins; with one argument exactly 1 the unit of this item is taken.
  • item — Serial/alias of the item. Without arguments, interactive selection begins; with one argument exactly 1 the unit of this item is taken.
  • id / item — Serial/alias of the item. Without arguments, interactive selection begins; with one argument exactly 1 the unit of this item is taken.
  • amount - In forms 2..4 - quantity as the first argument, then item. 0 means the entire stack according to the rules MoveItem; do not change the order with the Grab(item) form.
  • container - Forms 3/4 only: Explicit assignment. Without it - state.ReceivingContainer, if >0, otherwise backpack. The lines self/my/backpack in the destination mean backpack; ground - ground.
  • timeout — 4 form only, milliseconds. Sent to CompactMoveItem awaiting confirmation; The ground coordinates are taken from self, the container - 0xFFFF/0xFFFF/0.

Return value

Numeric flag int: 1 — interactive selection accepted, or transfer accepted/confirmed according to the selected form; 0 - failure/no suitable item. A no-argument result does not mean that the item has already been transferred.

Behavior

  • CompactGrab retains the historical form Grab(item)=1 unit. Forms without timeout use CompactMoveItem without forcing a confirmation wait; the form with timeout specifies UO.Wait=true.
  • Serial 0 immediately gives 0. Unresolved/inappropriate objects are checked further by MoveItem. Server rules, stack amount and current container affect the result. Three/four arguments are not drop coordinates.
  • amount<=0 requests the entire stack. In a form with timeout, a negative pause becomes 0, but at least one local check is performed; between checks UO.Wait(10). Partial transfer is confirmed by a decrease in the initial quantity, complete transfer is confirmed by the assignment and for ground X/Y/Z. This is an observation of the state of the world, not a fresh protocol response from the ID request; an already suitable state can give 1 immediately. Timeout gives 0 even though the request may have already been sent.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Direct call - direct script

Parameters and execution flow:

  • Transfers an item to the specified/receiving container, or opens the item selection.
var accepted = UO.Grab();
UO.Print(accepted);

2. Explicit option - script function

Parameters and execution flow:

  • CompactGrab retains the historical form Grab(item)=1 unit. Forms without timeout use CompactMoveItem without forcing a confirmation wait; the form with timeout specifies UO.Wait=true.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.Exists("lastobject")))
    {
        UO.Print(UO.Grab("lastobject"));
    }

    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:

  • Serial 0 immediately gives 0. Unresolved/inappropriate objects are checked further by MoveItem. Server rules, stack amount and current container affect the result. Three/four arguments are not drop coordinates.
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()
    {
        if (Truth(UO.Exists("lastobject")))
        {
            UO.Print(UO.Grab(0, "lastobject", "backpack", 2000));
        }

        return null;
    }

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

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Grab() => bridge.RequestInteractiveGrabTarget();

UO.Grab(id) — UO.Grab(Any)

Parameters: id (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Grab(InjectionValue id) => CompactGrab(new[] { id });

UO.Grab(amount, id) — UO.Grab(Any,Any)

Parameters: amount (Any/Integer/String), id (Any/Integer/String)

Result: int / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "grab": return new InjectionValue(CompactGrab(arguments));

UO.Grab(amount, id) — UO.Grab(Integer,Integer)

Parameters: amount (Any/Integer/String), id (Any/Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Grab(int amount, int id) => CompactGrab(new[] { new InjectionValue(amount), new InjectionValue(id) });

UO.Grab(amount, id) — UO.Grab(Integer,String)

Parameters: amount (Any/Integer/String), id (Any/Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Grab(int amount, string id) => CompactGrab(new[] { new InjectionValue(amount), new InjectionValue(id) });

UO.Grab(amount, id) — UO.Grab(String,String)

Parameters: amount (Any/Integer/String), id (Any/Integer/String)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int Grab(string amount, string id) => CompactGrab(new[] { new InjectionValue(amount), new InjectionValue(id) });

UO.Grab(amount, item, container) — UO.Grab(Any,Any,Any)

Parameters: amount (Any), item (Any), container (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactGrab(values))

UO.Grab(amount, item, container, timeout) — UO.Grab(Any,Any,Any,Any)

Parameters: amount (Any), item (Any), container (Any), timeout (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactGrab(values))

UO.IsMovable

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

C# signatures

int UO.IsMovable(object? objID);

Checks local signs of portability of a known item using the Classic UO selection rules.

Parameters

  • objID — Mandatory serial/ID of a specific object: int, hex-string or alias self, backpack, lasttarget, lastobject, lastcontainer, laststatus, finditem, lastcorpse or name AddObject. This is not a graphic/type. Unspecified name resolves to 0; the command does not open any new target.

Return value

int 1 - the item is not removed, not multi, and not blocked by the local weight/Movable rule for items on the ground. int 0 — mobile, multi, unknown/removed item or blocked item on the ground. 1 does not guarantee a successful Drag/MoveItem: range, access, cursor state and final server decision are checked separately.

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

Behavior

  • The local client model is read; There are no requests to the server, no waiting or moving.
  • The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.
  • On the ground, an item is considered locked when the weight of its tiledata entry is greater than 90 and the Movable server flag is missing. Weights 90 and smaller do not require this flag.
  • Inside a container, the rule of blocking an item on the ground does not apply. The weight of tiledata here is a service attribute, not GetQuantity and not the current weight of the character.
  • Other customer documentation may have different weight descriptions. This describes the actual rule GameActions.PickUp of this client.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

var result = UO.IsMovable(UO.GetSerial("lastobject"));
UO.Print("IsMovable: " + Convert.ToString(result));

1. Check the last item without moving - direct script

Parameters and execution flow:

  • item - serial of the last used item. The number of movable is not its quantity.
  • The example does not pick up anything and does not send anything to the server.
var item = UO.GetSerial("lastobject");
var movable = UO.IsMovable(item);
UO.Print("Locally movable 1/0: " + Convert.ToString(movable));

2. Separately estimate the sign and distance - script function

Parameters and execution flow:

  • For an item on the ground, GetDistance shows the client's known range.
  • Even with movable=1 the item may be too far away. A positive result does not indicate permission from the server to transfer.
return  RunScenario();
 object? RunScenario()
{
    var item = UO.GetSerial("lasttarget");
    if (Truth(UO.Exists(item)))
    {
        var movable = UO.IsMovable(item);
        var distance = UO.GetDistance(item);
        UO.Print("Movable: " + Convert.ToString(movable));
        UO.Print("Distance: " + Convert.ToString(distance));
    }

    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. Check entire found stack - script class

Parameters and execution flow:

  • FindType selects one gold serial of any color in the backpack.
  • IsMovable checks the entire item. GetQuantity reads the number of units separately; the result IsMovable does not replace this counter.
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 item = UO.FindType(0x0EED, -1, "backpack");
        if (Truth(item != ""))
        {
            if (Truth(UO.IsMovable(item)))
            {
                var units = UO.GetQuantity(item);
                UO.Print("Selected stack units: " + Convert.ToString(units));
            }
        }

        return null;
    }

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

Parameters: objID (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "ismovable": return new InjectionValue(bridge.IsMovable(Arg(0)));

UO.IsObjectExists

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

C# signatures

int UO.IsObjectExists(object? objID);

Checks the presence of a non-deleted object in the client's local world.

Parameters

  • objID — Mandatory serial/ID of a specific object: int, hex-string or alias self, backpack, lasttarget, lastobject, lastcontainer, laststatus, finditem, lastcorpse or name AddObject. This is not a graphic/type. Unspecified name resolves to 0; the command does not open any new target.

Return value

int 1 - serial is now resolved into the loaded item or mobile. int 0 — the object is unknown to the client, deleted or the alias is not set. This is not a server response about the existence of an object: an item outside the visible area may exist on the server and give 0 here.

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

Behavior

  • The local client model is read; There are no requests to the server, no waiting or moving.
  • The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.

Standalone C# scripts

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

Simple example

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

The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.

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

1. Check if backpack is available - direct script

Parameters and execution flow:

  • Argument backpack is an alias serial of your own character’s backpack.
  • 1 does not mean that the contents of the backpack have already been fully received or that it has been opened.
var present = UO.IsObjectExists("backpack");
if (Truth(present))
{
    UO.Print("Backpack is loaded");
}
else
{
    UO.Print("Backpack is unavailable");
}

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

2. Recheck saved serial - script function

Parameters and execution flow:

  • target saves a specific serial. The new lasttarget value will not replace it.
  • After the pause 500 ms, the object could have gone out of visibility, so the check is performed again.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var target = UO.GetSerial("lasttarget");
    await Delay(500);
    if (Truth(UO.IsObjectExists(target)))
    {
        UO.Print(UO.GetName(target));
    }
    else
    {
        UO.Print("Saved target is no longer loaded");
    }

    return null;
}

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

3. Distinguish ID formatting from object presence - script class

Parameters and execution flow:

  • GetSerial formats the number 1073746484 as 0x40001234 even if there is no object.
  • Only the next check reports the presence of this serial in the current local world.
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 serial = UO.GetSerial("1073746484");
        UO.Print("Serial: " + serial);
        var present = UO.IsObjectExists(serial);
        UO.Print("Present 1/0: " + Convert.ToString(present));
        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.IsObjectExists(objID) — UO.IsObjectExists(Any)

Parameters: objID (Any)

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "isobjectexists": return new InjectionValue(bridge.Exists(Arg(0)));

UO.LastObject

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

C# signatures

dynamic UO.LastObject();

Reads the serial of the last used object.

Parameters

There are no parameters.

Return value

int — saved serial; 0 means serial is not installed. It's not a bool or a graphic/type; a nonzero ID may no longer exist in the world.

Behavior

  • Field source: _world.LastObject. The command does not select, use, or attack the object.
  • 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.LastObject();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1. Direct call - direct script

Parameters and execution flow:

  • Reads the serial of the last used object.
var id = UO.LastObject();
UO.Print(Hex(id));

string Hex(object? value) => Convert.ToInt64(value).ToString("X");

2. Explicit option - script function

Parameters and execution flow:

  • Field source: _world.LastObject. The command does not select, use, or attack the object.
return  RunScenario();
 object? RunScenario()
{
    var id = UO.LastObject();
    if (Truth(id != 0) && Truth(UO.Exists(id)))
    {
        UO.Print(UO.GetName(id));
    }

    return null;
}

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

3. Full Helper Function - Script Class

Parameters and execution flow:

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

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "lastobject": return new InjectionValue(bridge.GetLastObject());

UO.MakeFakeItem

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

C# signatures

void UO.MakeFakeItem(object? @type);
void UO.MakeFakeItem(object? @type, object? serial);
void UO.MakeFakeItem(object? @type, object? serial, object? count);
void UO.MakeFakeItem(object? @type, object? serial, object? count, object? color);
void UO.MakeFakeItem(object? @type, object? serial, object? count, object? color, object? x);
void UO.MakeFakeItem(object? @type, object? serial, object? count, object? color, object? x, object? y);

Creates or modifies only a local client item.

Parameters

  • type — Mandatory graphic 1..65535; not a named type resolved through ResolveType: this legacy branch uses Arg/int.
  • serial — Optional item serial. 0 (default) allocates a free ID from the local range around 0x7FFEFFFF; an explicit item serial can match an already loaded item and change its local model.
  • count - Optional quantity, default 1. The non-positive becomes 1; maximum 65535.
  • color — Optional hue, default 0; limited to 0..65535.
  • x - Optional world coordinates, defaults to self; negative ones use self, then limit themselves to 0..65535. Z is always the current Player.Z.
  • y - Optional world coordinates, defaults to self; negative ones use self, then limit themselves to 0..65535. Z is always the current Player.Z.

Return value

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

Behavior

  • CreateFakeItem requires Player and a valid graphic/item serial. GetOrCreateItem returns the local model; if it is in a container, deletes the connection. Assigns ground container 0xFFFFFFFF, graphic/amount/hue/X/Y/Z, Layer.Invalid, AllowedToDraw=true, IsDamageable=false and IsMulti=false.
  • The Legacy command discards the returned serial. When 0 displays an error message. The server does not create the item: the action does not provide a real item, loot, or transfer rights. For example, leave serial=0.

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.MakeFakeItem");
UO.MakeFakeItem(0x0E21);

1. Direct call - direct script

Parameters and execution flow:

  • Creates or modifies only a local client item.
UO.MakeFakeItem(0x0E21);

2. Explicit option - script function

Parameters and execution flow:

  • CreateFakeItem requires Player and a valid graphic/item serial. GetOrCreateItem returns the local model; if it is in a container, deletes the connection. Assigns ground container 0xFFFFFFFF, graphic/amount/hue/X/Y/Z, Layer.Invalid, AllowedToDraw=true, IsDamageable=false and IsMulti=false.
return  RunScenario();
 object? RunScenario()
{
    UO.MakeFakeItem(0x0E21, 0, 5, 0);
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • The Legacy command discards the returned serial. When 0 displays an error message. The server does not create the item: the action does not provide a real item, loot, or transfer rights. For example, leave serial=0.
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.MakeFakeItem(0x0E21, 0, 1, 0, UO.GetX(), UO.GetY());
        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.MakeFakeItem(type) — UO.MakeFakeItem(Any)

Parameters: type (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MakeFakeItem(type, serial) — UO.MakeFakeItem(Any,Any)

Parameters: type (Any), serial (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MakeFakeItem(type, serial, count) — UO.MakeFakeItem(Any,Any,Any)

Parameters: type (Any), serial (Any), count (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MakeFakeItem(type, serial, count, color) — UO.MakeFakeItem(Any,Any,Any,Any)

Parameters: type (Any), serial (Any), count (Any), color (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MakeFakeItem(type, serial, count, color, x) — UO.MakeFakeItem(Any,Any,Any,Any,Any)

Parameters: type (Any), serial (Any), count (Any), color (Any), x (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MakeFakeItem(type, serial, count, color, x, y) — UO.MakeFakeItem(Any,Any,Any,Any,Any,Any)

Parameters: type (Any), serial (Any), count (Any), color (Any), x (Any), y (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    break;

                }

UO.MassMove

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

C# signatures

void UO.MassMove();
void UO.MassMove(object? delay);
void UO.MassMove(object? delay, object? quantity);
void UO.MassMove(object? delay, object? quantity, object? @type);
void UO.MassMove(object? delay, object? quantity, object? @type, object? destination);
void UO.MassMove(object? delay, object? quantity, object? @type, object? destination, object? x, object? y, object? z);

Enables a one-time mass transfer of items of the selected type. After Activate MassMove, drag one suitable item with the mouse: the source container is determined from it. Other items of this type from the same source follow automatically. The third parameter is TYPE/Graphic, not the item's ID. All forms include waiting for the first manual transfer; the explicit destination specifies where it will go.

Parameters

  • delay — The first parameter is the delay between transfer requests in milliseconds, an integer from 0 to 2147483647. 350 means 0,35 seconds. With 0 no more than one next carry is sent per game frame. No delay is added to GrabDelay. A negative value disables the mode and clears the queue; for switching off, a clear UO.MassMove() notation is preferred.
  • quantity - The second parameter is the TOTAL limit of individual items (items), including the first manual transfer. One stack/stack is considered one item, regardless of the quantity inside. 50 means up to 50 whole stacks or 50 single items. The stack is NOT split at this limit. 0 or no parameter - all suitable items. Negative values ​​are not allowed.
  • type - The third parameter is the item type code (Graphic/Type), the integer 0..65535, for example 0x0EED or the string "0x0EED" for gold. This is NOT serial/ID and NOT the name AddObject. 0 or absence determines the type by the first manual transfer. With an explicit type, dragging another type does not activate the queue; The mode continues to wait for a suitable item.
  • destination — The fourth parameter is the purpose. Serial of the chest (number/hex-string) or stored name AddObject selects the container; X/Y is a place inside its window. backpack, self and my select the current character's backpack, also with coordinates inside the backpack. ground or 0 selects land: X/Y/Z - absolute position on the map, all three parameters are required. lastcontainer — last opened container; lastobject, lasttarget, lastcorpse, finditem, laststatus are valid if they point to an available container. receiving and catchbag select the installed SetCatchBag container, and if it is not installed, the backpack. self/my here means the backpack, although GetX(self) reads the character's position. Names are compared in a case-insensitive manner; an unknown or not yet set name gives an error rather than dropping the item to the ground. Without destination, the location is remembered from the first manual reset: you can put the sample either inside the container or on the ground. For the earth, the world X/Y/Z of the first reset is remembered.
  • x — Fifth parameter. For a container, the coordinate inside the container; -1 or 65535 means automatic placement. For land, the absolute map coordinate, from 0 to 65535. For a form without X/Y/Z, -1 is used in an explicit container.
  • y — Sixth parameter. For a container - the coordinate inside the container, -1/65535 for automatic placement; for the ground - the absolute map coordinate 0..65535. For a form without coordinates in an explicit container, use -1.
  • z — The seventh parameter is the destination height, integer -128..127. The container usually contains 0; on the ground indicate the actual height. In the short form, the height and X/Y are taken from the manual transfer.

Return value

void: no value. Activate MassMove means to enable manual transfer waiting. The total line reports the number of individual items for which requests were sent, including the first one. A stack is considered one item; the result does not confirm the acceptance of each request by the server.

Behavior

  • Forms with 0, 1, 2, 3, 4 and 7 arguments are registered. X/Y/Z are specified only together. Forms with 5, 6 or 8 arguments are not supported. Order: delay, quantity, type, destination, x, y, z.
  • Activate the BEFORE mouse capture mode. The first manual transfer is considered one item: the stack from 1000 is transferred entirely and consumes only one space from the limit 50. The enabled mode takes full stacks without a split dialog. If part of the stack was taken before inclusion, the transfer is rejected: put the part back and start again.
  • One activation refers to one manual transfer. After selecting a sample, the selection mode turns off; the remaining queue is processed automatically. A normal call to MoveItem from another script does not count as manual sample selection.
  • The Graphic type is compared. Color is not filtered in this command. Only the direct contents of the source container are processed; The enclosed bags do not open. New items that appear after the queue is created are not added to it. If the sample was lying on the ground, loaded objects of the same type within the capture radius are taken into account.
  • Quantity is the upper limit of requests. The command does not automatically retry transfers rejected by the server. If the server fails, the destination is unavailable, the character dies, or the inability to take the next item, the operation is terminated. When the cursor is busy, the queue waits up to 5 seconds to become free.
  • UO.MassMove() turns off the mode and cancels the remaining queue. UO.TerminateAll() and leaving the character also cancel it. A request that has already been sent is not rolled back by cancellation. The queue is executed by the client after the command returns; the next line of the script does not mean that the server has already completed the transfer.
  • To completely migrate different types of content, use EmptyContainer. To carry one specific item - MoveItem. The eight arguments source, type, color, destination, x, y, z, delay refer to MoveItems, not MassMove.
  • Repeatedly calling the same command correctly, while the mode is still waiting for the first mouse drag, turns off the waiting: Deactivate MassMove/MassPriceMove appears directly in the game window. The next call turns the mode back on. After the first transfer, use the no-argument form to stop the remaining queue. Requests that have already been sent are not rolled back.

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.MassMove");
UO.MassMove(350, 0);

1. Enable mouse transfer without limiting the number - direct script

Parameters and execution flow:

  • delay=350: The next requests are separated by at least 350 ms. quantity=0: There is no upper user limit.
  • type, destination and X/Y/Z are not transmitted. After Activate MassMove, drag the sample from the bag to the chest: the type and source are taken from it, the destination is from the drop location.
  • If the sample is gold, the loaded gold stacks of the same original container are moved. Items of other types remain. Print only explains the subsequent manual action.
UO.MassMove(350, 0);
UO.Print("Drag one sample item to the destination container");

2. Transfer 50 whole stacks from 100 - script function

Parameters and execution flow:

  • delay sets 350 ms. total is passed to the second quantity parameter and limits the ENTIRE operation 50 to individual items.
  • If the source contains 100 stacks of the same type, 50 entire stacks will be transferred: the first manual one and another 49. Each stack may contain a different amount; it does not affect the counter. If these are single items, 50 single items are transferred.
  • There are no other options: the first capture and assignment are selected by the mouse after calling.
return  RunScenario();
 object? RunScenario()
{
    var delay = 350;
    var total = 50;
    UO.MassMove(delay, total);
    return null;
}

3. Select the type of gold and set the chest in advance - scenario class

Parameters and execution flow:

  • goldType - TYPE gold, not ID a separate stack. AddObject saves the serial of the chest in the chest; replace 0x40005678 with your ID.
  • delay=350 ms, quantity=50 individual items, type=0x0EED, destination=chest. The limit includes the first pile and no more than 49; the whole thing.
  • x=-1 and y=-1 set automatic placement in the chest, z=0. These are all seven parameters.
  • The queue will begin after manually dragging the gold. His original bag will become the source. An explicit chest replaces the mouse reset location; an item of another type does not start the queue.
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 goldType = "0x0EED";
        UO.AddObject("chest", "0x40005678");
        UO.MassMove(350, 50, goldType, "chest", -1, -1, 0);
        UO.Print("Now drag one gold stack from the source bag");
        return null;
    }
}

4. Select a sample with the mouse, but set the ground in advance - direct script

Parameters and execution flow:

  • delay=350 ms, quantity=0 — all suitable items. type=0 takes the type from the future manual transfer.
  • destination=0 means land, so the full triple x,y,z is given. GetX/GetY/GetZ here returns the character's current position.
  • After calling, pick up and drop the sample with the mouse. The command will send it and other matching items to the specified coordinates, even if the mouse was over the container. The server checks the availability of land.
var x = UO.GetX();
var y = UO.GetY();
var z = UO.GetZ();
UO.MassMove(350, 0, 0, 0, x, y, z);

5. Move up to ten items of a known type into a backpack - script function

Parameters and execution flow:

  • delay=500 — half a second; quantity=10 - ten individual items/stacks for the entire operation.
  • type=0x0F7A – graphic type of the item. Please indicate your type; serial number of the form 0x40001234 is not allowed here.
  • destination=backpack — character’s backpack. The coordinates are not transmitted, so x=-1, y=-1, z=0 are used inside it.
  • The source is selected by first manually transferring a suitable item. If the source is already a backpack, choose a different source bag for useful carry.
return  RunScenario();
 object? RunScenario()
{
    UO.MassMove(500, 10, "0x0F7A", "backpack");
    UO.Print("Drag one matching item from the source chest");
    return null;
}

6. Select a place inside a chest based on an item already lying - scenario class

Parameters and execution flow:

  • First, manually place the item in the desired location in the chest. The first AddObject selects the chest itself and stores it ID in the chest. The second one selects the item inside it and stores ID in position_sample.
  • GetX/GetY for an item inside a container returns its coordinates inside that container. They do not depend on where the chest window is located on the screen.
  • delay=350 ms, quantity=50 integer items, type=0 determined by future manual transfer from the source, destination=chest.
  • x and y define the selected location inside the chest, the last z=0. The position_sample object only serves to read coordinates; the source and type being migrated are determined by subsequent manual migration.
  • For a backpack, replace chest with backpack or self. For land, use ground and map coordinates such as UO.GetX(), UO.GetY(), UO.GetZ() without arguments for the character's current position.
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("Select the destination chest");
        UO.AddObject("chest");
        UO.Print("Select an item already at the desired position inside that chest");
        UO.AddObject("position_sample");
        var x = UO.GetX("position_sample");
        var y = UO.GetY("position_sample");
        UO.MassMove(350, 50, 0, "chest", x, y, 0);
        UO.Print("Drag one source item to start the transfer");
        return null;
    }
}

7. From the chest to the ground: select a place with the mouse - direct script

Parameters and execution flow:

  • delay=350 — at least 350 ms between subsequent requests. quantity=50 - up to 50 individual items/entire stacks, including a sample; these are not 50 units from the same stack.
  • After Activate MassMove, pick up the item in the open chest and place it on the ground with your mouse. Its type and original chest are determined by the pattern; world X/Y/Z destinations are remembered at the location of this reset.
  • The remaining loaded items of the same type from this chest are sent to the same point on the ground. The contents of nested bags and other types are not affected. For all matching items, replace 50 with 0.
  • MassMove has no return value. The procedure ends after the mode is enabled, the queue continues to work in the client. The final message counts requests sent, not server confirmations. To cancel the remaining queue, call UO.MassMove().
UO.MassMove(350, 50);
UO.Print("Drag one item from the chest onto the ground");

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

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

UO.MassMove(delay) — UO.MassMove(Any)

Parameters: delay (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

UO.MassMove(delay, quantity) — UO.MassMove(Any,Any)

Parameters: delay (Any), quantity (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

UO.MassMove(delay, quantity, type) — UO.MassMove(Any,Any,Any)

Parameters: delay (Any), quantity (Any), type (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

UO.MassMove(delay, quantity, type, destination) — UO.MassMove(Any,Any,Any,Any)

Parameters: delay (Any), quantity (Any), type (Any), destination (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

UO.MassMove(delay, quantity, type, destination, x, y, z) — UO.MassMove(Any,Any,Any,Any,Any,Any,Any)

Parameters: delay (Any), quantity (Any), type (Any), destination (Any), x (Any), y (Any), z (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

Clone this wiki locally