Repository navigation
EN API UO TicksUse
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Home · C# · IDE · UO API · A–Z · Examples · Languages
int UO.TicksUse();Reads the saved mark TicksUse.
There are no parameters.
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.
- 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.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.
var result = UO.TicksUse();
UO.Print("TicksUse: " + Convert.ToString(result));Parameters and execution flow:
- Reads the saved mark TicksUse.
var stamp = UO.TicksUse();
UO.Print(stamp);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;
}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;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: int / Integer.
During a call:
Internal implementation code; this is not a standalone script.
public int TicksUse() => ticksUse;ClassicUO — Bad Newbie & C# Scripts IDE