EN UO Topic movement Part 2 - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

Movement — 2

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

Reference parts

1 · 2

Complete command reference


UO.OpenDoor

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

C# signatures

void UO.OpenDoor();

Requests the door to be opened for the character.

Parameters

There are no parameters.

Return value

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

Behavior

  • OpenDoor calls GameActions.OpenDoor via Invoke. Serial door is not accepted; the search and discovery rules belong to GameActions/server.
  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.

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

1. Direct call - direct script

Parameters and execution flow:

  • Requests the door to be opened for the character.
UO.OpenDoor();

2. Explicit option - script function

Parameters and execution flow:

  • OpenDoor calls GameActions.OpenDoor via Invoke. Serial door is not accepted; the search and discovery rules belong to GameActions/server.
return  RunScenario();
 object? RunScenario()
{
    if (Truth(UO.IsOnline()))
    {
        UO.OpenDoor();
    }

    return null;
}

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

3. Full Helper Function - Script Class

Parameters and execution flow:

  • In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.OpenDoor();
        UO.Wait(250);
        UO.Print("Door request sent");
        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.OpenDoor() — UO.OpenDoor()

Parameters: No parameters.

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "opendoor": bridge.OpenDoor(); break;

UO.PredictedDirection

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

C# signatures

int UO.PredictedDirection();

Reads the predicted direction side after the character's already queued steps.

Parameters

There are no parameters.

Return value

int direction 0..7, without run bit. 0 - north or absence of character.

Behavior

  • Only the function shown in the syntax is UO without arguments. There are no target, serial, type, target, distance or timeout parameters. A non-bool number, ID, or a tile notation: 1 does not mean achieving the goal.
  • GetEndPosition reads the X/Y/Z/direction of the last already added Mobile.Step. When the queue is empty, reads the character's current position/direction. This is an O(1) read: the step is not retrieved, the motion and packet are not sent, the route is not calculated, the command does not wait for an achievement.
  • World directions: 0 north, 1 northeast, 2 east, 3 southeast, 4 south, 5 southwest, 6 west, 7 northwest. The screen is isometric. Direction.Mask removes the running flag; speed does not return.
  • This is a local forecast, not a confirmed arrival. New/completed steps, server failure, queue clearing or teleport can change it. Individual component calls are not atomic; an X match does not prove a Y/Z match or server confirmation.
  • Invoke performs a read on the game thread; The worker thread is waiting for the manager to process the request. Canceling the script interrupts the wait. Pauses and additional network requests are not added.
  • External implementations of IApiBridge without IPredictedMovementBridge retain a fallback reading of the current coordinates/direction. Classic UO implements a queue-aware interface.

Standalone C# scripts

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

Simple example

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

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

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

1. Read one component - direct script

Parameters and execution flow:

  • predicted saves one call without arguments; Convert.ToString formats the number for the log.
var predicted = UO.PredictedDirection();
UO.Print("Predicted: " + Convert.ToString(predicted));

2. Observe forecast change - script function

Parameters and execution flow:

  • UO.Wait(100) pauses the example for 100 ms. before and after can coincide even with an intermediate movement; these readings do not start a movement.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var before = UO.PredictedDirection();
    await Delay(100);
    var after = UO.PredictedDirection();
    if (Truth(before != after))
    {
        UO.Print("Prediction changed: " + Convert.ToString(before) + " -> " + Convert.ToString(after));
    }

    return null;
}

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

3. Complete Comparison Function - Script Class

Parameters and execution flow:

  • expected - an example of coordinates/height/direction, not an argument to the native command. PredictionEquals checks UO.Self(), reads the value once and returns 1 (condition met) if equal, otherwise 0 (condition not met). The entire function code is shown below Main. The coincidence of one component does not mean arrival.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        if (Truth(Truth(PredictionEquals(4)) == true))
        {
            UO.Print("Queued endpoint matches this component");
        }
        else
        {
            UO.Print("Different component or no player");
        }

        return null;
    }

    dynamic PredictionEquals(dynamic expected)
    {
        if (Truth(UO.Self() == 0))
        {
            return false;
        }

        var predicted = UO.PredictedDirection();
        return Truth(predicted == expected);
    }

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

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "predicteddirection": return new InjectionValue(ReadPredictedCoordinate(3));

UO.PredictedX

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

C# signatures

int UO.PredictedX();

Reads the predicted X coordinate after the character's already queued steps.

Parameters

There are no parameters.

Return value

int X in map cells. 0 - valid coordinate or absence of character.

Behavior

  • Only the function shown in the syntax is UO without arguments. There are no target, serial, type, target, distance or timeout parameters. A non-bool number, ID, or a tile notation: 1 does not mean achieving the goal.
  • GetEndPosition reads the X/Y/Z/direction of the last already added Mobile.Step. When the queue is empty, reads the character's current position/direction. This is an O(1) read: the step is not retrieved, the motion and packet are not sent, the route is not calculated, the command does not wait for an achievement.
  • X and Y are world/map coordinates, not container gump pixels. Z is the height, not the floor number. A single component is returned, not an array or the final destination of the entire route.
  • This is a local forecast, not a confirmed arrival. New/completed steps, server failure, queue clearing or teleport can change it. Individual component calls are not atomic; an X match does not prove a Y/Z match or server confirmation.
  • Invoke performs a read on the game thread; The worker thread is waiting for the manager to process the request. Canceling the script interrupts the wait. Pauses and additional network requests are not added.
  • External implementations of IApiBridge without IPredictedMovementBridge retain a fallback reading of the current coordinates/direction. Classic UO implements a queue-aware interface.

Standalone C# scripts

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

Simple example

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

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

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

1. Read one component - direct script

Parameters and execution flow:

  • predicted saves one call without arguments; Convert.ToString formats the number for the log.
var predicted = UO.PredictedX();
UO.Print("Predicted: " + Convert.ToString(predicted));

2. Observe forecast change - script function

Parameters and execution flow:

  • UO.Wait(100) pauses the example for 100 ms. before and after can coincide even with an intermediate movement; these readings do not start a movement.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var before = UO.PredictedX();
    await Delay(100);
    var after = UO.PredictedX();
    if (Truth(before != after))
    {
        UO.Print("Prediction changed: " + Convert.ToString(before) + " -> " + Convert.ToString(after));
    }

    return null;
}

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

3. Complete Comparison Function - Script Class

Parameters and execution flow:

  • expected - an example of coordinates/height/direction, not an argument to the native command. PredictionEquals checks UO.Self(), reads the value once and returns 1 (condition met) if equal, otherwise 0 (condition not met). The entire function code is shown below Main. The coincidence of one component does not mean arrival.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        if (Truth(Truth(PredictionEquals(1445)) == true))
        {
            UO.Print("Queued endpoint matches this component");
        }
        else
        {
            UO.Print("Different component or no player");
        }

        return null;
    }

    dynamic PredictionEquals(dynamic expected)
    {
        if (Truth(UO.Self() == 0))
        {
            return false;
        }

        var predicted = UO.PredictedX();
        return Truth(predicted == expected);
    }

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

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "predictedx": return new InjectionValue(ReadPredictedCoordinate(0));

UO.PredictedY

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

C# signatures

int UO.PredictedY();

Reads the predicted Y coordinate after the character's already queued steps.

Parameters

There are no parameters.

Return value

int Y in map cells. 0 - valid coordinate or absence of character.

Behavior

  • Only the function shown in the syntax is UO without arguments. There are no target, serial, type, target, distance or timeout parameters. A non-bool number, ID, or a tile notation: 1 does not mean achieving the goal.
  • GetEndPosition reads the X/Y/Z/direction of the last already added Mobile.Step. When the queue is empty, reads the character's current position/direction. This is an O(1) read: the step is not retrieved, the motion and packet are not sent, the route is not calculated, the command does not wait for an achievement.
  • X and Y are world/map coordinates, not container gump pixels. Z is the height, not the floor number. A single component is returned, not an array or the final destination of the entire route.
  • This is a local forecast, not a confirmed arrival. New/completed steps, server failure, queue clearing or teleport can change it. Individual component calls are not atomic; an X match does not prove a Y/Z match or server confirmation.
  • Invoke performs a read on the game thread; The worker thread is waiting for the manager to process the request. Canceling the script interrupts the wait. Pauses and additional network requests are not added.
  • External implementations of IApiBridge without IPredictedMovementBridge retain a fallback reading of the current coordinates/direction. Classic UO implements a queue-aware interface.

Standalone C# scripts

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

Simple example

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

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

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

1. Read one component - direct script

Parameters and execution flow:

  • predicted saves one call without arguments; Convert.ToString formats the number for the log.
var predicted = UO.PredictedY();
UO.Print("Predicted: " + Convert.ToString(predicted));

2. Observe forecast change - script function

Parameters and execution flow:

  • UO.Wait(100) pauses the example for 100 ms. before and after can coincide even with an intermediate movement; these readings do not start a movement.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var before = UO.PredictedY();
    await Delay(100);
    var after = UO.PredictedY();
    if (Truth(before != after))
    {
        UO.Print("Prediction changed: " + Convert.ToString(before) + " -> " + Convert.ToString(after));
    }

    return null;
}

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

3. Complete Comparison Function - Script Class

Parameters and execution flow:

  • expected - an example of coordinates/height/direction, not an argument to the native command. PredictionEquals checks UO.Self(), reads the value once and returns 1 (condition met) if equal, otherwise 0 (condition not met). The entire function code is shown below Main. The coincidence of one component does not mean arrival.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        if (Truth(Truth(PredictionEquals(1690)) == true))
        {
            UO.Print("Queued endpoint matches this component");
        }
        else
        {
            UO.Print("Different component or no player");
        }

        return null;
    }

    dynamic PredictionEquals(dynamic expected)
    {
        if (Truth(UO.Self() == 0))
        {
            return false;
        }

        var predicted = UO.PredictedY();
        return Truth(predicted == expected);
    }

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

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "predictedy": return new InjectionValue(ReadPredictedCoordinate(1));

UO.PredictedZ

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

C# signatures

int UO.PredictedZ();

Reads the predicted Z height after the character's already queued steps.

Parameters

There are no parameters.

Return value

int Z, signed height -128..127; a negative value is retained. 0 - acceptable height or absence of the character.

Behavior

  • Only the function shown in the syntax is UO without arguments. There are no target, serial, type, target, distance or timeout parameters. A non-bool number, ID, or a tile notation: 1 does not mean achieving the goal.
  • GetEndPosition reads the X/Y/Z/direction of the last already added Mobile.Step. When the queue is empty, reads the character's current position/direction. This is an O(1) read: the step is not retrieved, the motion and packet are not sent, the route is not calculated, the command does not wait for an achievement.
  • X and Y are world/map coordinates, not container gump pixels. Z is the height, not the floor number. A single component is returned, not an array or the final destination of the entire route.
  • This is a local forecast, not a confirmed arrival. New/completed steps, server failure, queue clearing or teleport can change it. Individual component calls are not atomic; an X match does not prove a Y/Z match or server confirmation.
  • Invoke performs a read on the game thread; The worker thread is waiting for the manager to process the request. Canceling the script interrupts the wait. Pauses and additional network requests are not added.
  • External implementations of IApiBridge without IPredictedMovementBridge retain a fallback reading of the current coordinates/direction. Classic UO implements a queue-aware interface.

Standalone C# scripts

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

Simple example

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

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

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

1. Read one component - direct script

Parameters and execution flow:

  • predicted saves one call without arguments; Convert.ToString formats the number for the log.
var predicted = UO.PredictedZ();
UO.Print("Predicted: " + Convert.ToString(predicted));

2. Observe forecast change - script function

Parameters and execution flow:

  • UO.Wait(100) pauses the example for 100 ms. before and after can coincide even with an intermediate movement; these readings do not start a movement.
return await RunScenarioAsync();
async Task<object?> RunScenarioAsync()
{
    var before = UO.PredictedZ();
    await Delay(100);
    var after = UO.PredictedZ();
    if (Truth(before != after))
    {
        UO.Print("Prediction changed: " + Convert.ToString(before) + " -> " + Convert.ToString(after));
    }

    return null;
}

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

3. Complete Comparison Function - Script Class

Parameters and execution flow:

  • expected - an example of coordinates/height/direction, not an argument to the native command. PredictionEquals checks UO.Self(), reads the value once and returns 1 (condition met) if equal, otherwise 0 (condition not met). The entire function code is shown below Main. The coincidence of one component does not mean arrival.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        if (Truth(Truth(PredictionEquals(-4)) == true))
        {
            UO.Print("Queued endpoint matches this component");
        }
        else
        {
            UO.Print("Different component or no player");
        }

        return null;
    }

    dynamic PredictionEquals(dynamic expected)
    {
        if (Truth(UO.Self() == 0))
        {
            return false;
        }

        var predicted = UO.PredictedZ();
        return Truth(predicted == expected);
    }

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

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

case "predictedz": return new InjectionValue(ReadPredictedCoordinate(2));

UO.SetRunMountTimer

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

C# signatures

void UO.SetRunMountTimer(object? value);

Sets the step interval for running on horseback. Use to intentionally slow down or return to standard speed. You cannot speed up movement beyond the standard tempo with this command.

Parameters

  • value — Required integer number of milliseconds. Range 100..2000; smaller values, including 0 and negative ones, rise to 100, larger values ​​decrease to 2000.

Return value

void - no value. Call on a separate line. To read the applied spacing, use UO.GetRunMountTimer(). This is not confirmation of the step by the server.

Behavior

  • The setting applies to the riding mode. The standard and minimum allowed value is 100 ms; the upper limit is 2000 ms. The other three modes have separate settings.
  • This is the character's local movement interval, not ping, FPS, pathfinding timeout, or measured server step duration. Increasing the number slows down the movement; decreasing below the standard interval does not speed up the sending of packets.
  • The team itself does not start moving, does not mount the mount and does not change the walking/running mode. The mode is selected while driving; the speed mode and flight specified by the server are also taken into account by the client.
  • The setting is general for the movement of this client: it can be used by manual control, map route and other scripts. Temporarily changing it, keep the previous value and restore it after the operation; do not change one mode at the same time from several procedures.
  • Turning and deviating steps are different from normal moves. Server confirmation, communication delays and obstacles may increase the actual time. The client does not send a series of accelerated steps to catch up on missing frames.
  • 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.

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

1. Restore standard tempo - direct script

Parameters and execution flow:

  • Value=100 — milliseconds. The call sets up subsequent movement, but does not start a route.
UO.SetRunMountTimer(100);

2. Temporarily slow down one motion request - script function

Parameters and execution flow:

  • Value=200 adds 100 ms to the standard interval. The change only applies to horseback runs. For example, select a free direction.
  • UO.Step gets Direction=2 and Running=true. The code 7 can only mean turn; other codes are not true/false. finally restores the previous setting on normal shutdown or error handling.
return  RunScenario();
 object? RunScenario()
{
    var previous = UO.GetRunMountTimer();
    try
    {
        UO.SetRunMountTimer(200);
        var stepResult = UO.Step(2, true);
        if (Truth(stepResult != 7))
        {
            UO.Print("Step was not confirmed: " + Convert.ToString(stepResult));
        }
    }
    finally
    {
        UO.SetRunMountTimer(previous);
    }

    return null;
}

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

3. Check Protection Against Too Low Value - Script Class

Parameters and execution flow:

  • After Value=1 applied is equal to 100. The example does not move the character and restores the original spacing.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var previous = UO.GetRunMountTimer();
        try
        {
            UO.SetRunMountTimer(1);
            var applied = UO.GetRunMountTimer();
            UO.Print("Applied delay, ms: " + Convert.ToString(applied));
        }
        finally
        {
            UO.SetRunMountTimer(previous);
        }

        return null;
    }
}

Command implementation

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

UO.SetRunMountTimer(value) — UO.SetRunMountTimer(Any)

Parameters: value (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "setrunmounttimer":

                    state.RunMountTimer = ClampMoveTimer(Arg(0), 100);

                    bridge.SetMovementTimers(state.RunMountTimer, state.RunUnmountTimer, state.WalkMountTimer, state.WalkUnmountTimer);

                    return InjectionValue.Unit;

UO.SetRunUnmountTimer

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

C# signatures

void UO.SetRunUnmountTimer(object? value);

Sets the walking stride interval. Use to intentionally slow down or return to standard speed. You cannot speed up movement beyond the standard tempo with this command.

Parameters

  • value — Required integer number of milliseconds. Range 200..2000; smaller values, including 0 and negative ones, rise to 200, larger values ​​decrease to 2000.

Return value

void - no value. Call on a separate line. To read the applied spacing, use UO.GetRunUnmountTimer(). This is not confirmation of the step by the server.

Behavior

  • The setting applies to walking mode. The standard and minimum allowed value is 200 ms; the upper limit is 2000 ms. The other three modes have separate settings.
  • This is the character's local movement interval, not ping, FPS, pathfinding timeout, or measured server step duration. Increasing the number slows down the movement; decreasing below the standard interval does not speed up the sending of packets.
  • The team itself does not start moving, does not mount the mount and does not change the walking/running mode. The mode is selected while driving; the speed mode and flight specified by the server are also taken into account by the client.
  • The setting is general for the movement of this client: it can be used by manual control, map route and other scripts. Temporarily changing it, keep the previous value and restore it after the operation; do not change one mode at the same time from several procedures.
  • Turning and deviating steps are different from normal moves. Server confirmation, communication delays and obstacles may increase the actual time. The client does not send a series of accelerated steps to catch up on missing frames.
  • 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.

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

1. Restore standard tempo - direct script

Parameters and execution flow:

  • Value=200 — milliseconds. The call sets up subsequent movement, but does not start a route.
UO.SetRunUnmountTimer(200);

2. Temporarily slow down one motion request - script function

Parameters and execution flow:

  • Value=300 adds 100 ms to the standard interval. The change only applies to running on foot. For example, select a free direction.
  • UO.Step gets Direction=2 and Running=true. The code 7 can only mean turn; other codes are not true/false. finally restores the previous setting on normal shutdown or error handling.
return  RunScenario();
 object? RunScenario()
{
    var previous = UO.GetRunUnMountTimer();
    try
    {
        UO.SetRunUnmountTimer(300);
        var stepResult = UO.Step(2, true);
        if (Truth(stepResult != 7))
        {
            UO.Print("Step was not confirmed: " + Convert.ToString(stepResult));
        }
    }
    finally
    {
        UO.SetRunUnmountTimer(previous);
    }

    return null;
}

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

3. Check Protection Against Too Low Value - Script Class

Parameters and execution flow:

  • After Value=1 applied is equal to 200. The example does not move the character and restores the original spacing.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var previous = UO.GetRunUnMountTimer();
        try
        {
            UO.SetRunUnmountTimer(1);
            var applied = UO.GetRunUnMountTimer();
            UO.Print("Applied delay, ms: " + Convert.ToString(applied));
        }
        finally
        {
            UO.SetRunUnmountTimer(previous);
        }

        return null;
    }
}

Command implementation

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

UO.SetRunUnmountTimer(value) — UO.SetRunUnmountTimer(Any)

Parameters: value (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "setrununmounttimer":

                    state.RunUnmountTimer = ClampMoveTimer(Arg(0), 200);

                    bridge.SetMovementTimers(state.RunMountTimer, state.RunUnmountTimer, state.WalkMountTimer, state.WalkUnmountTimer);

                    return InjectionValue.Unit;

UO.SetWalkMountTimer

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

C# signatures

void UO.SetWalkMountTimer(object? value);

Sets the step interval for walking on horseback. Use to intentionally slow down or return to standard speed. You cannot speed up movement beyond the standard tempo with this command.

Parameters

  • value — Required integer number of milliseconds. Range 200..2000; smaller values, including 0 and negative ones, rise to 200, larger values ​​decrease to 2000.

Return value

void - no value. Call on a separate line. To read the applied spacing, use UO.GetWalkMountTimer(). This is not confirmation of the step by the server.

Behavior

  • The setting applies to the riding mode. The standard and minimum allowed value is 200 ms; the upper limit is 2000 ms. The other three modes have separate settings.
  • This is the character's local movement interval, not ping, FPS, pathfinding timeout, or measured server step duration. Increasing the number slows down the movement; decreasing below the standard interval does not speed up the sending of packets.
  • The team itself does not start moving, does not mount the mount and does not change the walking/running mode. The mode is selected while driving; the speed mode and flight specified by the server are also taken into account by the client.
  • The setting is general for the movement of this client: it can be used by manual control, map route and other scripts. Temporarily changing it, keep the previous value and restore it after the operation; do not change one mode at the same time from several procedures.
  • Turning and deviating steps are different from normal moves. Server confirmation, communication delays and obstacles may increase the actual time. The client does not send a series of accelerated steps to catch up on missing frames.
  • 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.

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

1. Restore standard tempo - direct script

Parameters and execution flow:

  • Value=200 — milliseconds. The call sets up subsequent movement, but does not start a route.
UO.SetWalkMountTimer(200);

2. Temporarily slow down one motion request - script function

Parameters and execution flow:

  • Value=300 adds 100 ms to the standard interval. The change only applies to horseback riding. For example, select a free direction.
  • UO.Step gets Direction=2 and Running=false. The code 7 can only mean turn; other codes are not true/false. finally restores the previous setting on normal shutdown or error handling.
return  RunScenario();
 object? RunScenario()
{
    var previous = UO.GetWalkMountTimer();
    try
    {
        UO.SetWalkMountTimer(300);
        var stepResult = UO.Step(2, false);
        if (Truth(stepResult != 7))
        {
            UO.Print("Step was not confirmed: " + Convert.ToString(stepResult));
        }
    }
    finally
    {
        UO.SetWalkMountTimer(previous);
    }

    return null;
}

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

3. Check Protection Against Too Low Value - Script Class

Parameters and execution flow:

  • After Value=1 applied is equal to 200. The example does not move the character and restores the original spacing.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var previous = UO.GetWalkMountTimer();
        try
        {
            UO.SetWalkMountTimer(1);
            var applied = UO.GetWalkMountTimer();
            UO.Print("Applied delay, ms: " + Convert.ToString(applied));
        }
        finally
        {
            UO.SetWalkMountTimer(previous);
        }

        return null;
    }
}

Command implementation

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

UO.SetWalkMountTimer(value) — UO.SetWalkMountTimer(Any)

Parameters: value (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "setwalkmounttimer":

                    state.WalkMountTimer = ClampMoveTimer(Arg(0), 200);

                    bridge.SetMovementTimers(state.RunMountTimer, state.RunUnmountTimer, state.WalkMountTimer, state.WalkUnmountTimer);

                    return InjectionValue.Unit;

UO.SetWalkUnmountTimer

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

C# signatures

void UO.SetWalkUnmountTimer(object? value);

Sets the walking step interval. Use to intentionally slow down or return to standard speed. You cannot speed up movement beyond the standard tempo with this command.

Parameters

  • value — Required integer number of milliseconds. Range 400..2000; smaller values, including 0 and negative ones, rise to 400, larger values ​​decrease to 2000.

Return value

void - no value. Call on a separate line. To read the applied spacing, use UO.GetWalkUnmountTimer(). This is not confirmation of the step by the server.

Behavior

  • The setting applies to walking mode. The standard and minimum allowed value is 400 ms; the upper limit is 2000 ms. The other three modes have separate settings.
  • This is the character's local movement interval, not ping, FPS, pathfinding timeout, or measured server step duration. Increasing the number slows down the movement; decreasing below the standard interval does not speed up the sending of packets.
  • The team itself does not start moving, does not mount the mount and does not change the walking/running mode. The mode is selected while driving; the speed mode and flight specified by the server are also taken into account by the client.
  • The setting is general for the movement of this client: it can be used by manual control, map route and other scripts. Temporarily changing it, keep the previous value and restore it after the operation; do not change one mode at the same time from several procedures.
  • Turning and deviating steps are different from normal moves. Server confirmation, communication delays and obstacles may increase the actual time. The client does not send a series of accelerated steps to catch up on missing frames.
  • 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.

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

1. Restore standard tempo - direct script

Parameters and execution flow:

  • Value=400 — milliseconds. The call sets up subsequent movement, but does not start a route.
UO.SetWalkUnmountTimer(400);

2. Temporarily slow down one motion request - script function

Parameters and execution flow:

  • Value=500 adds 100 ms to the standard interval. The change only applies to walking. For example, select a free direction.
  • UO.Step gets Direction=2 and Running=false. The code 7 can only mean turn; other codes are not true/false. finally restores the previous setting on normal shutdown or error handling.
return  RunScenario();
 object? RunScenario()
{
    var previous = UO.GetWalkUnmountTimer();
    try
    {
        UO.SetWalkUnmountTimer(500);
        var stepResult = UO.Step(2, false);
        if (Truth(stepResult != 7))
        {
            UO.Print("Step was not confirmed: " + Convert.ToString(stepResult));
        }
    }
    finally
    {
        UO.SetWalkUnmountTimer(previous);
    }

    return null;
}

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

3. Check Protection Against Too Low Value - Script Class

Parameters and execution flow:

  • After Value=1 applied is equal to 400. The example does not move the character and restores the original spacing.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var previous = UO.GetWalkUnmountTimer();
        try
        {
            UO.SetWalkUnmountTimer(1);
            var applied = UO.GetWalkUnmountTimer();
            UO.Print("Applied delay, ms: " + Convert.ToString(applied));
        }
        finally
        {
            UO.SetWalkUnmountTimer(previous);
        }

        return null;
    }
}

Command implementation

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

UO.SetWalkUnmountTimer(value) — UO.SetWalkUnmountTimer(Any)

Parameters: value (Any)

Result: void / Unit.

During a call:

Internal implementation code; this is not a standalone script.

case "setwalkunmounttimer":

                    state.WalkUnmountTimer = ClampMoveTimer(Arg(0), 400);

                    bridge.SetMovementTimers(state.RunMountTimer, state.RunUnmountTimer, state.WalkMountTimer, state.WalkUnmountTimer);

                    return InjectionValue.Unit;

UO.Step

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

C# signatures

dynamic UO.Step(object? direction, object? running);

Requests a single step/rotation and, if a step was sent, waits for server confirmation.

Parameters

  • direction — Direction 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW. The implementation applies a bitwise &7; use 0..7 for clarity.
  • running - true/1 - run request, false/0 - step. Server motion delays persist; It's not a speed multiplier.

Return value

int: 7 — step is confirmed or only a turn is performed; 5 — the server rejected the step; 4 — confirmation timed out (up to 10000 ms); 3 — step blocked by the client; 2 — queue is full; 0 - general failure, shutdown or insufficient endurance. This is not true/false: for example, a non-zero code 5 means failure.

Behavior

  • One team can rotate the character first; this does not necessarily mean moving to the next square.
  • moveCheckStamina, moveExitOnDisconnect and moveOpenDoor are taken into account. Server ban and local ban are different.
  • Do not repeat the command in a loop without analyzing the result and UO.Wait: The motion queue and server speed are limited.
  • QueueStep on the game thread checks the player, connection, direction, queue, tempo and local traffic. Before Player.Walk, each call separately records the Confirm/Deny generations of its sequence and Walker; then returns Result along with this snapshot. Step and pending StepControlled check only this stored pair, not the general fields of the next request; the replacement player/Walker ends the wait with a general refusal. Confirmation of another regular command does not confirm this step. Rotation without movement remains a separate case.

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

1. Step East - Direct Script

Parameters and execution flow:

  • Direction=2 — E, Running=false — step.
  • The exact code 7 is checked; To confirm the movement, compare X/Y before and after.
var result = UO.Step(2, false);
if (Truth(result == 7))
{
    UO.Print("Step accepted or turn completed");
}
else
{
    UO.Print("Movement status: " + Convert.ToString(result));
}

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

2. Distinguishing rotation from translation - script function

Parameters and execution flow:

  • Direction=0 — N. Coordinates are read before and after the call.
  • An unchanged position is possible upon rotation or failure, so result is needed separately.
return  RunScenario();
 object? RunScenario()
{
    var x = UO.GetX();
    var y = UO.GetY();
    var result = UO.Step(0, false);
    if (Truth(UO.GetX() == x) && Truth(UO.GetY() == y))
    {
        UO.Print("Position unchanged; status=" + Convert.ToString(result));
    }

    return null;
}

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

3. Handle server failure when running - script class

Parameters and execution flow:

  • Direction=4 — S, Running=true.
  • Code 5—server failure. UO.Wait=250 ms specifies a pause for the script and does not guarantee that the next attempt will be successful.

Standard driving speed

Minimum step interval: walking - walking 400 ms, running 200 ms; riding - walking 200 ms, running 100 ms.

These are standard client limits, not automatically defined settings for your shard. Server speed and flight modes are counted separately. Script timers can slow down movement, but do not reduce these limits.

Steps, Routes, Follow, Mouse/Key Controls, and Map all use the character's shared queue. Replacing the route, turning, or adjusting the position by the server does not cancel the remaining pause after the step request. After the delay, there is no fast burst to compensate for the dropped frames. Waiting for confirmation, obstacles and poor communication can slow down the movement.

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 result = UO.Step(4, true);
        if (Truth(result == 5))
        {
            UO.Print("Server denied the step");
            await Delay(250);
        }

        return null;
    }

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

Command implementation

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

UO.Step(direction, running) — UO.Step(Any,Any)

Parameters: direction (Any), running (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "step":

                    if (state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0)

                        return new InjectionValue(0);

                    if (state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina)

                        return new InjectionValue(0);

                    if (state.MoveOpenDoor != 0)

                        bridge.OpenDoor();

                    return new InjectionValue(bridge.Step(Arg(0) & 7, Arg(1) != 0));

UO.StepQ

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

C# signatures

int UO.StepQ(object? direction, object? run);
int UO.StepQ(object? direction, object? run, object? timeout);
int UO.StepQ(object? direction, object? run, object? timeout, object? queue);
int UO.StepQ(object? direction, object? run, object? timeout, object? queue, object? waitForAck);

Requests one step through the queue; the additional form may wait for the queue to become free and to be confirmed.

Parameters

  • direction — Direction 0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW. The implementation applies a bitwise &7; use 0..7 for clarity.
  • run - true/1 - run request, false/0 - step. Server motion delays persist; It's not a speed multiplier.
  • timeout — Optional queue waiting time in ms. 0/negative does not wait for release; with waitForAck=true and timeout=0 confirmation is expected before 10000 ms. If the value is positive, waiting for confirmation receives a separate period of the same duration.
  • queue — Optional flag, default true. false transmits forcePacket when requesting a step; does not override server restrictions or clear the accumulated queue.
  • waitForAck - false/absent - return the result of the statement immediately. true — for the sent step, wait for confirmation/refusal.

Return value

int without waitForAck: 0..255 — sequence of the sent request, including valid 0; 256 - turn only; -2 — obstacle on the client; -1 - general failure/full queue/shutdown/endurance. With waitForAck=true: 7 - confirmation, 5 - server failure, 4 - timeout; -1/-2/256 retain the previous meaning. The number 7 in the form without waiting is a sequence, not a confirmation. Check specific numeric codes; if (result) for int in C# is not valid.

Behavior

  • One team can rotate the character first; this does not necessarily mean moving to the next square.
  • moveCheckStamina, moveExitOnDisconnect and moveOpenDoor are taken into account. Server ban and local ban are different.
  • Do not repeat the command in a loop without analyzing the result and UO.Wait: The motion queue and server speed are limited.
  • Without waiting, the command does not confirm the position change. LastStepQUsedDoor indicates an attempt to open the door, not the result of the step.
  • QueueStep on the game thread checks the player, connection, direction, queue, tempo and local traffic. Before Player.Walk, each call separately records the Confirm/Deny generations of its sequence and Walker; then returns Result along with this snapshot. Step and pending StepControlled check only this stored pair, not the general fields of the next request; the replacement player/Walker ends the wait with a general refusal. Confirmation of another regular command does not confirm this step. Rotation without movement remains a separate case.

Standalone C# scripts

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

Simple example

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

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

var result = UO.StepQ(2, false);
UO.Print("StepQ: " + Convert.ToString(result));

1. Get sequence without waiting - direct script

Parameters and execution flow:

  • direction=2 — E, run=false. Two arguments means normal setting without waiting for confirmation.
  • sequence=0 is a valid staging success; sequence=256 means rotation.
var sequence = UO.StepQ(2, false);
if (Truth(sequence >= 0) && Truth(sequence <= 255))
{
    UO.Print("Queued sequence: " + Convert.ToString(sequence));
}
else
{
    UO.Print("Queue status: " + Convert.ToString(sequence));
}

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

2. Wait for confirmation - script function

Parameters and execution flow:

  • direction=4 — S, run=true, timeout=1500 ms. queue=true waitForAck=true.
  • It may take up to two 1500 ms intervals to wait for a seat and then acknowledge. 256 requires separate consideration of rotation.
return  RunScenario();
 object? RunScenario()
{
    var status = UO.StepQ(4, true, 1500, true, true);
    if (Truth(status == 7))
    {
        UO.Print("Server confirmed");
    }
    else
    {
        UO.Print("Step status: " + Convert.ToString(status));
    }

    return null;
}

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

3. Separately process local wall - script class

Parameters and execution flow:

  • direction=6 — W, run=false; timeout=0 does not wait in line; queue=false requests forcePacket, waitForAck=false.
  • ForcePacket does not give the right to go through the wall. For -2, calculate a different route instead of sending to the same cell again.

Standard driving speed

Minimum step interval: walking - walking 400 ms, running 200 ms; riding - walking 200 ms, running 100 ms.

These are standard client limits, not automatically defined settings for your shard. Server speed and flight modes are counted separately. Script timers can slow down movement, but do not reduce these limits.

Steps, Routes, Follow, Mouse/Key Controls, and Map all use the character's shared queue. Replacing the route, turning, or adjusting the position by the server does not cancel the remaining pause after the step request. After the delay, there is no fast burst to compensate for the dropped frames. Waiting for confirmation, obstacles and poor communication can slow down the movement.

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 status = UO.StepQ(6, false, 0, false, false);
        if (Truth(status == -2))
        {
            UO.Print("Local obstacle; calculate another route");
        }

        return null;
    }

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

Command implementation

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

UO.StepQ(direction, run) — UO.StepQ(Any,Any)

Parameters: direction (Any), run (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactStepQ(values))

UO.StepQ(direction, run, timeout) — UO.StepQ(Any,Any,Any)

Parameters: direction (Any), run (Any), timeout (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactStepQ(values))

UO.StepQ(direction, run, timeout, queue) — UO.StepQ(Any,Any,Any,Any)

Parameters: direction (Any), run (Any), timeout (Any), queue (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactStepQ(values))

UO.StepQ(direction, run, timeout, queue, waitForAck) — UO.StepQ(Any,Any,Any,Any,Any)

Parameters: direction (Any), run (Any), timeout (Any), queue (Any), waitForAck (Any)

Result: int / Integer.

During a call:

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

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactStepQ(values))

UO.moveBetweenTwoCorners

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

C# signatures

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

Diagonal resolution with two side squares blocked.

Parameters

  • value — Optional new value. 0 prohibits, non-zero becomes 1. The server may reject such a pass regardless of the client's configuration.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveBetweenTwoCorners();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=0. 0 prohibits, non-zero becomes 1. The server may reject such a pass regardless of the client's configuration.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveBetweenTwoCorners(0);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveBetweenTwoCorners() — UO.moveBetweenTwoCorners()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movebetweentwocorners":

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

                    return new InjectionValue(state.MoveBetweenTwoCorners);

UO.moveBetweenTwoCorners(value) — UO.moveBetweenTwoCorners(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movebetweentwocorners":

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

                    return new InjectionValue(state.MoveBetweenTwoCorners);

UO.moveCheckStamina

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

C# signatures

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

Purpose

minimum movement stamina for this execution.

Parameters

value — minimum movement stamina for this execution. 0…int.MaxValue.

Return value

dynamic → CLR int: UO.moveCheckStamina() / UO.moveCheckStamina(value).

Default: 0.

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

InjectionRuntimeState.MoveCheckStamina → Pathfinder / PlayerMobile.Walk.

For this run, true sets moveCheckStamina=0, false sets 1. Character passage uses the separate moveThroughNPC threshold; its explicit value is not replaced by GUI IgnoreStamina. The server can reject movement.

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 threshold = Convert.ToInt32(UO.moveCheckStamina());
UO.Print("Local minimum stamina: " + threshold);
UO.moveCheckStamina(25);
UO.Print("Explicit minimum: " + UO.moveCheckStamina());
UO.IgnoreStaminaCheck(true);
UO.Print("Ignore maps to zero: " + UO.moveCheckStamina());

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.

,moveCheckStamina 0

UO.moveExitOnDisconnect

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

C# signatures

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

Stop/refuse movement when the connection is disconnected.

Parameters

  • value — Optional new value. 0 turns off, non-zero becomes 1. Disabling verification prevents you from moving on the server without a connection.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveExitOnDisconnect();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=1. 0 turns off, non-zero becomes 1. Disabling verification prevents you from moving on the server without a connection.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveExitOnDisconnect(1);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveExitOnDisconnect() — UO.moveExitOnDisconnect()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveexitondisconnect": if (arguments.Length > 0) state.MoveExitOnDisconnect = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveExitOnDisconnect);

UO.moveExitOnDisconnect(value) — UO.moveExitOnDisconnect(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveexitondisconnect": if (arguments.Length > 0) state.MoveExitOnDisconnect = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveExitOnDisconnect);

UO.moveHeuristicMult

Initial pathfinding settings

In a new script context, UO.moveHeuristicMult() is 120 and UO.moveTurnCost() is 14. An explicit value set by the script is retained for its following movement commands. Multiplier 100 uses the ordinary diagonal-aware distance estimate; a higher multiplier usually speeds up searching but does not guarantee the shortest route. A lower value can substantially increase calculation time. Turn cost 0 disables the extra penalty for changing direction. These settings affect route search, rather than character speed or the UO.LimitMove bound.

int previousHeuristic = (int)UO.moveHeuristicMult();
int previousTurnCost = (int)UO.moveTurnCost();
try
{
    UO.moveHeuristicMult(120);
    UO.moveTurnCost(14);
    UO.Print($"Heuristic: {UO.moveHeuristicMult()}, turn cost: {UO.moveTurnCost()}");
}
finally
{
    UO.moveHeuristicMult(previousHeuristic);
    UO.moveTurnCost(previousTurnCost);
}

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

C# signatures

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

Pathfinder heuristic multiplier as a percentage.

Parameters

  • value — Optional new value. Integer >=0 is preserved; before searching at least 1. The 100 value corresponds to the usual estimate; >100 may prefer a faster search without a minimum cost guarantee. When Optimized=false, 1 is used.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveHeuristicMult();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=100. Integer >=0 is preserved; before searching at least 1. The 100 value corresponds to the usual estimate; >100 may prefer a faster search without a minimum cost guarantee. When Optimized=false, 1 is used.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveHeuristicMult(100);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveHeuristicMult() — UO.moveHeuristicMult()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveheuristicmult": if (arguments.Length > 0) state.MoveHeuristicMultiplier = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveHeuristicMultiplier);

UO.moveHeuristicMult(value) — UO.moveHeuristicMult(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveheuristicmult": if (arguments.Length > 0) state.MoveHeuristicMultiplier = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveHeuristicMultiplier);

UO.moveOpenDoor

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

C# signatures

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

Attempts to open doors in the direction of travel.

Parameters

  • value — Optional new value. 0 turns off, non-zero becomes 1. An explicit openDoors in MoveXYZ replaces this flag for the duration of the call.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • Default is 0. At 1 the door cells are considered passable during A*; an attempt to open a specific adjacent door is made before the step. If there is no known door object, the OpenDoor query is used.
  • This flag does not close doors by itself. UO.AutoCloseDoors(true) enables automatic closing while this execution moves; UO.AutoCloseDoorDelayMs(...) sets its delay. These script settings are independent of the GUI. A locked door or a server denial can prevent the route.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveOpenDoor();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=1. 0 turns off, non-zero becomes 1. An explicit openDoors in MoveXYZ replaces this flag for the duration of the call.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveOpenDoor(1);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveOpenDoor() — UO.moveOpenDoor()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveopendoor": if (arguments.Length > 0) state.MoveOpenDoor = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveOpenDoor);

UO.moveOpenDoor(value) — UO.moveOpenDoor(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveopendoor": if (arguments.Length > 0) state.MoveOpenDoor = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveOpenDoor);

UO.moveThroughCorner

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

C# signatures

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

Resolution of the diagonal between cells with one side cell blocked.

Parameters

  • value — Optional new value. 0 prohibits, non-zero becomes 1. If both side squares are blocked, moveBetweenTwoCorners is applied.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveThroughCorner();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=0. 0 prohibits, non-zero becomes 1. If both side squares are blocked, moveBetweenTwoCorners is applied.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveThroughCorner(0);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveThroughCorner() — UO.moveThroughCorner()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movethroughcorner": if (arguments.Length > 0) state.MoveThroughCorner = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveThroughCorner);

UO.moveThroughCorner(value) — UO.moveThroughCorner(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movethroughcorner": if (arguments.Length > 0) state.MoveThroughCorner = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveThroughCorner);

UO.moveThroughNPC

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

C# signatures

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

Allowing attempts to pass through characters.

Parameters

  • Numeric stamina threshold: attempting to push through a character is allowed when current Stamina >= threshold. Default 1000; 0 permits the attempt regardless of stamina. The server may still reject the move.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • Numeric stamina threshold: attempting to push through a character is allowed when current Stamina >= threshold. Default 1000; 0 permits the attempt regardless of stamina. The server may still reject the move.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveThroughNPC();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=0. Integer >=0, negative becomes 0; positive permits the attempt. An explicit avoidMobiles specifies the reverse constraint for a single call.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveThroughNPC(0);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveThroughNPC() — UO.moveThroughNPC()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movethroughnpc": if (arguments.Length > 0) state.MoveThroughNpc = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveThroughNpc);

UO.moveThroughNPC(value) — UO.moveThroughNPC(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "movethroughnpc": if (arguments.Length > 0) state.MoveThroughNpc = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveThroughNpc);

UO.moveTurnCost

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

C# signatures

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

Additional cost of changing direction when finding a path.

Parameters

  • value — Optional new value. Integer >=0, negative becomes 0. This is the weight of the route, not milliseconds: a straight step costs 10, a diagonal one 14, and this is an addition per turn.

Return value

int is the current stored value. Without argument only reads; with an argument returns the value after applying the rules above. This is a setting, not a result of movement.

Behavior

  • The setting is stored in the runtime state and is used by the corresponding commands at startup; the change does not automatically overwrite the already built path.
  • Returning the original value is shown for normal completion. After a crash, the following recovery lines are not executed.
  • 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.

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

1. Read setting - direct script

Parameters and execution flow:

  • There are no arguments, the state does not change.
  • value is the numeric value of this setting.
var value = UO.moveTurnCost();
UO.Print(Convert.ToString(value));

2. Set Explicit Value - Script Function

Parameters and execution flow:

  • value=14. Integer >=0, negative becomes 0. This is the weight of the route, not milliseconds: a straight step costs 10, a diagonal one 14, and this is an addition per turn.
  • applied shows the saved value, not the successful achievement of the goal.
return  RunScenario();
 object? RunScenario()
{
    var applied = UO.moveTurnCost(14);
    UO.Print("Applied: " + Convert.ToString(applied));
    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.moveTurnCost() — UO.moveTurnCost()

Parameters: No parameters.

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveturncost": if (arguments.Length > 0) state.MoveTurnCost = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveTurnCost);

UO.moveTurnCost(value) — UO.moveTurnCost(Any)

Parameters: value (Any)

Result: dynamic / Any.

During a call:

Internal implementation code; this is not a standalone script.

case "moveturncost": if (arguments.Length > 0) state.MoveTurnCost = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveTurnCost);

UO.LimitMove — Movement distance limit. UO.LimitMove controls destination distance: default 2000, zero unlimited. There are no hidden 4096-step/node or 10000-node caps. Work is sliced and can be stopped. GetPathArray respects the numeric moveThroughNPC stamina threshold and moveOpenDoor.

⚠️ **GitHub.com Fallback** ⚠️