Skip to content

EN Runtime Helpers 7

Codex edited this page Oct 17, 2026 · 4 revisions

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

Helper functions 7

Internal implementation code; this is not a standalone script.

ClassicUO.CSharp.CSharpCallbacks.TryInvoke

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:412.

Result: true.

Calls:

Internal implementation code; this is not a standalone script.

case "FunRunning":
                string runningName = Convert.ToString(arguments[0]) ?? "";
                result = IsRunning(runningName) || events is ICSharpScriptHost runningHost && runningHost.IsCSharpScriptRunning(runningName) ? 1 : 0;
                return true;

ClassicUO.CSharp.CSharpCallbacks.TryInvoke

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:426.

when Length== 1: string routine = Convert.ToString(arguments[0]) ?? ""

Result: when.

Calls: Convert.ToString.

Calls:

Internal implementation code; this is not a standalone script.

case "Terminate" when arguments.Length == 1:
                string routine = Convert.ToString(arguments[0]) ?? "";
                if (Exists(routine)) { Cancel(routine); return true; }
                if (Cancel(routine)) return true;
                return false;

ClassicUO.CSharp.CSharpCallbacks.HandlerName

Performs the displayed calls and state updates.

Parameters: object? value

Source: Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:335.

private static string HandlerName(object? value)

Result: string.

Conditions:

  • name.StartsWith("exec ", StringComparison.OrdinalIgnoreCase)
  • name.StartsWith("_exec ", StringComparison.OrdinalIgnoreCase)

Calls:

  • (Convert.ToString(value) ?? "").Trim
  • Convert.ToString
  • name.StartsWith
  • name[5..].Trim
  • name[6..].Trim

Internal implementation code; this is not a standalone script.

private static string HandlerName(object? value)
    {
        string name = (Convert.ToString(value) ?? "").Trim();
        if (name.StartsWith("exec ", StringComparison.OrdinalIgnoreCase)) return name[5..].Trim();
        if (name.StartsWith("_exec ", StringComparison.OrdinalIgnoreCase)) return name[6..].Trim();
        return name;
    }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.BookSetPageText

Performs the displayed calls and state updates.

Parameters: int page, string text

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2001.

public void BookSetPageText(int page, string text)

Result: void.

Conditions:

  • book == null
  • !book.YokoTrySetPageText(page, text)

Calls:

  • Invoke
  • GetOpenBook
  • Error
  • book.YokoTrySetPageText

Internal implementation code; this is not a standalone script.

public void BookSetPageText(int page, string text) => Invoke(() =>

        {

            ISessionBook book = GetOpenBook();

            if (book == null) { Error("UO.BookSetPageText: no open book."); return; }

            if (!book.YokoTrySetPageText(page, text))

                Error("UO.BookSetPageText: invalid page, read-only book, too many lines, or a line is too long.");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Bow

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1581.

public void Bow()

Result: void.

Calls:

  • Invoke
  • GameActions.EmoteAction

Internal implementation code; this is not a standalone script.

public void Bow() => Invoke(() => GameActions.EmoteAction("bow"));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CloseMenu

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:701.

public void CloseMenu()

Result: void.

Calls:

  • Invoke
  • _world.ServerMenus.Snapshot
  • menu.CancelForYoko

Internal implementation code; this is not a standalone script.

public void CloseMenu() => Invoke(() =>

        {

            foreach (SessionMenu menu in _world.ServerMenus.Snapshot())

                menu.CancelForYoko();

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ColdResistance

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:168.

public int ColdResistance

Result: int.

Calls:

  • Invoke

Internal implementation code; this is not a standalone script.

public int ColdResistance => Invoke(() => CurrentPlayer?.ColdResistance ?? 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Error

Performs the displayed calls and state updates.

Parameters: string message

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3986.

public void Error(string message)

Result: void.

Calls:

  • ReportStatus

Internal implementation code; this is not a standalone script.

public void Error(string message) => ReportStatus(message);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.FindCount

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2482.

public int FindCount()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int FindCount() => _findCount;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.FindItem

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:139.

public int FindItem

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int FindItem => _findItem;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.FindNotoriety

Performs the displayed calls and state updates.

Parameters: int type, int notoriety

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2876.

public int FindNotoriety(int type, int notoriety)

Result: int.

Conditions:

  • `mobile.IsDestroyed || State.IgnoredSerials.Contains((int)mobile.Serial) || ignoredTypes.Matches(mobile.Graphic, mobile.Hue) || mobile == _world.Player

                      || type >= 0 && type != 0xFFFF && mobile.Graphic != (ushort)type
    
                      || notoriety >= 0 && (int)mobile.NotorietyFlag != notoriety
    
                      || mobile.Distance > State.FindDistance
    
                      || _world.Player != null && Math.Abs(mobile.Z - _world.Player.Z) > State.FindVertical`
    

Calls:

  • Invoke
  • ResetFindResults
  • State.IgnoreTypeLists.FilterFor
  • State.IgnoredSerials.Contains
  • ignoredTypes.Matches
  • Math.Abs
  • RegisterFound

Internal implementation code; this is not a standalone script.

public int FindNotoriety(int type, int notoriety)

        {

            return Invoke(() =>

            {

                ResetFindResults();

                IgnoreTypeFilter ignoredTypes = State.IgnoreTypeLists.FilterFor(State.SelectedIgnoreList);

                foreach (Mobile mobile in _world.Mobiles.Values)

                {

                    if (mobile.IsDestroyed || State.IgnoredSerials.Contains((int)mobile.Serial) || ignoredTypes.Matches(mobile.Graphic, mobile.Hue) || mobile == _world.Player

                        || type >= 0 && type != 0xFFFF && mobile.Graphic != (ushort)type

                        || notoriety >= 0 && (int)mobile.NotorietyFlag != notoriety

                        || mobile.Distance > State.FindDistance

                        || _world.Player != null && Math.Abs(mobile.Z - _world.Player.Z) > State.FindVertical)

                    {

                        continue;

                    }

                    RegisterFound(mobile);

                }

                return _findItem;

            });

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GameServerPort

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:184.

public int GameServerPort

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int GameServerPort => Settings.GlobalSettings.Port;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetHP

Performs the displayed calls and state updates.

Parameters: int id

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:234.

public int GetHP(int id)

Result: int.

Calls:

  • WithEntity

Internal implementation code; this is not a standalone script.

public int GetHP(int id) => WithEntity(id, e => e.Hits);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetLocked

Performs the displayed calls and state updates.

Parameters: int id

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:627.

public int GetLocked(int id)

Result: int.

Calls:

  • Invoke
  • _world.Get

Internal implementation code; this is not a standalone script.

public int GetLocked(int id) => Invoke(() => (_world.Get(unchecked((uint)id)) as Mobile)?.IsParalyzed == true ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetPing

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:344.

public int GetPing()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int GetPing() => NetClient.Socket.Statistics.ServerPing;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetStaticArt::Write32

Performs the displayed calls and state updates.

Parameters: buffer, offset, value

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3351.

static void Write32(byte[] buffer, int offset, int value)

Result: void.

Internal implementation code; this is not a standalone script.

static void Write32(byte[] buffer, int offset, int value)

            {

                buffer[offset] = (byte)value;

                buffer[offset + 1] = (byte)(value >> 8);

                buffer[offset + 2] = (byte)(value >> 16);

                buffer[offset + 3] = (byte)(value >> 24);

            }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetTradeOpponentName

Performs the displayed calls and state updates.

Parameters: int tradeNumber

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:267.

public string GetTradeOpponentName(int tradeNumber)

Result: string.

Calls:

  • Invoke
  • FindNumberedTrade

Internal implementation code; this is not a standalone script.

public string GetTradeOpponentName(int tradeNumber) => Invoke(() =>

        {

            ISessionTrade gump = FindNumberedTrade(tradeNumber);

            return gump?.OpponentName ?? string.Empty;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.InJournalBetweenTimes

Performs the displayed calls and state updates.

Parameters: string pattern, int startTime, int endTime, int limit

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2130.

public int InJournalBetweenTimes(string pattern, int startTime, int endTime, int limit)

Result: int.

Calls:

  • now.AddMilliseconds
  • Math.Max
  • Math.Min
  • FindJournal

Internal implementation code; this is not a standalone script.

public int InJournalBetweenTimes(string pattern, int startTime, int endTime, int limit)

        {

            DateTime now = DateTime.Now;

            DateTime start = now.AddMilliseconds(-Math.Max(startTime, endTime));

            DateTime end = now.AddMilliseconds(-Math.Min(startTime, endTime));

            return FindJournal(pattern, start, end, limit, false, true);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.InJournalSystemBetweenTimes

Performs the displayed calls and state updates.

Parameters: string pattern, int startTime, int endTime, int limit

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2144.

public int InJournalSystemBetweenTimes(string pattern, int startTime, int endTime, int limit)

Result: int.

Calls:

  • now.AddMilliseconds
  • Math.Max
  • Math.Min
  • FindJournal

Internal implementation code; this is not a standalone script.

public int InJournalSystemBetweenTimes(string pattern, int startTime, int endTime, int limit)

        {

            DateTime now = DateTime.Now;

            DateTime start = now.AddMilliseconds(-Math.Max(startTime, endTime));

            DateTime end = now.AddMilliseconds(-Math.Min(startTime, endTime));

            return FindJournal(pattern, start, end, limit, true, true);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsWaterTile

Performs the displayed calls and state updates.

Parameters: int x, int y

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:676.

public int IsWaterTile(int x, int y)

Result: int.

Calls:

  • Invoke
  • AnyTileAt

Internal implementation code; this is not a standalone script.

public int IsWaterTile(int x, int y) => Invoke(() => AnyTileAt(x, y, tile =>

            tile is Land land ? land.TileData.IsWet

                : tile.Graphic < Client.UO.FileManager.TileData.StaticData.Length

                    && Client.UO.FileManager.TileData.StaticData[tile.Graphic].IsWet) ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastCorpse

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:142.

public int LastCorpse

Result: int.

Calls:

  • Invoke
  • _world.Items.Values.Where(i => i.IsCorpse && !i.IsDestroyed).OrderBy(i => i.Distance).FirstOrDefault
  • _world.Items.Values.Where(i => i.IsCorpse && !i.IsDestroyed).OrderBy
  • _world.Items.Values.Where

Internal implementation code; this is not a standalone script.

public int LastCorpse => Invoke(() => (int)(_world.Items.Values.Where(i => i.IsCorpse && !i.IsDestroyed).OrderBy(i => i.Distance).FirstOrDefault()?.Serial ?? 0));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MaxMana

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:166.

public int MaxMana

Result: int.

Calls:

  • Invoke

Internal implementation code; this is not a standalone script.

public int MaxMana => Invoke(() => CurrentPlayer?.ManaMax ?? 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MoveItems

Performs the displayed calls and state updates.

Parameters: int sourceContainerId, int type, int color, int targetContainerId, int x, int y, int z, int delayMs

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1455.

public int MoveItems(int sourceContainerId, int type, int color, int targetContainerId, int x, int y, int z, int delayMs)

Result: int.

Calls:

  • MoveContainerItems

Internal implementation code; this is not a standalone script.

public int MoveItems(int sourceContainerId, int type, int color, int targetContainerId, int x, int y, int z, int delayMs)

            => MoveContainerItems(sourceContainerId, type, color, targetContainerId, x, y, z, delayMs).Sent > 0 ? 1 : 0;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Race

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:174.

public int Race

Result: int.

Calls:

  • Invoke

Internal implementation code; this is not a standalone script.

public int Race => Invoke(() => (int)(CurrentPlayer?.Race ?? 0));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SelectGump

Performs the displayed calls and state updates.

Parameters: int id

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3132.

public void SelectGump(int id)

Result: void.

Conditions:

  • _selectedServerGump == null && id >= 0 && id < gumps.Count
  • _selectedServerGump == null

Calls:

  • Invoke
  • ServerGumpsUnsafe
  • gumps.FirstOrDefault
  • Error

Internal implementation code; this is not a standalone script.

public void SelectGump(int id) => Invoke(() =>

        {

            List<Gump> gumps = ServerGumpsUnsafe();

            _selectedServerGump = gumps.FirstOrDefault(g => g.LocalSerial == (uint)id || g.ServerSerial == (uint)id);

            if (_selectedServerGump == null && id >= 0 && id < gumps.Count)

            {

                _selectedServerGump = gumps[id];

            }

            if (_selectedServerGump == null)

            {

                Error($"UO.SelectGump: gump {id} was not found");

            }

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SendGumpSelect

Performs the displayed calls and state updates.

Parameters: int gumpIndex, int triggerId

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3000.

public int SendGumpSelect(int gumpIndex, int triggerId)

Result: int.

Calls:

  • Invoke
  • ServerGumpsUnsafe().ElementAtOrDefault
  • ServerGumpsUnsafe
  • SendGumpButtonUnsafe

Internal implementation code; this is not a standalone script.

public int SendGumpSelect(int gumpIndex, int triggerId) => Invoke(() =>

        {

            Gump gump = ServerGumpsUnsafe().ElementAtOrDefault(gumpIndex);

            return SendGumpButtonUnsafe(gump, triggerId, $"gump index {gumpIndex} was not found");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetAutoBuyRule

Performs the displayed calls and state updates.

Parameters: int type, int color, int quantity, int maxPrice, string name

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3905.

public void SetAutoBuyRule(int type, int color, int quantity, int maxPrice, string name)

Result: void.

Calls:

  • Invoke
  • SetAutoShopRule

Internal implementation code; this is not a standalone script.

public void SetAutoBuyRule(int type, int color, int quantity, int maxPrice, string name) =>

            Invoke(() => SetAutoShopRule(ProfileManager.CurrentProfile?.BackNewbieAutoBuyRules, true, type, color, quantity, maxPrice, name));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetMapFigure

Performs the displayed calls and state updates.

Parameters: int figureId, int kind, int coord, int x1, int y1, int x2, int y2, int brushColor, int brushStyle, int color, int worldNum, string text

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2551.

public int SetMapFigure(int figureId, int kind, int coord, int x1, int y1, int x2, int y2, int brushColor, int brushStyle, int color, int worldNum, string text)

Result: int.

Calls:

  • Invoke
  • WorldMapGump.SetYokoMapFigure

Internal implementation code; this is not a standalone script.

public int SetMapFigure(int figureId, int kind, int coord, int x1, int y1, int x2, int y2, int brushColor, int brushStyle, int color, int worldNum, string text)

            => Invoke(() => WorldMapGump.SetYokoMapFigure(figureId, kind, coord, x1, y1, x2, y2, brushColor, brushStyle, color, worldNum, text));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetPauseScriptOnDisconnectStatus

Performs the displayed calls and state updates.

Parameters: int enabled

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:317.

public void SetPauseScriptOnDisconnectStatus(int enabled)

Result: void.

Calls:

—

Internal implementation code; this is not a standalone script.

public void SetPauseScriptOnDisconnectStatus(int enabled) => _manager.PauseScriptsOnDisconnect = enabled != 0;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SplitPatterns

Performs the displayed calls and state updates.

Parameters: string pattern

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:4073.

private static string[] SplitPatterns(string pattern)

Result: string[].

Calls:

  • (pattern ?? string.Empty).Split

Internal implementation code; this is not a standalone script.

private static string[] SplitPatterns(string pattern) => (pattern ?? string.Empty).Split('|', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TargetToTile

Performs the displayed calls and state updates.

Parameters: int type, int x, int y, int z

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:855.

public void TargetToTile(int type, int x, int y, int z)

Result: void.

Conditions:

  • _world.TargetManager.IsServerTarget

Calls:

  • Invoke
  • _world.TargetManager.Target

Internal implementation code; this is not a standalone script.

public void TargetToTile(int type, int x, int y, int z) => Invoke(() =>

        {

            if (_world.TargetManager.IsServerTarget)

                _world.TargetManager.Target((ushort)type, (ushort)x, (ushort)y, (short)z);

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TextPrint

Performs the displayed calls and state updates.

Parameters: string text

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1979.

public void TextPrint(string text)

Result: void.

Conditions:

  • _textWindow.Count >= MaxTextWindowLines

Calls:

  • _textWindow.RemoveRange
  • _textWindow.Add
  • Invoke
  • YokoTextWindowGump.Show
  • ReportStatus

Internal implementation code; this is not a standalone script.

public void TextPrint(string text)

        {

            if (_textWindow.Count >= MaxTextWindowLines)

                _textWindow.RemoveRange(0,

                    _textWindow.Count - MaxTextWindowLines + 1);

            _textWindow.Add(text ?? string.Empty);

            _textWindowOpen = true;

            Invoke(() =>

            {

                YokoTextWindowGump.Show(_world, _textWindow);

                ReportStatus($"UO.TextPrint: {_textWindow.Count} line(s) visible");

            });

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TryProbeServerPing

Performs the displayed calls and state updates.

Parameters: int timeoutMs, out int pingMs

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:348.

private bool TryProbeServerPing(int timeoutMs, out int pingMs)

Result: bool.

Conditions:

  • !_world.InGame || !NetClient.Socket.IsConnected
  • request.Token < 0
  • NetClient.Socket.Statistics.GetPingEchoGeneration((byte)request.Token) != request.Generation
  • timeout == 0

Calls:

  • Math.Max
  • Invoke
  • NetClient.Socket.Statistics.SendPingProbe
  • NetClient.Socket.Statistics.GetPingEchoGeneration
  • Wait
  • Math.Min

Internal implementation code; this is not a standalone script.

private bool TryProbeServerPing(int timeoutMs, out int pingMs)

        {

            int timeout = Math.Max(0, timeoutMs);

            (int Token, int Generation) request = Invoke(() =>

            {

                if (!_world.InGame || !NetClient.Socket.IsConnected)

                    return (-1, -1);



                return NetClient.Socket.Statistics.SendPingProbe();

            });



            if (request.Token < 0)

            {

                pingMs = -1;

                return false;

            }



            long deadline = Environment.TickCount64 + timeout;

            do

            {

                if (NetClient.Socket.Statistics.GetPingEchoGeneration((byte)request.Token) != request.Generation)

                {

                    pingMs = NetClient.Socket.Statistics.ServerPing;

                    return pingMs >= 0;

                }



                if (timeout == 0)

                    break;



                long remaining = deadline - Environment.TickCount64;

                if (remaining <= 0)

                    break;



                Wait((int)Math.Min(10, remaining));

            }

            while (true);



            pingMs = -1;

            return false;

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.UnsetReceivingContainer

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1305.

public void UnsetReceivingContainer()

Result: void.

Calls:

—

Internal implementation code; this is not a standalone script.

public void UnsetReceivingContainer() => State.ReceivingContainer = 0;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.UseObject

Performs the displayed calls and state updates.

Parameters: int id

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:778.

public void UseObject(int id)

Result: void.

Calls:

  • Invoke
  • GameActions.DoubleClick

Internal implementation code; this is not a standalone script.

public void UseObject(int id) => Invoke(() => GameActions.DoubleClick(_world, (uint)id));

ClassicUO.Game.Managers.LastCharacterManager.OverrideLastCharacter

Performs the displayed calls and state updates.

Parameters: string name, bool oneShot = false

Source: Project_Full/src/ClassicUO.Client/Game/Managers/LastCharacterManager.cs:107.

public static void OverrideLastCharacter(string name, bool oneShot = false)

Result: void.

Calls:

  • string.IsNullOrEmpty

Internal implementation code; this is not a standalone script.

public static void OverrideLastCharacter(string name, bool oneShot = false)
        {
            LastCharacterNameOverride = name ?? string.Empty;
            LastCharacterNameOverrideOneShot = oneShot && !string.IsNullOrEmpty(LastCharacterNameOverride);
        }

ClassicUO.Game.Managers.UIManager.GetGump

Performs the displayed calls and state updates.

Parameters: uint? serial = null

Source: Project_Full/src/ClassicUO.Client/Game/Managers/UIManager.cs:277.

public static T GetGump<T>(uint? serial = null)

Result: T.

Conditions:

  • serial.HasValue
  • !c.IsDisposed && c.LocalSerial == serial.Value && c is T t
  • !c.IsDisposed && c is T t

Calls:

—

Internal implementation code; this is not a standalone script.

public static T GetGump<T>(uint? serial = null) where T : Control
        {
            if (serial.HasValue)
            {
                for (LinkedListNode<Gump> last = Gumps.Last; last != null; last = last.Previous)
                {
                    Control c = last.Value;

                    if (!c.IsDisposed && c.LocalSerial == serial.Value && c is T t)
                    {
                        return t;
                    }
                }
            }
            else
            {
                for (LinkedListNode<Gump> first = Gumps.First; first != null; first = first.Next)
                {
                    Control c = first.Value;

                    if (!c.IsDisposed && c is T t)
                    {
                        return t;
                    }
                }
            }

            return null;
        }

ClassicUO.Game.Managers.YokoInjectionManager.AppendIdeOutput

Performs the displayed calls and state updates.

Parameters: string scriptKey, string text

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:679.

internal void AppendIdeOutput(string scriptKey, string text)

Result: void.

Calls:

  • _ideToolBuffers.AppendOutput

Internal implementation code; this is not a standalone script.

internal void AppendIdeOutput(string scriptKey, string text) =>

            _ideToolBuffers.AppendOutput(scriptKey, text);

ClassicUO.Game.Managers.YokoInjectionManager.GetPendingTargetSerials

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3347.

internal int[] GetPendingTargetSerials()

Result: int[].

Calls:

  • _pendingTargets.ToArray().Where(t => !t.Owner.IsCancellationRequested).Select(t => (int)t.Serial).ToArray
  • _pendingTargets.ToArray().Where(t => !t.Owner.IsCancellationRequested).Select
  • _pendingTargets.ToArray().Where
  • _pendingTargets.ToArray

Internal implementation code; this is not a standalone script.

internal int[] GetPendingTargetSerials() =>

            // Zero denotes a queued tile/cancellation. Waiting() and timed casts

            // need to count these entries as well as object serials.

            _pendingTargets.ToArray().Where(t => !t.Owner.IsCancellationRequested).Select(t => (int)t.Serial).ToArray();

ClassicUO.Game.Managers.YokoInjectionManager.InvokeOnGameThread

Performs the displayed calls and state updates.

Parameters: Func<T> callback, CancellationToken cancellationToken

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3459.

internal T InvokeOnGameThread<T>(Func<T> callback, CancellationToken cancellationToken)

Result: T.

Conditions:

  • callback == null
  • Volatile.Read(ref _gameThreadId) == Environment.CurrentManagedThreadId
  • cancellationToken.IsCancellationRequested

Calls:

  • nameof
  • cancellationToken.ThrowIfCancellationRequested
  • Volatile.Read
  • callback
  • EnqueueMainThreadAction
  • result.TrySetCanceled
  • result.TrySetResult
  • result.TrySetException
  • result.Task.Wait
  • result.Task.GetAwaiter().GetResult
  • result.Task.GetAwaiter

Internal implementation code; this is not a standalone script.

internal T InvokeOnGameThread<T>(Func<T> callback, CancellationToken cancellationToken)

        {

            if (callback == null)

                throw new ArgumentNullException(nameof(callback));

            cancellationToken.ThrowIfCancellationRequested();

            if (Volatile.Read(ref _gameThreadId) == Environment.CurrentManagedThreadId)

                return callback();



            var result = new TaskCompletionSource<T>(TaskCreationOptions.RunContinuationsAsynchronously);

            EnqueueMainThreadAction(() =>

            {

                if (cancellationToken.IsCancellationRequested)

                {

                    result.TrySetCanceled(cancellationToken);

                    return;

                }



                try

                {

                    result.TrySetResult(callback());

                }

                catch (Exception ex)

                {

                    result.TrySetException(ex);

                }

            }, () => result.TrySetCanceled());



            result.Task.Wait(cancellationToken);

            return result.Task.GetAwaiter().GetResult();

        }

ClassicUO.Game.Managers.YokoInjectionManager.MarkRuntimeStateChanged

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3806.

private void MarkRuntimeStateChanged()

Result: void.

Calls:

  • Interlocked.Increment

Internal implementation code; this is not a standalone script.

private void MarkRuntimeStateChanged() =>

            Interlocked.Increment(ref _runtimeStateRevision);

ClassicUO.Game.Managers.YokoInjectionManager.QueueTarget

Performs the displayed calls and state updates.

Parameters: uint serial, CancellationToken owner = default

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3287.

internal void QueueTarget(uint serial, CancellationToken owner = default)

Result: void.

Calls:

  • owner.ThrowIfCancellationRequested
  • _pendingTargets.Enqueue

Internal implementation code; this is not a standalone script.

internal void QueueTarget(uint serial, CancellationToken owner = default)

        {

            lock (_pendingTargetLock)

            {

                owner.ThrowIfCancellationRequested();

                _pendingTargets.Enqueue(new PendingTarget(serial, owner));

            }

        }

ClassicUO.Game.UI.Gumps.Gump.OnButtonClick

Performs the displayed calls and state updates.

Parameters: int buttonID

Source: Project_Full/src/ClassicUO.Client/Game/UI/Gumps/Gump.cs:142.

public override void OnButtonClick(int buttonID)

Result: void.

Conditions:

  • SessionState is { } state
  • !IsDisposed && (LocalSerial != 0 || ServerSerial != 0)
  • CanMove

Calls:

  • state.OnButtonClick
  • switches.Add
  • entries.Add
  • GameActions.ReplyGump
  • switches.ToArray
  • entries.ToArray
  • UIManager.SavePosition
  • UIManager.RemovePosition
  • Dispose

The source file contains the complete code; exact excerpts follow.

Internal implementation code; this is not a standalone script.

public override void OnButtonClick(int buttonID)
        {
            if (SessionState is { } state)
            {
                state.OnButtonClick(buttonID);
                return;
            }
            if (!IsDisposed && (LocalSerial != 0 || ServerSerial != 0))
// …
                if (CanMove)
// …
                else
                {
                    UIManager.RemovePosition(ServerSerial);
                }

                Dispose();
            }
        }

ClassicUO.Game.World.ResolveProfileServerName

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.Client/Game/World.cs:258.

internal string ResolveProfileServerName()

Result: string.

Conditions:

  • string.IsNullOrWhiteSpace(_profileServerIdentity)

Calls:

  • string.IsNullOrWhiteSpace
  • Path.Combine
  • ProfileShardIdentity.Resolve

Internal implementation code; this is not a standalone script.

internal string ResolveProfileServerName()

        {

            if (string.IsNullOrWhiteSpace(_profileServerIdentity))

            {

                string runtimeName = string.IsNullOrWhiteSpace(ServerName) || ServerName == "_"

                    ? Settings.GlobalSettings.LastServerName

                    : ServerName;

                string defaultSettingsPath = Path.Combine(

                    CUOEnviroment.ExecutablePath,

                    Settings.SETTINGS_FILENAME

                );



                _profileServerIdentity = ProfileShardIdentity.Resolve(

                    runtimeName,

                    Settings.GlobalSettings.IP,

                    Settings.GlobalSettings.Port,

                    _selectedProfileShardHost,

                    defaultSettingsPath,

                    authoritativeEndpoint: _sessionAccount != null

                );

            }



            return _profileServerIdentity;

        }

InjectionScript.Runtime.InjectionApiUO.CheckLag

Performs the displayed calls and state updates.

Parameters: InjectionValue timeout, InjectionValue retries

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3865.

public int CheckLag(InjectionValue timeout, InjectionValue retries)

Result: int.

Conditions:

  • bridge.CheckLag(timeoutMs) != 0

Calls:

  • Math.Max
  • NumberConversions.ToInt
  • bridge.CheckLag

Internal implementation code; this is not a standalone script.

public int CheckLag(InjectionValue timeout, InjectionValue retries)

        {

            int timeoutMs = Math.Max(0, NumberConversions.ToInt(timeout));

            int attempts = Math.Max(1, NumberConversions.ToInt(retries));

            for (int attempt = 0; attempt < attempts; attempt++)

            {

                if (bridge.CheckLag(timeoutMs) != 0)

                    return 1;

            }

            return 0;

        }

InjectionScript.Runtime.InjectionApiUO.CompactGetWorldItems

Performs the displayed calls and state updates.

Parameters: InjectionValue[] values

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4969.

private InjectionValue CompactGetWorldItems(InjectionValue[] values)

Result: InjectionValue.

Conditions:

  • values.Length > 3 && !TryResolveWorldItemQueryContainer(values[3], out container)
  • nearest

Calls:

  • ResolveType

  • NumberConversions.ToInt

  • ResolveCompactDistance

  • bridge.GetFindDistance

  • TryResolveWorldItemQueryContainer

  • Array.Empty<InjectionValue>

  • ToBoolean

  • ResolveCompactMaxZ

  • bridge.GetFindVertical

  • bridge.GetContent

  • bridge.GetWorldItems

  • bridge.GetIgnoreList

  • state.IgnoreTypeLists.FilterFor

  • bridge.GetZ

  • `source

              .Where(id => (!ignored.Contains(id) && !MatchesIgnoredType(id, ignoredTypes)))
    
              .Where(id => type < 0 || type == 0xFFFF || bridge.GetGraphics(id) == type)
    
              .Where(id => color < 0 || color == 0xFFFF || bridge.GetColor(id) == color)
    
              .Where(id =>
    
              {
    
                  int distanceObject = container > 0 ? container : id;
    
                  return distance < 0 || bridge.GetDistance(distanceObject) <= distance;
    
              })
    
              .Where`
    
  • `source

              .Where(id => (!ignored.Contains(id) && !MatchesIgnoredType(id, ignoredTypes)))
    
              .Where(id => type < 0 || type == 0xFFFF || bridge.GetGraphics(id) == type)
    
              .Where(id => color < 0 || color == 0xFFFF || bridge.GetColor(id) == color)
    
              .Where`
    
  • `source

              .Where(id => (!ignored.Contains(id) && !MatchesIgnoredType(id, ignoredTypes)))
    
              .Where(id => type < 0 || type == 0xFFFF || bridge.GetGraphics(id) == type)
    
              .Where`
    
  • `source

              .Where(id => (!ignored.Contains(id) && !MatchesIgnoredType(id, ignoredTypes)))
    
              .Where`
    
  • `source

              .Where`
    
  • ignored.Contains

  • MatchesIgnoredType

  • bridge.GetGraphics

  • bridge.GetColor

  • bridge.GetDistance

  • Math.Abs

  • filtered.OrderBy(id => bridge.GetDistance(container > 0 ? container : id)).ThenBy

  • filtered.OrderBy

  • filtered.Select(id => new InjectionValue(id)).ToArray

  • filtered.Select

Internal implementation code; this is not a standalone script.

private InjectionValue CompactGetWorldItems(InjectionValue[] values)

        {

            int type = values.Length > 0 ? ResolveType(values[0]) : -1;

            int color = values.Length > 1 ? NumberConversions.ToInt(values[1]) : -1;

            int distance = values.Length > 2 ? ResolveCompactDistance(values[2]) : bridge.GetFindDistance();

            int container = 0;

            if (values.Length > 3 && !TryResolveWorldItemQueryContainer(values[3], out container))

                return new InjectionValue(Array.Empty<InjectionValue>());

            bool nearest = values.Length > 4 && ToBoolean(values[4]);

            int maxZ = values.Length > 5 ? ResolveCompactMaxZ(values[5]) : bridge.GetFindVertical();



            IEnumerable<int> source = container > 0 ? bridge.GetContent(container) : bridge.GetWorldItems();

            HashSet<int> ignored = new HashSet<int>(bridge.GetIgnoreList());

            IgnoreTypeFilter ignoredTypes = state.IgnoreTypeLists.FilterFor(state.SelectedIgnoreList);

            int selfZ = bridge.GetZ(bridge.Self);



            IEnumerable<int> filtered = source

                .Where(id => (!ignored.Contains(id) && !MatchesIgnoredType(id, ignoredTypes)))

                .Where(id => type < 0 || type == 0xFFFF || bridge.GetGraphics(id) == type)

                .Where(id => color < 0 || color == 0xFFFF || bridge.GetColor(id) == color)

                .Where(id =>

                {

                    int distanceObject = container > 0 ? container : id;

                    return distance < 0 || bridge.GetDistance(distanceObject) <= distance;

                })

                .Where(id =>

                {

                    int zObject = container > 0 ? container : id;

                    return maxZ < 0 || Math.Abs(bridge.GetZ(zObject) - selfZ) <= maxZ;

                });



            if (nearest)

                filtered = filtered.OrderBy(id => bridge.GetDistance(container > 0 ? container : id)).ThenBy(id => id);



            return new InjectionValue(filtered.Select(id => new InjectionValue(id)).ToArray());

        }

InjectionScript.Runtime.InjectionApiUO.ConvertSpellName

Performs the displayed calls and state updates.

Parameters: string spellName

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6632.

private int? ConvertSpellName(string spellName)

Result: int?.

Conditions:

  • classicUoSpellId > 0
  • spellNameToSpellId.TryGetValue(requested, out var spellId)
  • NumberConversions.TryStr2Int(requested, out spellId) && spellId > 0

Calls:

  • (spellName ?? string.Empty).Trim().Replace
  • (spellName ?? string.Empty).Trim
  • bridge.ResolveSpell
  • spellNameToSpellId.TryGetValue
  • NumberConversions.TryStr2Int

Internal implementation code; this is not a standalone script.

private int? ConvertSpellName(string spellName)

        {

            string requested = (spellName ?? string.Empty).Trim().Replace('_', ' ');

            int classicUoSpellId = bridge.ResolveSpell(requested);

            if (classicUoSpellId > 0)

                return classicUoSpellId;



            if (spellNameToSpellId.TryGetValue(requested, out var spellId))

                return spellId;



            if (NumberConversions.TryStr2Int(requested, out spellId) && spellId > 0)

                return spellId;



            return null;

        }

InjectionScript.Runtime.InjectionApiUO.Count

Performs the displayed calls and state updates.

Parameters: int type, int color, int container

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5332.

public int Count(int type, int color, int container)

Result: int.

Calls:

  • bridge.Count

Internal implementation code; this is not a standalone script.

public int Count(int type, int color, int container)

            => bridge.Count(type, color, container);

InjectionScript.Runtime.InjectionApiUO.Date

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6045.

public int Date()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int Date()

        {

            var now = timeSource.Now;

            return (now.Year % 100) * 10000 + now.Month * 100 + now.Day;

        }

InjectionScript.Runtime.InjectionApiUO.DecodeEasyUoId

Performs the displayed calls and state updates.

Parameters: string easyValue

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2526.

private static int DecodeEasyUoId(string easyValue)

Result: int.

Conditions:

  • character < 'A' || character > 'Z'

Calls:

  • (easyValue ?? string.Empty).ToUpperInvariant

Internal implementation code; this is not a standalone script.

private static int DecodeEasyUoId(string easyValue)

        {

            uint value = 0;

            foreach (char character in (easyValue ?? string.Empty).ToUpperInvariant())

            {

                if (character < 'A' || character > 'Z')

                    continue;

                value = unchecked(value * 26 + (uint)(character - 'A'));

            }

            return unchecked((int)value);

        }

InjectionScript.Runtime.InjectionApiUO.DeleteJournal

Performs the displayed calls and state updates.

Parameters: InjectionValue text

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5518.

public void DeleteJournal(InjectionValue text)

Result: void.

Calls:

  • DeleteJournal

Internal implementation code; this is not a standalone script.

public void DeleteJournal(InjectionValue text) => DeleteJournal((string)text);

InjectionScript.Runtime.InjectionApiUO.EUO2Inj

Performs the displayed calls and state updates.

Parameters: InjectionValue easyValue

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3513.

public string EUO2Inj(InjectionValue easyValue)

Result: string.

Conditions:

  • c < 'A' || c > 'Z'

Calls:

  • easyValue.ToString().ToUpperInvariant
  • easyValue.ToString
  • NumberConversions.ToHex

Internal implementation code; this is not a standalone script.

public string EUO2Inj(InjectionValue easyValue)

        {

            uint value = 0;

            foreach (char c in easyValue.ToString().ToUpperInvariant())

            {

                if (c < 'A' || c > 'Z')

                    continue;

                value = unchecked(value * 26 + (uint)(c - 'A'));

            }

            return NumberConversions.ToHex(unchecked((int)value));

        }

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1777.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "addgumpignorebyserial": state.IgnoredGumpSerials.Add(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1814.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "clearinfowindow": bridge.TextClear(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1816.

Result: InjectionValue.True.

Calls:

Internal implementation code; this is not a standalone script.

case "clienthide": bridge.ClientHide(Arg(0)); return InjectionValue.True;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1241.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "clientprintex":

                    bridge.CharPrintEx(Arg(0), Arg(1), Arg(2), Text(3)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1315.

Result: new InjectionValue(bridge.GetAutoReconnect()).

Calls:

Internal implementation code; this is not a standalone script.

case "getarstatus": return new InjectionValue(bridge.GetAutoReconnect());

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1370.

Result: new InjectionValue(arguments.Length > 0 ? bridge.GetIntelligence(Arg(0)) : bridge.Intelligence).

Calls:

Internal implementation code; this is not a standalone script.

case "getint": return new InjectionValue(arguments.Length > 0 ? bridge.GetIntelligence(Arg(0)) : bridge.Intelligence);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1564.

Result: new InjectionValue(bridge.GetZ(Arg(0, bridge.Self))).

Calls:

Internal implementation code; this is not a standalone script.

case "getz": return new InjectionValue(bridge.GetZ(Arg(0, bridge.Self)));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1539.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "ignoreoff": bridge.Unignore(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1248.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "ignore": bridge.Ignore(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1367.

Result: new InjectionValue(bridge.Exists(Arg(0))).

Calls:

Internal implementation code; this is not a standalone script.

case "isobjectexists": return new InjectionValue(bridge.Exists(Arg(0)));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1640.

Result: new InjectionValue(Waiting()).

Calls:

Internal implementation code; this is not a standalone script.

case "iswaittargetactive": return new InjectionValue(Waiting());

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2035.

Result: new InjectionValue(bridge.JournalMatchCount()).

Calls:

Internal implementation code; this is not a standalone script.

case "linecount": return new InjectionValue(bridge.JournalMatchCount());

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1957.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "moveboat": bridge.MoveBoat(Arg(0), Arg(1)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1906.

Result: SetIndexedGumpValue(Arg(0), "checkbox", Arg(1), Text(2)).

Calls:

Internal implementation code; this is not a standalone script.

case "numgumpcheckbox": return SetIndexedGumpValue(Arg(0), "checkbox", Arg(1), Text(2));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1537.

Result: new InjectionValue(bridge.ObjAtLayerEx(Arg(0), Arg(1))).

Calls:

Internal implementation code; this is not a standalone script.

case "objatlayerex": return new InjectionValue(bridge.ObjAtLayerEx(Arg(0), Arg(1)));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1708.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "partyacceptinvite": bridge.PartyAcceptInvite(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1709.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "partydeclineinvite": bridge.PartyDeclineInvite(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1707.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "partyleave": bridge.PartyLeave(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1536.

Result: new InjectionValue(ReadPredictedCoordinate(3)).

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1597.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "setcontextmenuhook": bridge.SetContextMenuHook(Arg(0), Arg(1)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2863.

Calls:

Internal implementation code; this is not a standalone script.

case "deletefindlist":

                    LegacyList("AddFindList").RemoveAll(value => LegacyListEntryMatches(value,

                        arguments));

                    break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2962.

Calls:

Internal implementation code; this is not a standalone script.

case "gumpobject": bridge.SelectGump(Arg(0)); break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3025.

Calls:

Internal implementation code; this is not a standalone script.

case "removering": Unequip("Ring"); break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2871.

Calls:

Internal implementation code; this is not a standalone script.

case "selectignorelist": state.SelectedIgnoreList = Text(0).Trim(); break;

InjectionScript.Runtime.InjectionApiUO.FindType

Performs the displayed calls and state updates.

Parameters: InjectionValue type, InjectionValue color

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4706.

public string FindType(InjectionValue type, InjectionValue color)

Result: string.

Conditions:

  • `color.Kind == InjectionValueKind.String

              && (color.String.Equals("ground", StringComparison.OrdinalIgnoreCase)
    
                  || color.String.Equals("backpack", StringComparison.OrdinalIgnoreCase)
    
                  || color.String.Equals("my", StringComparison.OrdinalIgnoreCase))`
    

Calls:

  • color.String.Equals
  • FindType
  • ResolveType
  • ConvertContainer
  • NumberConversions.ToInt

Internal implementation code; this is not a standalone script.

public string FindType(InjectionValue type, InjectionValue color)

        {

            if (color.Kind == InjectionValueKind.String

                && (color.String.Equals("ground", StringComparison.OrdinalIgnoreCase)

                    || color.String.Equals("backpack", StringComparison.OrdinalIgnoreCase)

                    || color.String.Equals("my", StringComparison.OrdinalIgnoreCase)))

            {

                return FindType(ResolveType(type), -1, ConvertContainer(color), -1, color.String.Equals("my", StringComparison.OrdinalIgnoreCase));

            }



            return FindType(ResolveType(type), NumberConversions.ToInt(color), -1, -1, false);

        }

InjectionScript.Runtime.InjectionApiUO.GetFoundedTextID

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5605.

public int GetFoundedTextID()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int GetFoundedTextID() => foundedTextId >= 0 ? foundedTextId : 0;

InjectionScript.Runtime.InjectionApiUO.GetFoundedTextIndex

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5606.

public int GetFoundedTextIndex()

Result: int.

Calls:

  • reader.FindJournalEntryIndex

Internal implementation code; this is not a standalone script.

public int GetFoundedTextIndex() => selectedJournalEntry != null && bridge is IApiJournalReader reader

            ? reader.FindJournalEntryIndex(selectedJournalEntry.Identity) : foundedTextIndex;

InjectionScript.Runtime.InjectionApiUO.GetFoundedTextSerial

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5608.

public string GetFoundedTextSerial()

Result: string.

Calls:

—

Internal implementation code; this is not a standalone script.

public string GetFoundedTextSerial() => selectedJournalEntry != null

            ? $"0x{unchecked((uint)selectedJournalEntry.Serial):X8}" : "0x00000000";

InjectionScript.Runtime.InjectionApiUO.GetGraphics

Performs the displayed calls and state updates.

Parameters: string id

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3733.

public string GetGraphics(string id)

Result: string.

Calls:

  • GetGraphics
  • GetObject

Internal implementation code; this is not a standalone script.

public string GetGraphics(string id) => GetGraphics(GetObject(id));

InjectionScript.Runtime.InjectionApiUO.GetGump

Performs the displayed calls and state updates.

Parameters: string identifier, int key

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3364.

public InjectionValue GetGump(string identifier, int key)

Result: InjectionValue.

Calls:

  • LastGump

Internal implementation code; this is not a standalone script.

public InjectionValue GetGump(string identifier, int key) => LastGump(identifier, key);

InjectionScript.Runtime.InjectionApiUO.GetLayer

Performs the displayed calls and state updates.

Parameters: InjectionValue id

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3739.

public string GetLayer(InjectionValue id)

Result: string.

Calls:

  • ConvertLayer
  • bridge.GetLayer
  • GetObject

Internal implementation code; this is not a standalone script.

public string GetLayer(InjectionValue id) => ConvertLayer(bridge.GetLayer(GetObject(id)));

InjectionScript.Runtime.InjectionApiUO.GetRun

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3893.

public int GetRun()

Result: int.

Calls:

  • bridge.GetRun

Internal implementation code; this is not a standalone script.

public int GetRun() => bridge.GetRun(bridge.Self);

InjectionScript.Runtime.InjectionApiUO.GetZ

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3685.

public int GetZ()

Result: int.

Calls:

  • GetZ

Internal implementation code; this is not a standalone script.

public int GetZ() => GetZ("self");

InjectionScript.Runtime.InjectionApiUO.GetZ

Performs the displayed calls and state updates.

Parameters: int id

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3687.

public int GetZ(int id)

Result: int.

Calls:

  • bridge.GetZ

Internal implementation code; this is not a standalone script.

public int GetZ(int id) => bridge.GetZ(id);

InjectionScript.Runtime.InjectionApiUO.Grab

Performs the displayed calls and state updates.

Parameters: InjectionValue id

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4488.

public int Grab(InjectionValue id)

Result: int.

Calls:

  • CompactGrab

Internal implementation code; this is not a standalone script.

public int Grab(InjectionValue id) => CompactGrab(new[] { id });

InjectionScript.Runtime.InjectionApiUO.Grab

Performs the displayed calls and state updates.

Parameters: InjectionValue amount, InjectionValue id, InjectionValue container

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4492.

public int Grab(InjectionValue amount, InjectionValue id, InjectionValue container)

Result: int.

Calls:

  • CompactGrab

Internal implementation code; this is not a standalone script.

public int Grab(InjectionValue amount, InjectionValue id, InjectionValue container)

            => CompactGrab(new[] { amount, id, container });

InjectionScript.Runtime.InjectionApiUO.GumpExists

Performs the displayed calls and state updates.

Parameters: InjectionValue firstId, InjectionValue secondId

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3359.

public int GumpExists(InjectionValue firstId, InjectionValue secondId)

Result: int.

Calls:

  • bridge.GumpExists
  • NumberConversions.ToInt

Internal implementation code; this is not a standalone script.

public int GumpExists(InjectionValue firstId, InjectionValue secondId)

            => bridge.GumpExists(NumberConversions.ToInt(firstId), NumberConversions.ToInt(secondId));

InjectionScript.Runtime.InjectionApiUO.Inj2EUO

Performs the displayed calls and state updates.

Parameters: InjectionValue serialValue

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3499.

public string Inj2EUO(InjectionValue serialValue)

Result: string.

Conditions:

  • value == 0

Calls:

  • NumberConversions.ToInt
  • result.Insert
  • result.ToString

Internal implementation code; this is not a standalone script.

public string Inj2EUO(InjectionValue serialValue)

        {

            uint value = unchecked((uint)NumberConversions.ToInt(serialValue));

            if (value == 0)

                return "A";

            var result = new StringBuilder();

            while (value > 0)

            {

                result.Insert(0, (char)('A' + value % 26));

                value /= 26;

            }

            return result.ToString();

        }

InjectionScript.Runtime.InjectionApiUO.LastGump

Performs the displayed calls and state updates.

Parameters: string identifier, int key

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3362.

public InjectionValue LastGump(string identifier, int key)

Result: InjectionValue.

Calls:

  • ConvertGumpValue
  • bridge.GetGumpValue

Internal implementation code; this is not a standalone script.

public InjectionValue LastGump(string identifier, int key) => ConvertGumpValue(identifier, bridge.GetGumpValue(-1, identifier, key));

InjectionScript.Runtime.InjectionApiUO.MaxWeight

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4020.

public int MaxWeight()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int MaxWeight() => bridge.MaxWeight;

InjectionScript.Runtime.InjectionApiUO.MoveToCanonical

Checks the conditions below and returns the displayed result.

Parameters: x, y, z, accuracy, running, accuracyZ, optimized, stepCallback, timeoutMs, maxSteps, maxDistance, avoidMobiles, openDoorsOverride, stopOnStuck

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2099.

`private int MoveToCanonical(int x, int y, int z, int accuracy, bool running, int accuracyZ = 255,

        bool optimized = true, string stepCallback = null, int timeoutMs = 0, int maxSteps = 0,

        int maxDistance = 0, bool? avoidMobiles = null, bool? openDoorsOverride = null, bool stopOnStuck = false)`

Result: int.

Result: 0; 1.

Calls: PortablePathSearch.ValidPoint, bridge.IsOnline, Math.Max, Math.Min, bridge.GetX, bridge.GetY, bridge.GetZ, Math.Abs.

Conditions: !PortablePathSearch.ValidPoint(x, y, z); state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0; state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina; !PortablePathSearch.ValidPoint(currentX, currentY, currentZ).

Calls:

Internal implementation code; this is not a standalone script.

private int MoveToCanonical(int x, int y, int z, int accuracy, bool running, int accuracyZ = 255,
            bool optimized = true, string stepCallback = null, int timeoutMs = 0, int maxSteps = 0,
            int maxDistance = 0, bool? avoidMobiles = null, bool? openDoorsOverride = null, bool stopOnStuck = false)
        {
            if (!PortablePathSearch.ValidPoint(x, y, z)) return 0;
            if (state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0)
                return 0;
            if (state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina)
                return 0;

// …
            if (!PortablePathSearch.ValidPoint(currentX, currentY, currentZ)) return 0;
// …
            if (maxDistance > 0 && requestedDistance > maxDistance)
                return 0;
            if (requestedDistance <= safeAccuracy && Math.Abs(z - currentZ) <= safeAccuracyZ)
                return 1;
// …
            if (started == 0)
                return 0;
// …
                if (ownership == null) bridge.StopMoving();
// …
                if (!IsCurrentRequest()) return 0;
                if (state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0)
// …
                    return 0;
// …
                if (state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina)
// …
                    return 0;
// …
                if (timeoutMs > 0 && (timeSource.Now - startedAt).TotalMilliseconds >= timeoutMs)
// …
                    return 0;
// …
                if (moved)
// …
                    if (!string.IsNullOrWhiteSpace(stepCallback)
// …
                        return 0;
// …
                    if (maxSteps > 0 && observedSteps >= maxSteps
// …
                        return 0;
// …
                else if (stopOnStuck && bridge is IApiPathPlanningState planning && planning.IsPathPlanning())
// …
                else if (stopOnStuck && (timeSource.Now - lastProgressAt).TotalMilliseconds >= 1000d)
// …
                    return 0;
// …
            if (!IsCurrentRequest()) return 0;
// …
            if ((currentX != lastX || currentY != lastY || currentZ != lastZ)
// …

The source file contains the complete code; exact excerpts follow.

InjectionScript.Runtime.InjectionApiUO.Picking

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3417.

public int Picking()

Result: int.

Calls:

  • bridge.Picking

Internal implementation code; this is not a standalone script.

public int Picking() => bridge.Picking();

InjectionScript.Runtime.InjectionApiUO.Random

Performs the displayed calls and state updates.

Parameters: int min, int max

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6063.

public int Random(int min, int max)

Result: int.

Conditions:

  • min > max
  • min == max
  • count <= int.MaxValue

Calls:

  • random.Next
  • random.NextBytes
  • BitConverter.ToUInt32

Internal implementation code; this is not a standalone script.

public int Random(int min, int max)

        {

            if (min > max)

                throw new NativeSubrutineException("UO.Random(min, max): min must not exceed max.");

            if (min == max) return min;

            long count = (long)max - min + 1;

            lock (randomSync)

            {

                if (count <= int.MaxValue)

                    return (int)(min + (long)random.Next((int)count));



                // Inclusive Int32.MaxValue and the full signed range must not

                // overflow. Rejection avoids modulo bias; reuse the four bytes.

                const ulong domain = 1UL << 32;

                ulong limit = domain - domain % (ulong)count;

                uint sample;

                do

                {

                    random.NextBytes(randomRangeBytes);

                    sample = BitConverter.ToUInt32(randomRangeBytes, 0);

                } while (sample >= limit);

                return (int)(min + (long)(sample % (ulong)count));

            }

        }

InjectionScript.Runtime.InjectionApiUO.ResolveCompactMaxZ

Performs the displayed calls and state updates.

Parameters: InjectionValue value

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5217.

private int ResolveCompactMaxZ(InjectionValue value)

Result: int.

Calls:

  • NumberConversions.ToInt
  • bridge.GetFindVertical
  • Math.Max

Internal implementation code; this is not a standalone script.

private int ResolveCompactMaxZ(InjectionValue value)

        {

            int parsed = NumberConversions.ToInt(value);

            return parsed < 0 ? bridge.GetFindVertical() : Math.Max(0, parsed);

        }

InjectionScript.Runtime.InjectionApiUO.Say

Performs the displayed calls and state updates.

Parameters: string message

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5406.

public void Say(string message)

Result: void.

Calls:

  • bridge.Say

Internal implementation code; this is not a standalone script.

public void Say(string message) => bridge.Say(message);

InjectionScript.Runtime.InjectionApiUO.Snap

Performs the displayed calls and state updates.

Parameters: string name, int quality

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6040.

public int Snap(string name, int quality)

Result: int.

Calls:

  • bridge.Snap
  • Math.Max
  • Math.Min

Internal implementation code; this is not a standalone script.

public int Snap(string name, int quality) => bridge.Snap(name, Math.Max(1, Math.Min(100, quality)), true);

InjectionScript.Runtime.InjectionApiUO.Snap

Performs the displayed calls and state updates.

Parameters: string name, int quality, bool includeUi

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6041.

public int Snap(string name, int quality, bool includeUi)

Result: int.

Calls:

  • bridge.Snap
  • Math.Max
  • Math.Min

Internal implementation code; this is not a standalone script.

public int Snap(string name, int quality, bool includeUi)

            => bridge.Snap(name, Math.Max(1, Math.Min(100, quality)), includeUi);

InjectionScript.Runtime.InjectionApiUO.TryDeserializeRecordedLegacyAction

Performs the displayed calls and state updates.

Parameters: string recording, out string name, out InjectionValue[] arguments

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2767.

private static bool TryDeserializeRecordedLegacyAction(string recording, out string name, out InjectionValue[] arguments)

Result: bool.

Conditions:

  • string.IsNullOrWhiteSpace(recording)
  • fields.Length < 2 || !fields[0].Equals(RecordedLegacyActionPrefix, StringComparison.Ordinal)
  • !TryDeserializeRecordedValue(fields[index], out values[index - 2])

Calls:

  • Array.Empty<InjectionValue>
  • string.IsNullOrWhiteSpace
  • recording.Split
  • fields[0].Equals
  • DecodeRecordingText
  • Math.Max
  • TryDeserializeRecordedValue

Internal implementation code; this is not a standalone script.

private static bool TryDeserializeRecordedLegacyAction(string recording, out string name, out InjectionValue[] arguments)

        {

            name = string.Empty;

            arguments = Array.Empty<InjectionValue>();

            if (string.IsNullOrWhiteSpace(recording)) return false;



            string[] fields = recording.Split(new[] { '\t' }, StringSplitOptions.None);

            if (fields.Length < 2 || !fields[0].Equals(RecordedLegacyActionPrefix, StringComparison.Ordinal)) return false;

            try

            {

                name = DecodeRecordingText(fields[1]);

                var values = new InjectionValue[Math.Max(0, fields.Length - 2)];

                for (int index = 2; index < fields.Length; index++)

                    if (!TryDeserializeRecordedValue(fields[index], out values[index - 2])) return false;

                arguments = values;

                return !string.IsNullOrWhiteSpace(name);

            }

            catch (FormatException)

            {

                name = string.Empty;

                arguments = Array.Empty<InjectionValue>();

                return false;

            }

        }

InjectionScript.Runtime.InjectionApiUO.UseFromGround

Performs the displayed calls and state updates.

Parameters: InjectionValue type

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4199.

public int UseFromGround(InjectionValue type)

Result: int.

Calls:

  • UseFromGround

Internal implementation code; this is not a standalone script.

public int UseFromGround(InjectionValue type) => UseFromGround(type, new InjectionValue(-1));

InjectionScript.Runtime.InjectionApiUO.WaitTargetObject

Performs the displayed calls and state updates.

Parameters: int id1, int id2

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4294.

public void WaitTargetObject(int id1, int id2)

Result: void.

Calls:

  • bridge.WaitTargetObject
  • Timer

Internal implementation code; this is not a standalone script.

public void WaitTargetObject(int id1, int id2)

        {

            bridge.WaitTargetObject(id1, id2);

            ticksTarget = Timer();

        }

InjectionScript.Runtime.InjectionApiUO.WaitingForJournalText

Performs the displayed calls and state updates.

Parameters: int startTime, int maxDelay, string text, int equals

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5537.

public void WaitingForJournalText(int startTime, int maxDelay, string text, int equals)

Result: void.

Calls:

  • WaitingForJournalText

Internal implementation code; this is not a standalone script.

public void WaitingForJournalText(int startTime, int maxDelay, string text, int equals)

            => WaitingForJournalText(startTime, maxDelay, text, equals, 0, InjectionValue.Zero);

InjectionScript.Runtime.InjectionApiUO.Register [FindType]

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

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:404.

values

Result: values.

Result: CompactFindType(values[0], values[1], values[2], values[3], values[4], values[5]).

Calls: CompactFindType.

Calls:

Internal implementation code; this is not a standalone script.

values =>

                CompactFindType(values[0], values[1], values[2], values[3], values[4], values[5])

InjectionScript.Runtime.InjectionApiUO.Register [Follow]

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

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:856.

values

Result: values.

Calls: follow.Follow, GetObject, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

values => new InjectionValue(bridge is IApiFollowBridge follow

                        ? follow.Follow(count == 0 ? 0 : GetObject(values[0]),

                            count < 2 ? 1 : NumberConversions.ToInt(values[1]),

                            count < 3 || NumberConversions.ToInt(values[2]) != 0) : 0)

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetFlying]

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

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1067.

serial

Result: serial.

Result: bridge.Flying(serial).

Calls: bridge.Flying.

Calls:

Internal implementation code; this is not a standalone script.

serial => bridge.Flying(serial)

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetMaxWeight]

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

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1034.

Result: bridge.MaxWeight.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.MaxWeight

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetStr]

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

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1030.

Result: bridge.Strength.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Strength

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

Returns the value of the expression below.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1007.

Result: getter(bridge.Self).

Calls:

Internal implementation code; this is not a standalone script.

() => getter(bridge.Self)

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

Returns the value of the expression below.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1007.

Result: getter(bridge.Self).

Calls:

Internal implementation code; this is not a standalone script.

() => getter(bridge.Self)

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

Returns the value of the expression below.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1007.

Result: getter(bridge.Self).

Calls:

Internal implementation code; this is not a standalone script.

() => getter(bridge.Self)

InjectionScript.Runtime.NativeSubrutineMetadata.TryGet

Performs the displayed calls and state updates.

Parameters: string name, IEnumerable<InjectionValue> argumentValues, out NativeSubrutineDefinition subrutineDefinition

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/NativeSubrutineMetadata.cs:34.

public bool TryGet(string name, IEnumerable<InjectionValue> argumentValues, out NativeSubrutineDefinition subrutineDefinition)

Result: bool.

Conditions:

  • !byName.TryGetValue(name, out var arities)
  • !arities.TryGetValue(arguments.Count, out var overloads)
  • kind == InjectionValueKind.Any
  • kind == arguments[i].Kind

Calls:

  • byName.TryGetValue
  • argumentValues.ToArray
  • arities.TryGetValue
  • StringComparer.OrdinalIgnoreCase.Compare
  • candidate.GetSignature
  • wildcard.GetSignature

Internal implementation code; this is not a standalone script.

public bool TryGet(string name, IEnumerable<InjectionValue> argumentValues, out NativeSubrutineDefinition subrutineDefinition)
        {
            subrutineDefinition = null;
            // A script procedure is not a native. Avoid scanning the entire API
            // (over 1600 registrations) twice for every ordinary helper call.
            if (!byName.TryGetValue(name, out var arities)) return false;
            var arguments = argumentValues as IReadOnlyList<InjectionValue> ?? argumentValues.ToArray();
            if (!arities.TryGetValue(arguments.Count, out var overloads)) return false;
            NativeSubrutineDefinition allAny = null, wildcard = null;
            int bestWildcardCount = int.MaxValue;
            foreach (var candidate in overloads)
            {
                bool compatible = true, exact = true;
                int anyCount = 0;
                for (int i = 0; i < arguments.Count; i++)
                {
                    var kind = candidate.ParameterKinds[i];
                    if (kind == InjectionValueKind.Any) anyCount++;
                    if (kind == arguments[i].Kind) continue;
                    exact = false;
                    if (kind != InjectionValueKind.Any) { compatible = false; break; }
                }
                if (exact && compatible) { subrutineDefinition = candidate; return true; }
                if (!compatible) continue;
                if (anyCount == arguments.Count) { allAny = candidate; continue; }
                if (anyCount < bestWildcardCount || (anyCount == bestWildcardCount
                    && StringComparer.OrdinalIgnoreCase.Compare(candidate.GetSignature(), wildcard.GetSignature()) < 0))
                { wildcard = candidate; bestWildcardCount = anyCount; }
            }
            // Preserve existing dispatch precedence: exact, all-Any adapter,
            // then the most specific mixed signature with its stable tie-break.
            subrutineDefinition = allAny ?? wildcard;
            return subrutineDefinition != null;
        }

InjectionScript.Runtime.PortablePathSearch.Find

Checks the conditions below and returns the displayed result.

Parameters: startX, startY, startZ, finishX, finishY, finishZ, accuracy, accuracyZ, maxSteps, diagonal, checkStep, checkCancellation, scheduleSlice

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/PortablePathSearch.cs:26.

`internal static (int X, int Y, int Z)[] Find(

        int startX, int startY, int startZ, int finishX, int finishY, int finishZ,

        int accuracy, int accuracyZ, int maxSteps, bool diagonal,

        Func<int, int, int, int, int, int?> checkStep, Action checkCancellation, Action<Action> scheduleSlice)`

Result: (int X, int Y, int Z)[].

Result: empty; result.

Calls: Array.Empty<(int, int, int)>, ValidPoint, Comparer<Node>.Create, Math.Min, Estimate, open.Add, checkCancellation, scheduleSlice.

Conditions: !ValidPoint(startX, startY, startZ) || !ValidPoint(finishX, finishY, finishZ); start.Estimate > limit.

Calls:

Internal implementation code; this is not a standalone script.

internal static (int X, int Y, int Z)[] Find(
            int startX, int startY, int startZ, int finishX, int finishY, int finishZ,
            int accuracy, int accuracyZ, int maxSteps, bool diagonal,
            Func<int, int, int, int, int, int?> checkStep, Action checkCancellation, Action<Action> scheduleSlice)
        {
            var empty = Array.Empty<(int, int, int)>();
            if (!ValidPoint(startX, startY, startZ) || !ValidPoint(finishX, finishY, finishZ))
                return empty;

            int Estimate(int x, int y)
// …
                return diagonal ? Math.Max(dx, dy) : dx + dy;
// …
                if (order == 0) order = a.Estimate.CompareTo(b.Estimate);
                return order == 0 ? a.Order.CompareTo(b.Order) : order;
// …
            if (start.Estimate > limit) return empty;
// …
                    if (sliceNodes > 1 && Stopwatch.GetTimestamp() - sliceStarted >= Stopwatch.Frequency / 1000)
                        return;
// …
                    if (best[current.Point] != current) continue;
// …
                    if (current.Estimate == 0 && Math.Abs(finishZ - p.Z) <= accuracyZ)
// …
                        return;
// …
                    if (expanded++ >= ExpansionLimit) { completed = true; return; }
                    if (current.Steps >= limit) continue;
// …
                        if (x < 0 || x > ushort.MaxValue || y < 0 || y > ushort.MaxValue) continue;
// …
                        if (steps + estimate > limit) continue;
// …
                        if (!z.HasValue || !ValidPoint(x, y, z.Value)) continue;
// …
                        if (best.TryGetValue(key, out Node previous) && previous.Steps <= steps) continue;
// …
                        if (previous != null) open.Remove(previous);
// …
            return result;
// …

The source file contains the complete code; exact excerpts follow.

InjectionScript.Runtime.State.NamedTypes.TryGet

Performs the displayed calls and state updates.

Parameters: string name, out int graphic

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/State/NamedTypes.cs:30.

public bool TryGet(string name, out int graphic)

Result: bool.

Calls:

  • values.TryGetValue
  • (name ?? string.Empty).Trim

Internal implementation code; this is not a standalone script.

public bool TryGet(string name, out int graphic)
        {
            lock (gate) return values.TryGetValue((name ?? string.Empty).Trim(), out graphic);
        }

InjectionScript.Runtime.State.RuntimeDictionary.Set

Performs the displayed calls and state updates.

Parameters: string name, T value

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/State/RuntimeDictionary.cs:16.

public void Set(string name, T value)

Result: void.

Conditions:

  • !items.ContainsKey(name)
  • notify

Calls:

  • items.ContainsKey
  • items.Add
  • .Invoke

Internal implementation code; this is not a standalone script.

public void Set(string name, T value)

        {

            bool notify = true;



            lock (itemsLock)

            {

                if (!items.ContainsKey(name))

                {

                    items.Add(name, value);

                    notify = true;

                }

                else

                    items[name] = value;

            }



            if (notify)

                KeyAdded?.Invoke(name);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CountDirectItems

Performs the displayed calls and state updates.

Parameters: int type, int color, int containerId

Source: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2926.

public int CountDirectItems(int type, int color, int containerId)

Result: int.

Conditions:

  • MatchesFindIdentity(item, type, color, ignoredTypes) && MatchesFindContainer(item, containerId, range, false)
  • IsGroundFindContainer(containerId)
  • MatchesFindMobile(mobile, type, color, range, ignoredTypes)

Calls:

  • Invoke
  • State.IgnoreTypeLists.FilterFor
  • ResolveFindRange
  • MatchesFindIdentity
  • MatchesFindContainer
  • Math.Max
  • IsGroundFindContainer
  • MatchesFindMobile

Internal implementation code; this is not a standalone script.

public int CountDirectItems(int type, int color, int containerId) => Invoke(() =>
        {
            IgnoreTypeFilter ignoredTypes = State.IgnoreTypeLists.FilterFor(State.SelectedIgnoreList);
            int range = ResolveFindRange(State.FindDistance);
            int quantity = 0;
            foreach (Item item in _world.Items.Values)
                if (MatchesFindIdentity(item, type, color, ignoredTypes)
                    && MatchesFindContainer(item, containerId, range, false))
                    quantity = checked(quantity + Math.Max(1, (int)item.Amount));
            if (IsGroundFindContainer(containerId))
                foreach (Mobile mobile in _world.Mobiles.Values)
                    if (MatchesFindMobile(mobile, type, color, range, ignoredTypes))
                        quantity = checked(quantity + 1);
            return quantity;
        });

Clone this wiki locally