Repository navigation
EN API UO SetGlobal
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.SetGlobal(object? name, object? value);
void UO.SetGlobal(object? globalRegion, object? varName, object? varValue);SetGlobal and GetGlobal share one namespace across every script/profile, including separate Full Client and Client processes. Values are strings; an absent key returns "N/A". Keys are case sensitive; region overloads identify a region/name pair. Manager/Game Manager/CSharp/globals.json is read fresh under a process-shared lock and survives restart. Shared forms explicitly alias this same store.
-
globalRegion— Namespace combined with the key name. -
name— Case-sensitive shared key name. -
value— Value stored as text. -
varName— Case-sensitive shared key name. -
varValue— Value stored as text.
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
#setglobal team.target 0x40001234
#set global team.message Привіт усім
Each block is a complete standalone .csx. Replace demonstration serials, types and coordinates. Arguments follow the signature order; named C# arguments make their roles explicit.
UO.SetGlobal("team.target", 0x40001234);
UO.Print(UO.GetGlobal("team.target"));UO.SetGlobal("team.message", "Привіт");
UO.Print(UO.GetGlobal("team.message"));UO.SetGlobal("team", "delay", "350");
UO.Print(Convert.ToString(UO.GetGlobal("team", "delay")));new CommandSample().Execute(UO);
sealed class CommandSample
{
public void Execute(global::ClassicUO.CSharp.CSharpGameApi api)
{
api.SetGlobal("team.target", 0x40001234);
api.Print(api.GetGlobal("team.target"));
}
}CSharpGameApi.SetGlobal
-> CSharpScriptGlobals
-> InjectionScript.Runtime.InjectionApiUO.RegisterClientApiCompatibility
-> InjectionScript.Runtime.State.Globals.SetGlobal
Globals -> SharedGlobalStore -> named mutex -> atomic JSON replacement
ClassicUO — Bad Newbie & C# Scripts IDE