EN UO Topic shops vendors - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

Shops & Vendors

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

Buying, selling, store listings, delays and personal merchant prices. AllPrice and MassPriceMove use the item type where specified in their parameters.

Buying and selling: procedure

Open full catalog and examples

Sections

Topic Commands and explanations
Buy UO.Buy
Sell UO.Sell
AutoBuy UO.AutoBuy
AutoSell UO.AutoSell
Shop List UO.GetShopList · UO.ClearShopList · UO.Shop
Prices UO.GetPrice · UO.AllPrice · UO.MassPriceMove
VendorMenu UO.VendorMenu
SendShopReply UO.SendShopReply

All theme commands

Buying / Selling

UO.Buy · UO.Sell · UO.AutoBuy · UO.AutoBuyEx · UO.AutoSell · UO.Shop · UO.GetShopList · UO.ClearShopList · UO.VendorMenu · UO.SendShopReply

Prices

UO.GetPrice · UO.AllPrice · UO.MassPriceMove

Delays

UO.GetAutoBuyDelay · UO.GetAutoSellDelay · UO.SetAutoBuyDelay · UO.SetAutoSellDelay

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

Parameters, result and all scenarios

UO.AllPrice(125);
UO.Print("Drop goods into your vendor inventory");

UO.MassPriceMove

Parameters, result and all scenarios

UO.MassPriceMove(350, 50, 0, 125);
UO.Print("Drag one complete stack into your vendor bag");

Complete command reference


UO.AllPrice

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

C# signatures

void UO.AllPrice();
void UO.AllPrice(object? price);
void UO.AllPrice(object? price, object? @type);

Enables automatic price entry after placing an item in your vendor's inventory. The team does not carry items itself. First turn on the mode, then drag the item. The price is sent only after a corresponding server request. The second parameter filters the TYPE of the item.

Parameters

  • price — The first parameter is the whole price for the entire exposed item/stack, from 0 to 2147483647. 125 means price 125. 0 - clearly zero price (free if allowed by the server), no shutdown. A negative value turns off the mode; UO.AllPrice() without arguments is recommended.
  • type — The second optional parameter is TYPE/Graphic from 0 to 65535, a number or a hex string, for example 0x0EED. 0 or absence - any types. Item Serial and Object Name are not appropriate. Color is not filtered.

Return value

void: no value. Activate AllPrice reports activation. The sent price line indicates the response was sent, not the acceptance of the price confirmed by the server.

Behavior

  • The mode applies to subsequent transfers until it is turned off. A price request that was already pending before inclusion/transfer is not automatically filled. Doesn't respond to vendor/store rename requests.
  • Requires that the container belongs to another character/NPC known to the client. The right to manage the vendor and the acceptability of the price are checked by the server. The character's regular backpack, chest on the ground, and land do not receive an automatic price.
  • For a standard vendor, the cliloc 1043303 price request is recognized regardless of the client's language. System text prompts starting with Type in a price, Enter a price, Enter the price, Enter a price or Enter a price are also supported. An unknown invitation is left for manual response.
  • ASCII and Unicode server queries are supported. If the invitation does not arrive within 10 seconds, the delayed reply is cancelled. During a mass transfer, the queue also stops. Replies already sent will not be recalled.
  • The other TYPE item does not receive a price. If MassMove is enabled, the next submission waits for the price request to be processed; an unknown or inappropriate request stops the queue to avoid mixing up items.
  • AllPrice() clears pending prices and turns off the mode. TerminateAll(), quitting, dying, or changing cards also resets the automatic price. This command does not change the prices of already listed products.

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

1. One price for subsequent items of any type - direct script

Parameters and execution flow:

  • price=125 — the entire price of each item. type absent: all types are suitable.
  • After launch, manually add the item to your vendor's inventory. The customer will respond to a price request with 125. Each subsequent item receives the same price until it is switched off.
  • Print only resembles the action; This procedure itself does not transfer anything.
UO.AllPrice(125);
UO.Print("Drop goods into your vendor inventory");

2. Automatic price for a given type only - script function

Parameters and execution flow:

  • salePrice is transmitted as price=250. itemType is transmitted as type=0x0F7A, not serial of an individual product.
  • The price 250 refers to the entire stack being displayed. The command does not multiply the price by the number of units within it.
  • Other types remain without automatic response. For these, enter the price manually or include AllPrice with a different filter.
return  RunScenario();
 object? RunScenario()
{
    var itemType = "0x0F7A";
    var salePrice = 250;
    UO.AllPrice(salePrice, itemType);
    return null;
}

3. Explicitly expose items for free - script class

Parameters and execution flow:

  • price=0 — send the string 0 to the server as a price. This is not canceling the dialogue or shutting down.
  • type=0x0F7A limits the free price to this type. The behavior of the free sale depends on the server rules.
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.AllPrice(0, "0x0F7A");
        return null;
    }
}

4. Disable automatic pricing - direct script

Parameters and execution flow:

  • No arguments: the mode is turned off and pending responses are deleted.
  • The price already set by the server does not change. The user fills out the next price request himself.

Shop lists / Buy and sell lists

Shop lists / Buy and sell lists

UO.AllPrice();

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

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "allprice":

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

                        arguments.Length > 1 ? ResolveType(arguments[1]) : 0);

                    break;

UO.AllPrice(price) — UO.AllPrice(Any)

Parameters: price (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "allprice":

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

                        arguments.Length > 1 ? ResolveType(arguments[1]) : 0);

                    break;

UO.AllPrice(price, type) — UO.AllPrice(Any,Any)

Parameters: price (Any), type (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "allprice":

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

                        arguments.Length > 1 ? ResolveType(arguments[1]) : 0);

                    break;

UO.AutoBuy

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

C# signatures

void UO.AutoBuy(object? itemType, object? itemColor, object? quantity);

Purpose

Creates, updates or removes a rule in this execution’s default list. A new rule is enabled, but a disabled list is not automatically enabled. Graphical profile settings do not change.

Parameters

  • type / itemType — Exact item graphic/type, 0…65535, not a serial.
  • color / itemColor — -1 or 65535 means any color; 0 means uncolored. Use 0…65534 for an exact hue.
  • quantity — A positive unit limit per offer, capped at 65535. Zero or a negative value removes the rule, unlike Amount=0 in the typed DTO. This is not a target backpack balance.

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.AutoBuy(0x0E21, -1, 10);
UO.Wait(5000);
UO.AutoBuy(0x0E21, -1, 10);
UO.Wait(5000);
UO.AutoBuy(0x0E21, -1, 0);

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,AutoBuy 0x0E21 -1 10

Buying and selling: rule owners and vendor offers


UO.AutoBuyEx

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

C# signatures

void UO.AutoBuyEx(object? itemType, object? itemColor, object? quantity, object? price, object? name);

Purpose

Creates, updates or removes a rule in this execution’s default list. A new rule is enabled, but a disabled list is not automatically enabled. Graphical profile settings do not change.

Parameters

  • type / itemType — Exact item graphic/type, 0…65535, not a serial.
  • color / itemColor — -1 or 65535 means any color; 0 means uncolored. Use 0…65534 for an exact hue.
  • quantity — A positive unit limit per offer, capped at 65535. Zero or a negative value removes the rule, unlike Amount=0 in the typed DTO. This is not a target backpack balance.
  • maxPrice / price — Maximum unit price in a vendor offer; 0 is unlimited. Unused for looting.
  • name — Optional case-insensitive name substring; empty matches any name.

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.AutoBuyEx(0x0E21, -1, 10, 4, "");
UO.Wait(5000);
UO.AutoBuyEx(0x0E21, 0, 5, 4, "bandage");
UO.Wait(5000);
UO.AutoBuyEx(0x0E21, 0, 0, 0, "");

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,AutoBuyEx 0x0E21 -1 10 4 ""

Buying and selling: rule owners and vendor offers


UO.AutoSell

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

C# signatures

void UO.AutoSell(object? itemType, object? itemColor, object? quantity);

Purpose

Creates, updates or removes a rule in this execution’s default list. A new rule is enabled, but a disabled list is not automatically enabled. Graphical profile settings do not change.

Parameters

  • type / itemType — Exact item graphic/type, 0…65535, not a serial.
  • color / itemColor — -1 or 65535 means any color; 0 means uncolored. Use 0…65534 for an exact hue.
  • quantity — A positive unit limit per offer, capped at 65535. Zero or a negative value removes the rule, unlike Amount=0 in the typed DTO. This is not a target backpack balance.

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.AutoSell(0x0F51, -1, 3);
UO.Wait(5000);
UO.AutoSell(0x0F51, -1, 3);
UO.Wait(5000);
UO.AutoSell(0x0F51, -1, 0);

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,AutoSell 0x0F51 -1 3

Buying and selling: rule owners and vendor offers


UO.Buy

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

C# signatures

void UO.Buy(object? type);
void UO.Buy(object? type, object? color);
void UO.Buy(object? type, object? color, object? quantity);
void UO.Buy(object? type, object? color, object? quantity, object? maxPrice);
void UO.Buy(object? type, object? color, object? quantity, object? maxPrice, object? name);

Purpose

Creates, updates or removes a rule in this execution’s default list. A new rule is enabled, but a disabled list is not automatically enabled. Graphical profile settings do not change.

Parameters

  • type / itemType — Exact item graphic/type, 0…65535, not a serial.
  • color / itemColor — -1 or 65535 means any color; 0 means uncolored. Use 0…65534 for an exact hue.
  • quantity — A positive unit limit per offer, capped at 65535. Zero or a negative value removes the rule, unlike Amount=0 in the typed DTO. This is not a target backpack balance.
  • maxPrice / price — Maximum unit price in a vendor offer; 0 is unlimited. Unused for looting.
  • name — Optional case-insensitive name substring; empty matches any name.

Default: color=-1, quantity=1, maxPrice=0, name="".

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.Buy(0x0E21);
UO.Wait(5000);
UO.Buy(0x0E21, -1, 10, 4, "");
UO.Wait(5000);
UO.Buy(0x0E21, -1, 0);

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,Buy 0x0E21 -1 10 4 ""

Buying and selling: rule owners and vendor offers


UO.ClearShopList

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

C# signatures

void UO.ClearShopList();

Purpose

Clears this owner’s buy/sell rules and disables both automations. List definitions and loot rules remain. The command does not cancel a request already sent to the server.

Parameters

No parameters.

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.ClearShopList();
UO.Print("Buy enabled: " + UO.AutoBuyEnabled());
UO.Print("Sell enabled: " + UO.AutoSellEnabled());
UO.Buy(0x0E21, -1, 10);
UO.Wait(5000);
UO.ClearShopList();

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,ClearShopList

Buying and selling: rule owners and vendor offers


UO.GetAutoBuyDelay

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

C# signatures

dynamic UO.GetAutoBuyDelay();

Purpose

automatic-buy delay.

Parameters

No parameters.

Return value

dynamic → CLR int.

Default: 3.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

owner gameplay settings → BackNewbieAutomationManager per-owner deadline.

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

int delay = Convert.ToInt32(UO.GetAutoBuyDelay());
UO.Print("Delay ms: " + delay);
UO.SetAutoBuyDelay(70000);
UO.Print("Clamped ms: " + UO.GetAutoBuyDelay());
UO.SetAutoBuyDelay(0);
UO.Print("No extra delay: " + UO.GetAutoBuyDelay());

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,GetAutoBuyDelay

UO.GetAutoSellDelay

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

C# signatures

dynamic UO.GetAutoSellDelay();

Purpose

automatic-sell delay.

Parameters

No parameters.

Return value

dynamic → CLR int.

Default: 3.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

owner gameplay settings → BackNewbieAutomationManager per-owner deadline.

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

int delay = Convert.ToInt32(UO.GetAutoSellDelay());
UO.Print("Delay ms: " + delay);
UO.SetAutoSellDelay(70000);
UO.Print("Clamped ms: " + UO.GetAutoSellDelay());
UO.SetAutoSellDelay(0);
UO.Print("No extra delay: " + UO.GetAutoSellDelay());

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,GetAutoSellDelay

UO.GetPrice

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

C# signatures

dynamic UO.GetPrice(object? objID);

Reads the Item.Price known to the client for a serial item.

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

int — unchecked conversion of uint Item.Price to int. A missing item gives 0; prices above 2147483647 are displayed as negative int.

Behavior

  • The team does not request a vendor proposal. The value depends on the data previously received by the client. Zero can indicate an unknown/zero price or the absence of an item; to check an object use Exists.

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

1. Price of the selected item - direct script

Parameters and execution flow:

  • The result is a cached Item.Price.
var item = UO.LastTarget();
if (Truth(UO.Exists(item)))
{
    var price = UO.GetPrice(item);
    UO.Print(Convert.ToString(price));
}

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

2. Zero serial - script function

Parameters and execution flow:

  • A missing item gives 0.
return  RunScenario();
 object? RunScenario()
{
    var price = UO.GetPrice(0);
    UO.Print(Convert.ToString(price));
    return null;
}

3. Price Snapshot - Script Class

Parameters and execution flow:

  • Only a new call rereads the model; the pause itself does not ask for a price.
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 item = UO.LastTarget();
        var before = UO.GetPrice(item);
        await Delay(500);
        var after = UO.GetPrice(item);
        UO.Print(Convert.ToString(before) + " " + Convert.ToString(after));
        return null;
    }

    Task Delay(object? milliseconds) => WaitAsync(checked((int)Convert.ToDouble(milliseconds)));
}

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

Parameters: objID (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "getprice":

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

UO.GetShopList

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

C# signatures

dynamic UO.GetShopList();

Reads the products of the last active offer of the NPC-seller. Allows you to check the type, quantity and price before buying or selling.

Parameters

There are no parameters.

Return value

Array of string — array of strings, indices from 0. Each line: serial|graphic|hue|amount|price|name. Serial - ID specific position, graphic - type, hue - color; the first three fields are written in 0x format. Amount — available units minus the draft in the window, price — price of one unit, name — name. This is not a list of serial or bool. If there is no offer, the array is empty. The name can contain |: the first five delimiters define the fields, the rest is the name.

Behavior

  • First, as a normal game action, open a buy or sell from the desired NPC and wait for the server to offer. These teams themselves do not look for a seller, do not open trade, do not set a price for a personal vendor, and do not transfer items between chests. ID of the seller is not passed as a parameter: in case of several offers, the last one is used.
  • In the manager, the offer is stored in the game session. Closing the graphical client saves the proposal and draft, opening it restores the window. Closing the store itself, responding, closing the server, or disconnecting the connection removes the offer. Autobuy/autosell Bad Newbie can process it before the script.
  • Reading does not send requests to the server. This is a snapshot of the supply already received, not a guarantee of the current stock of NPC. The quantity field reflects the units, not the number of rows/stacks. ArrayLength(rows) counts positions. Prices here read GetShopList; SendShopReply does not accept the price.
  • The explicit list replaces the draft and is not added to it. Repeating one serial totals the quantity; the total is limited by the total quantity of the item in the offer. Unknown serial, invalid or non-positive quantity will reject the entire response before submitting, saving the offer. If there is no sentence, SendShopReply reports an error. The line "0" is not an undo command; use "".

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

1. Parse first position - direct script

Parameters and execution flow:

  • GetWord uses the index from 0: 0 - serial, 1 - graphic, 2 - hue, 3 - quantity, 4 - price. Before rows[0] the length of the array is checked.
var rows = UO.GetShopList();
if (Truth(ArrayLength(rows) == 0))
{
    return null;
}
var serial = ReadField(rows[0], 0, "|");
var itemType = ReadField(rows[0], 1, "|");
var amount = Convert.ToInt32(ReadField(rows[0], 3, "|"));
var price = Convert.ToDouble(ReadField(rows[0], 4, "|"));
UO.Print(serial + " / " + itemType + " / " + Convert.ToString(amount) + " / " + Convert.ToString(price));

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;

string ReadField(object? row, int index, string separator) { string[] fields = (Convert.ToString(row) ?? "").Split(new[] { separator }, StringSplitOptions.None); return index >= 0 && index < fields.Length ? fields[index] : ""; }

2. Buy up to ten bandages at a limited price - script function

Parameters and execution flow:

  • For pre-open BUY offer only. 0x0E21 — bandages, 5 — maximum unit price, 10 — required quantity. The first suitable position is taken; the exact serial is read from the sentence. The code does not start the purchase itself.
return  RunScenario();
 object? RunScenario()
{
    var rows = UO.GetShopList();
    for (int i = (int)(0); i <= ArrayLength(rows) - 1; i += (int)(1))
    {
        var row = rows[i];
        if (Truth(ReadField(row, 1, "|") == "0x0E21"))
        {
            var price = Convert.ToDouble(ReadField(row, 4, "|"));
            var amount = Convert.ToInt32(ReadField(row, 3, "|"));
            if (Truth(price > 0) && Truth(price <= 5) && Truth(amount > 0))
            {
                if (Truth(amount > 10))
                {
                    amount = 10;
                }

                UO.SendShopReply(ReadField(row, 0, "|") + ":" + Convert.ToString(amount));
                return null;
            }
        }
    }

    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;
string ReadField(object? row, int index, string separator)
{
    string[] fields = (Convert.ToString(row) ?? "").Split(new[] { separator }, StringSplitOptions.None);
    return index >= 0 && index < fields.Length ? fields[index] : "";
}

3. Calculate available stock of selected type - scenario class

Parameters and execution flow:

  • The auxiliary function is given in full: it sums the amount field of all positions of the specified type. If the clause is empty, returns 0; this is the number of units available, not the number of animals or items on the character.

Shop lists / Buy and sell lists

Shop lists / Buy and sell lists

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 available = CountOfferedType("0x0E21");
        if (Truth(available < 10))
        {
            UO.Print("Bandage stock below 10: " + Convert.ToString(available));
        }

        return null;
    }

    dynamic CountOfferedType(dynamic itemType)
    {
        var total = 0;
        var rows = UO.GetShopList();
        for (int i = (int)(0); i <= ArrayLength(rows) - 1; i += (int)(1))
        {
            if (Truth(ReadField(rows[i], 1, "|") == itemType))
            {
                total = total + Convert.ToInt32(ReadField(rows[i], 3, "|"));
            }
        }

        return total;
    }

    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;
    string ReadField(object? row, int index, string separator)
    {
        string[] fields = (Convert.ToString(row) ?? "").Split(new[] { separator }, StringSplitOptions.None);
        return index >= 0 && index < fields.Length ? fields[index] : "";
    }
}

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

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

public InjectionValue GetShopList()

            => new InjectionValue((bridge.GetShopList() ?? Array.Empty<string>()).Select(item => new InjectionValue(item)).ToArray());

UO.MassPriceMove

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

C# signatures

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

Enables mass transfer of items of one TYPE with automatic pricing in your vendor's inventory. The source is determined by the first manual transfer. Each stack is transferred entirely and is considered one item; after his price request, the client responds and only then continues the queue.

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.MassPriceMove() 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 - 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 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.
  • price — The fourth required parameter is the whole price 0..2147483647 for each complete item/stack displayed. 0 means free, no shutdown. Negative price is rejected.
  • destination — The fifth optional parameter is serial or the saved name of the container in your vendor’s inventory. If absent, it is taken from the manual reset. An ordinary backpack, a chest on the ground and destination=0 are deviated here: it is impossible to set a price on the ground.
  • x - Sixth parameter - X inside the vendor container: -1 or 65535 for automatic placement, otherwise 0..65535. Indicated only together with Y and Z.
  • y - Seventh parameter - Y inside the vendor container: -1/65535 for automatic placement, otherwise 0..65535. Only indicated together with X and Z.
  • z — The eighth parameter is the height -128..127, inside the container usually 0. Without explicit X/Y/Z, with a given destination, -1,-1,0 are used; When assigning manually, the reset location is taken.

Return value

void: no value. Activate MassPriceMove enables manual sample wait. Transfer and price messages indicate requests submitted and not a guarantee of server acceptance.

Behavior

  • Forms with 0, 4, 5 or 8 arguments. Exact order: delay, quantity, type, price, destination, x, y, z. Partial coordinate triples are not supported.
  • First, call the command, then pick up and drag the entire appropriate item. Type 0 remembers it TYPE; an explicit type skips manual wraps of other types. The source is always taken from the first suitable item.
  • The quantity includes the first manual item. 50 means 50 full stacks from 100, not 50 units from the stack. 0 - all suitable straight objects. Color is not filtered and nested containers are not expanded.
  • The AllPrice price request recognition rules apply, including ASCII/Unicode and 10-second wait. Pause delay - minimum interval: a slow server increases it so as not to confuse prices.
  • General mode AllPrice does not need to be enabled. The price of this operation takes precedence over AllPrice. Changing the price AllPrice or manually transferring additional items during the queue is not recommended: an unknown response or server failure interrupts the queue.
  • MassPriceMove() turns off the current transfer queue and cancels the pending price response; the general AllPrice, if it was enabled separately, is retained. TerminateAll() turns off both modes. This is one queue in common with MassMove: the new activation replaces the old one.
  • If the price request is not recognized, the command leaves the dialog for manual entry and stops further transfers. Server failure, death, map change, and unavailable item/container also stop working.
  • 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.MassPriceMove");
UO.MassPriceMove();

1. Move 50 stacks with price, determining the type with the mouse - direct script

Parameters and execution flow:

  • delay=350 ms; quantity=50 of individual items, including the first manual one; type=0 remembers TYPE sample; price=125 for each entire item.
  • destination and coordinates are missing: drag the sample directly into your vendor's inventory.
  • If the original stacks are 100, a maximum of 50 full stacks are transferred. Each receives a price 125 after the server requests.
UO.MassPriceMove(350, 50, 0, 125);
UO.Print("Drag one complete stack into your vendor bag");

2. All items of a known type into the selected vendor bag - script function

Parameters and execution flow:

  • AddObject prompts you to select a vendor bag and saves it as vendor_bag. This is the ID destination; type remains the code 0x0F7A.
  • delay=500, quantity=0 without limit, type=0x0F7A, price=250, destination=vendor_bag.
  • X/Y/Z missing: -1,-1,0. To start a queue, manually drag one item of the appropriate type; from it the original bag is determined.
return  RunScenario();
 object? RunScenario()
{
    UO.AddObject("vendor_bag");
    UO.MassPriceMove(500, 0, "0x0F7A", 250, "vendor_bag");
    UO.Print("Now drag one matching item from the source");
    return null;
}

3. Specify all eight parameters and the location inside the bag - scenario class

Parameters and execution flow:

  • delay=350 ms; quantity=10 full items; type=itemType=0x0EED; price=1000 for each full stack.
  • destination=vendorBag is the real ID of your vendor's bags, replace the example. This is the fifth parameter, not the fourth.
  • x=60, y=70 is the place inside this bag, z=0. These are not the character's coordinates on the map.
  • Once called, manually drag and drop the appropriate sample from the source. If the server rejects the placement, further requests are stopped.
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 itemType = "0x0EED";
        var vendorBag = "0x40005678";
        UO.MassPriceMove(350, 10, itemType, 1000, vendorBag, 60, 70, 0);
        return null;
    }
}

4. Cancel queue and pending price response - direct script

Parameters and execution flow:

  • With no arguments, the command turns off the general bulk transfer queue and clears its pending price response.
  • Prices and transfers already accepted by the server are not rolled back. To stop other procedures and separately enabled AllPrice, use UO.TerminateAll().

Shop lists / Buy and sell lists

Shop lists / Buy and sell lists

UO.MassPriceMove();

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

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "masspricemove":

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

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

                        NumberConversions.ToInt(arguments[1]), ResolveType(arguments[2]),

                        NumberConversions.ToInt(arguments[3]),

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

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

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

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

                    break;

UO.MassPriceMove(delay, quantity, type, price) — UO.MassPriceMove(Any,Any,Any,Any)

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

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "masspricemove":

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

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

                        NumberConversions.ToInt(arguments[1]), ResolveType(arguments[2]),

                        NumberConversions.ToInt(arguments[3]),

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

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

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

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

                    break;

UO.MassPriceMove(delay, quantity, type, price, destination) — UO.MassPriceMove(Any,Any,Any,Any,Any)

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

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "masspricemove":

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

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

                        NumberConversions.ToInt(arguments[1]), ResolveType(arguments[2]),

                        NumberConversions.ToInt(arguments[3]),

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

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

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

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

                    break;

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

Parameters: delay (Any), quantity (Any), type (Any), price (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 "masspricemove":

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

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

                        NumberConversions.ToInt(arguments[1]), ResolveType(arguments[2]),

                        NumberConversions.ToInt(arguments[3]),

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

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

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

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

                    break;

UO.Sell

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

C# signatures

void UO.Sell(object? type);
void UO.Sell(object? type, object? color);
void UO.Sell(object? type, object? color, object? quantity);

Purpose

Creates, updates or removes a rule in this execution’s default list. A new rule is enabled, but a disabled list is not automatically enabled. Graphical profile settings do not change.

Parameters

  • type / itemType — Exact item graphic/type, 0…65535, not a serial.
  • color / itemColor — -1 or 65535 means any color; 0 means uncolored. Use 0…65534 for an exact hue.
  • quantity — A positive unit limit per offer, capped at 65535. Zero or a negative value removes the rule, unlike Amount=0 in the typed DTO. This is not a target backpack balance.

Default: color=-1, quantity=1.

Return value

void. it does not confirm a server outcome.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

Script automation runs while its execution is active; completion or Stop removes its controller. In the example, 5000 is a wait in milliseconds during which you manually open the desired NPC offer. Configuring a rule neither opens trading nor confirms a transaction.

Rules from every enabled list (Enabled=true) are processed, independently of which list the GUI editor displays. The default list is preserved; orphaned list references are recovered as disabled lists.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

UO.Sell(0x0F51);
UO.Wait(5000);
UO.Sell(0x0F51, -1, 3);
UO.Wait(5000);
UO.Sell(0x0F51, -1, 0);

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,Sell 0x0F51 -1 3

Buying and selling: rule owners and vendor offers


UO.SendShopReply

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

C# signatures

void UO.SendShopReply(object? reply);

Sends the product selection to the last active offer of the NPC-seller. The direction of the transaction is determined by the offer: buying from NPC or selling to him.

Parameters

  • reply — String: "serial:quantity"; several positions are separated by |, ; or comma. Instead of : let's say =. Serial - ID positions from GetShopList, decimal or 0x, not graphic and not ID seller. Quantity is a positive integer number of ones, not the number of stacks; without it, 1 is taken. "accept" is case insensitive or "1" confirms the draft window; an empty line cancels the transaction with an empty response.

Return value

void - there is no return value: neither true/false, nor amount, nor purchase confirmation. The server decides whether the transaction is valid. After submitting, check for updated items, gold, or server message.

Behavior

  • First, as a normal game action, open a buy or sell from the desired NPC and wait for the server to offer. These teams themselves do not look for a seller, do not open trade, do not set a price for a personal vendor, and do not transfer items between chests. ID of the seller is not passed as a parameter: in case of several offers, the last one is used.
  • In the manager, the offer is stored in the game session. Closing the graphical client saves the proposal and draft, opening it restores the window. Closing the store itself, responding, closing the server, or disconnecting the connection removes the offer. Autobuy/autosell Bad Newbie can process it before the script.
  • Reading does not send requests to the server. This is a snapshot of the supply already received, not a guarantee of the current stock of NPC. The quantity field reflects the units, not the number of rows/stacks. ArrayLength(rows) counts positions. Prices here read GetShopList; SendShopReply does not accept the price.
  • The explicit list replaces the draft and is not added to it. Repeating one serial totals the quantity; the total is limited by the total quantity of the item in the offer. Unknown serial, invalid or non-positive quantity will reject the entire response before submitting, saving the offer. If there is no sentence, SendShopReply reports an error. The line "0" is not an undo command; use "".

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

1. Select up to three units of the first position - direct script

Parameters and execution flow:

  • Up to 3 first position units are selected; serial is not hard-skinned. For a purchase offer it is a purchase, for a sale offer it is a sale. Check which offer you have opened.
var rows = UO.GetShopList();
if (Truth(ArrayLength(rows) == 0))
{
    return null;
}
var amount = Convert.ToInt32(ReadField(rows[0], 3, "|"));
if (Truth(amount > 3))
{
    amount = 3;
}
if (Truth(amount > 0))
{
    UO.SendShopReply(ReadField(rows[0], 0, "|") + ":" + Convert.ToString(amount));
}

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;

string ReadField(object? row, int index, string separator) { string[] fields = (Convert.ToString(row) ?? "").Split(new[] { separator }, StringSplitOptions.None); return index >= 0 && index < fields.Length ? fields[index] : ""; }

2. Select one item at a time within the budget - script function

Parameters and execution flow:

  • Only for BUY offer: budget 30, type 0x0E21. One unit is selected from each eligible item if the price is positive and within the remaining budget. The string is concatenated using |; one SendShopReply sends the entire selection.
return  RunScenario();
 object? RunScenario()
{
    double budget = 30;
    var reply = "";
    var rows = UO.GetShopList();
    for (int i = (int)(0); i <= ArrayLength(rows) - 1; i += (int)(1))
    {
        var row = rows[i];
        if (Truth(ReadField(row, 1, "|") == "0x0E21"))
        {
            var price = Convert.ToDouble(ReadField(row, 4, "|"));
            var amount = Convert.ToInt32(ReadField(row, 3, "|"));
            if (Truth(price > 0) && Truth(price <= budget) && Truth(amount > 0))
            {
                if (Truth(reply != ""))
                {
                    reply = reply + "|";
                }

                reply = reply + ReadField(row, 0, "|") + ":1";
                budget = budget - price;
            }
        }
    }

    if (Truth(reply != ""))
    {
        UO.SendShopReply(reply);
    }

    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;
string ReadField(object? row, int index, string separator)
{
    string[] fields = (Convert.ToString(row) ?? "").Split(new[] { separator }, StringSplitOptions.None);
    return index >= 0 && index < fields.Length ? fields[index] : "";
}

3. Confirm Window Draft - Script Class

Parameters and execution flow:

  • Pre-select quantities in the store window. "accept" sends exactly this draft; After closing the game window it is saved. If nothing is selected, an empty response will be sent. "1" is a synonym for confirmation, not a serial item.
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.SendShopReply("accept");
        return null;
    }
}

4. Cancel offer - direct script

Parameters and execution flow:

  • An empty line sends an empty response and closes the active offer. The GetShopList check avoids being called when there are no goods, but it does not distinguish between an empty sentence and an absent one.

Shop lists / Buy and sell lists

Shop lists / Buy and sell lists

if (Truth(ArrayLength(UO.GetShopList()) > 0))
{
    UO.SendShopReply("");
}

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;

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.SendShopReply(reply) — UO.SendShopReply(Any)

Parameters: reply (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

public void SendShopReply(InjectionValue reply) => bridge.SendShopReply(reply.ToString());

UO.SetAutoBuyDelay

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

C# signatures

void UO.SetAutoBuyDelay(object? value);

Purpose

automatic-buy delay.

Parameters

value — automatic-buy delay. milliseconds. 0…65535.

Return value

void.

Default: 3.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

owner gameplay settings → BackNewbieAutomationManager per-owner deadline.

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

int delay = Convert.ToInt32(UO.GetAutoBuyDelay());
UO.Print("Delay ms: " + delay);
UO.SetAutoBuyDelay(70000);
UO.Print("Clamped ms: " + UO.GetAutoBuyDelay());
UO.SetAutoBuyDelay(0);
UO.Print("No extra delay: " + UO.GetAutoBuyDelay());

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,SetAutoBuyDelay 0

UO.SetAutoSellDelay

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

C# signatures

void UO.SetAutoSellDelay(object? value);

Purpose

automatic-sell delay.

Parameters

value — automatic-sell delay. milliseconds. 0…65535.

Return value

void.

Default: 3.

Ownership

The setting belongs to this script execution. A new run copies the independent engine/chat defaults once, not the graphical Profile. A script setter changes neither the GUI nor other runs already executing. Named objects, types, equipment sets, Ignore lists and globals deliberately retain their documented shared scope.

A standalone chat command changes the lasting engine context: later commands read that value and new runs copy it. Existing runs keep their own values. Chat automation has its own controller and keeps operating after the command returns; GUI automation uses separate settings.

Actual behavior

owner gameplay settings → BackNewbieAutomationManager per-owner deadline.

The controller processes an actual vendor offer received from the server, applies quantity/price limits and sends a buy/sell request. A getter does not open trading. Delay is scheduled after a request; it is not Wait and does not reschedule an existing deadline. Script automation ends when its run completes or is stopped. Keep the run active for the intended actions; a script that only configures rules and returns does not leave a background controller.

See execution state and gameplay settings.

Standalone examples

Replace demonstration serials or names with your own before running. Each block is a complete, separate .csx without a hidden wrapper.

int delay = Convert.ToInt32(UO.GetAutoSellDelay());
UO.Print("Delay ms: " + delay);
UO.SetAutoSellDelay(70000);
UO.Print("Clamped ms: " + UO.GetAutoSellDelay());
UO.SetAutoSellDelay(0);
UO.Print("No extra delay: " + UO.GetAutoSellDelay());

Through chat

Use the current chat prefix (initially ,). Separate arguments with spaces. A getter prints the current value; a setter returns no output. Bool values accept true/false or 1/0. Quote strings containing spaces and quote the complete JSON argument. C# and chat use the same native registry.

,SetAutoSellDelay 0

UO.Shop

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

C# signatures

void UO.Shop();

Prints a local list of trade lines.

Parameters

There are no parameters.

Return value

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

Behavior

  • ExecuteLegacyManualAlias reads bridge.GetShopList and concatenates the lines via "|" for SystemMessage. The seller menu does not open, buying/selling is not carried out.
  • Modifies or displays only the specified local data. This command does not have server confirmation.

Standalone C# scripts

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

Simple example

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

The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.

UO.Print("Calling UO.Shop");
UO.Shop();

1. Direct call - direct script

Parameters and execution flow:

  • Prints a local list of trade lines.
UO.Shop();

2. Explicit option - script function

Parameters and execution flow:

  • ExecuteLegacyManualAlias reads bridge.GetShopList and concatenates the lines via "|" for SystemMessage. The seller menu does not open, buying/selling is not carried out.
return  RunScenario();
 object? RunScenario()
{
    UO.Shop();
    UO.Print(UO.GetArrayLength(UO.GetShopList()));
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Modifies or displays only the specified local data. This command does not have server confirmation.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.Shop();
        UO.TextOpen();
        UO.TextPrint("Shop list was printed in the journal");
        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.Shop() — UO.Shop()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "shop": SystemMessage(string.Join(" | ", bridge.GetShopList())); break;

UO.VendorMenu

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

C# signatures

void UO.VendorMenu(object? vendor);
void UO.VendorMenu(object? menu, object? choice);

Uses a seller or registers a permanent menu hook.

Parameters

  • vendor — Form with one argument: serial/alias of the seller object.
  • menu — A form with two arguments: a title and a menu element, both as text. This is a different operation; the first argument is not serial.
  • choice — A form with two arguments: a title and a menu element, both as text. This is a different operation; the first argument is not serial.

Return value

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

Behavior

  • One argument calls bridge.UseObject. The two arguments call bridge.AddMenuHook(menu,choice,true), where true means a repeatable hook.
  • Does not automatically buy or sell. Opening and selecting menus is determined by the server; the registered hook acts on the next matching menus until canceled.
  • For menu/choice forms, the manager selects the first menu whose title contains prompt, case insensitive; SessionMenu selects the first item whose name contains choice, also case insensitive. Blank text is suitable for anyone; numeric text is a fragment of the name, not an index. A successful selection sends a response and closes the local menu. A one-time hook is deleted only after a successful selection; a permanent hook remains.

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

1. Direct call - direct script

Parameters and execution flow:

  • Uses a seller or registers a permanent menu hook.
if (Truth(UO.Exists("lasttarget")))
{
    UO.VendorMenu("lasttarget");
}

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

2. Explicit option - script function

Parameters and execution flow:

  • One argument calls bridge.UseObject. The two arguments call bridge.AddMenuHook(menu,choice,true), where true means a repeatable hook.
return  RunScenario();
 object? RunScenario()
{
    UO.VendorMenu("Vendor", "Buy");
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • Does not automatically buy or sell. Opening and selecting menus is determined by the server; the registered hook acts on the next matching menus until canceled.
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.VendorMenu("Vendor", "Buy");
        UO.Print(UO.MenuHookPresent());
        UO.CancelMenu();
        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.VendorMenu(vendor) — UO.VendorMenu(Any)

Parameters: vendor (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "vendormenu":

                    if (arguments.Length >= 2) bridge.AddMenuHook(Text(0), Text(1), true);

                    else bridge.UseObject(Arg(0, bridge.LastTarget));

                    break;

UO.VendorMenu(menu, choice) — UO.VendorMenu(Any,Any)

Parameters: menu (Any), choice (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "vendormenu":

                    if (arguments.Length >= 2) bridge.AddMenuHook(Text(0), Text(1), true);

                    else bridge.UseObject(Arg(0, bridge.LastTarget));

                    break;
⚠️ **GitHub.com Fallback** ⚠️