EN Information and Shared Globals - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

Info / Hide / Mount / Global

Invocation origin controls presentation: graphical chat commands and bound console commands open a table with fields, values, Ctrl+C and scrolling. Ordinary C# scripts receive report strings without windows or target cursors, even with an open game window. Only client-known data is available.

Parameterless Info and InfoTile arm a target in graphical chat. In a script, Info() reads the last object target or the player; InfoTile() reads the land under the player. Explicit serial, type and coordinates query the chosen object or tile. The third argument of InfoTile(x,y,map) is a map number.

Hide hides a loaded object locally without using Hiding. Resend/Resync clears this local hiding and restores the previous drawing state of loaded objects, including after repeated Hide. Object data is retained; the server Hidden flag is unchanged.

Mount and Dismount send a protocol use-object request without a manual double-click or the war-mode attack policy. The int result is the current Mount-layer item serial, not a success flag. Server confirmation is asynchronous: Mount may still return 0 and Dismount may return the serial before removal is confirmed. Read ObjAtLayer("Mount") after the server reply.

UO.SetGlobal and UO.GetGlobal share one namespace across all scripts and profiles in the same portable installation, including online Manager/Full Client/Client sessions and the offline IDE. C# locals, fields and constants remain in their own scope and run; they do not automatically become shared keys. Stored values are strings; an absent key returns "N/A". Keys are case sensitive; region overloads identify a region/name pair. The common Manager/Game Manager/CSharp/globals.json file is read fresh under a process-shared lock and survives restart. Shared forms explicitly alias this same store. The Globals view refreshes shared values independently of script execution, including in the offline IDE.

This complete shared-status.csx example writes a shared key and reads it back. The status variable belongs to this C# code; the manual.example.status key is available to other scripts and profiles.

string status = "ready";
UO.SetGlobal("manual.example.status", status);
UO.Print(UO.GetGlobal("manual.example.status"));

Configure the prefix in C# Scripts IDE; # below is an example. Separate parameters with spaces; quotes keep text in one argument. id means serial and type means graphic. xy x y [z] selects the first loaded object at the point; type alone resolves the first matching loaded object. The third argument of InfoTile(x,y,map) is a map number, not Z.

InfoGump() reads the latest active server dialog or local client window. Supply an ID or index to choose one; last, LastGump and Last Gump mean the latest window. InfoGumps returns the list. Inspector windows are excluded. Only graphical commands open an inspector table.