Skip to content

EN API UO TicksUse

Codex edited this page Nov 6, 2026 · 3 revisions

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

UO.TicksUse

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

C# signatures

int UO.TicksUse();

Reads the saved mark TicksUse.

Parameters

There are no parameters.

Return value

int — mark UO.Timer in tenths of a second from the start of runtime. 0 - the mark has not yet been set or the event occurred in the first tenth of a second; it is not milliseconds or calendar time.

Behavior

  • Returns the field ticksUse. It is updated by UseObject; it is not automatic observation of all manual/server activities. The command itself does not change the mark.
  • UO.Timer() - the mark calculates the age in tenths of a second. Marks are not compared between different runtimes.

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.TicksUse();
UO.Print("TicksUse: " + Convert.ToString(result));

1. Direct call - direct script

Parameters and execution flow:

  • Reads the saved mark TicksUse.
var stamp = UO.TicksUse();
UO.Print(stamp);

2. Explicit option - script function

Parameters and execution flow:

  • Returns the field ticksUse. It is updated by UseObject; it is not automatic observation of all manual/server activities. The command itself does not change the mark.
return  RunScenario();
 object? RunScenario()
{
    var stamp = UO.TicksUse();
    var ageTenths = UO.Timer() - stamp;
    UO.Print(ageTenths);
    return null;
}

3. Full Helper Function - Script Class

Parameters and execution flow:

  • UO.Timer() - the mark calculates the age in tenths of a second. Marks are not compared between different runtimes.
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var before = UO.TicksUse();
        UO.Wait(250);
        var after = UO.TicksUse();
        UO.Print(before == after);
        return null;
    }
}

Command implementation

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

UO.TicksUse() — UO.TicksUse()

Parameters: No parameters.

Result: int / Integer.

During a call:

Internal implementation code; this is not a standalone script.

public int TicksUse() => ticksUse;

Clone this wiki locally