EN UO Topic shops vendors - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Home · C# · IDE · UO API · A–Z · Examples · Languages
Buying, selling, store listings, delays and personal merchant prices. AllPrice and MassPriceMove use the item type where specified in their parameters.
Open full catalog and examples
| 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 |
UO.Buy · UO.Sell · UO.AutoBuy · UO.AutoBuyEx · UO.AutoSell · UO.Shop · UO.GetShopList · UO.ClearShopList · UO.VendorMenu · UO.SendShopReply
UO.GetPrice · UO.AllPrice · UO.MassPriceMove
UO.GetAutoBuyDelay · UO.GetAutoSellDelay · UO.SetAutoBuyDelay · UO.SetAutoSellDelay
Each command card has several independent scenarios: direct code, functions and classes. Below are selected short scenarios; restrictions and full analysis are in the cards.
Parameters, result and all scenarios
UO.AllPrice(125);
UO.Print("Drop goods into your vendor inventory");Parameters, result and all scenarios
UO.MassPriceMove(350, 50, 0, 125);
UO.Print("Drag one complete stack into your vendor bag");Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
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.
-
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.
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.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.AllPrice");
UO.AllPrice();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");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;
}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;
}
}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
UO.AllPrice();C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AllPrice:bridge.AllPrice(arguments.Length > 0 ? NumberConversions.ToInt(arguments[0]) : -1, arguments.Length > 1 ? ResolveType(arguments[1]) : 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[1]).
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;Parameters: price (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AllPrice:bridge.AllPrice(arguments.Length > 0 ? NumberConversions.ToInt(arguments[0]) : -1, arguments.Length > 1 ? ResolveType(arguments[1]) : 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[1]).
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;Parameters: price (Any), type (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AllPrice:bridge.AllPrice(arguments.Length > 0 ? NumberConversions.ToInt(arguments[0]) : -1, arguments.Length > 1 ? ResolveType(arguments[1]) : 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[1]).
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;Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.AutoBuy(object? itemType, object? itemColor, object? quantity);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.
-
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.
void. it does not confirm a server outcome.
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.
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.
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);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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.AutoBuyEx(object? itemType, object? itemColor, object? quantity, object? price, object? name);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.
-
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.
void. it does not confirm a server outcome.
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.
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.
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, "");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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.AutoSell(object? itemType, object? itemColor, object? quantity);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.
-
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.
void. it does not confirm a server outcome.
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.
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.
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);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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
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);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.
-
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="".
void. it does not confirm a server outcome.
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.
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.
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);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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.ClearShopList();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.
No parameters.
void. it does not confirm a server outcome.
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.
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.
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();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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.GetAutoBuyDelay();automatic-buy delay.
No parameters.
dynamic → CLR int.
Default: 3.
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.
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.
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());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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.GetAutoSellDelay();automatic-sell delay.
No parameters.
dynamic → CLR int.
Default: 3.
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.
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.
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());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
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.GetPrice(object? objID);Reads the Item.Price known to the client for a serial item.
-
objID— Serial of the object or supported name of self/backpack/lasttarget/saved object; numeric strings and 0x strings are resolved by runtime.
int — unchecked conversion of uint Item.Price to int. A missing item gives 0; prices above 2147483647 are displayed as negative int.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.
object? result = UO.GetPrice(UO.LastTarget());
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));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;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;
}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)));
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: objID (Any)
Result: dynamic / Any.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetPrice:bridge.GetPrice(Arg(0)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Arg:Arg(0).
Internal implementation code; this is not a standalone script.
case "getprice":
return new InjectionValue(bridge.GetPrice(Arg(0)));Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
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.
There are no parameters.
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.
- 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 "".
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.
object? result = UO.GetShopList();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));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] : ""; }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] : "";
}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
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] : "";
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: dynamic / Any.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.GetShopList. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetShopList:bridge.GetShopList().
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());Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
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.
-
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.
void: no value. Activate MassPriceMove enables manual sample wait. Transfer and price messages indicate requests submitted and not a guarantee of server acceptance.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.MassPriceMove");
UO.MassPriceMove();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");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;
}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;
}
}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
UO.MassPriceMove();C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MassPriceMove:bridge.MassPriceMove(-1, 0, 0, 0, -1, -1, -1, 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[2]). -
InjectionScript.Runtime.InjectionApiUO.ResolveTransferDestination:ResolveTransferDestination(arguments[4], true).
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;Parameters: delay (Any), quantity (Any), type (Any), price (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MassPriceMove:bridge.MassPriceMove(-1, 0, 0, 0, -1, -1, -1, 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[2]). -
InjectionScript.Runtime.InjectionApiUO.ResolveTransferDestination:ResolveTransferDestination(arguments[4], true).
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;Parameters: delay (Any), quantity (Any), type (Any), price (Any), destination (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MassPriceMove:bridge.MassPriceMove(-1, 0, 0, 0, -1, -1, -1, 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[2]). -
InjectionScript.Runtime.InjectionApiUO.ResolveTransferDestination:ResolveTransferDestination(arguments[4], true).
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:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MassPriceMove:bridge.MassPriceMove(-1, 0, 0, 0, -1, -1, -1, 0). -
InjectionScript.Runtime.NumberConversions.ToInt:NumberConversions.ToInt(arguments[0]). -
InjectionScript.Runtime.InjectionApiUO.ResolveType:ResolveType(arguments[2]). -
InjectionScript.Runtime.InjectionApiUO.ResolveTransferDestination:ResolveTransferDestination(arguments[4], true).
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;Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.Sell(object? type);
void UO.Sell(object? type, object? color);
void UO.Sell(object? type, object? color, object? quantity);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.
-
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.
void. it does not confirm a server outcome.
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.
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.
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);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
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
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.
-
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.
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.
- 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 "".
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.SendShopReply");
UO.SendShopReply("");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] : ""; }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] : "";
}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;
}
}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
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;C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: reply (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.SendShopReply. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SendShopReply:bridge.SendShopReply(reply.ToString()). -
InjectionScript.Runtime.InjectionValue.ToString:reply.ToString().
Internal implementation code; this is not a standalone script.
public void SendShopReply(InjectionValue reply) => bridge.SendShopReply(reply.ToString());Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.SetAutoBuyDelay(object? value);automatic-buy delay.
value — automatic-buy delay. milliseconds. 0…65535.
void.
Default: 3.
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.
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.
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());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
Українська · English · Русский · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.SetAutoSellDelay(object? value);automatic-sell delay.
value — automatic-sell delay. milliseconds. 0…65535.
void.
Default: 3.
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.
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.
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());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
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.Shop();Prints a local list of trade lines.
There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.Shop");
UO.Shop();Parameters and execution flow:
- Prints a local list of trade lines.
UO.Shop();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;
}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;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
InjectionScript.Runtime.InjectionApiUO.SystemMessage:SystemMessage(string.Join(" | ", bridge.GetShopList())). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetShopList:bridge.GetShopList().
Internal implementation code; this is not a standalone script.
case "shop": SystemMessage(string.Join(" | ", bridge.GetShopList())); break;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.VendorMenu(object? vendor);
void UO.VendorMenu(object? menu, object? choice);Uses a seller or registers a permanent menu hook.
-
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.
void - no value. Call on a separate line; completion does not confirm the server's action.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.VendorMenu");
UO.VendorMenu("lasttarget");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;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;
}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;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: vendor (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AddMenuHook:bridge.AddMenuHook(Text(0), Text(1), true). -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Text:Text(0). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.UseObject:bridge.UseObject(Arg(0, bridge.LastTarget)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Arg:Arg(0, bridge.LastTarget). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget:bridge.LastTarget.
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;Parameters: menu (Any), choice (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AddMenuHook:bridge.AddMenuHook(Text(0), Text(1), true). -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Text:Text(0). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.UseObject:bridge.UseObject(Arg(0, bridge.LastTarget)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias::Arg:Arg(0, bridge.LastTarget). -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget:bridge.LastTarget.
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;