Skip to content

EN Runtime Helpers 0

Codex edited this page Oct 12, 2026 · 1 revision

uk · ru · en · de · fr · it · es · zh-tw · ja · ko

Helper functions 0

Internal implementation code; this is not a standalone script.

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Armor

Returns the value of the expression below.

Parameters: No parameters.

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

public int Armor

Result: int.

Result: Invoke(() => CurrentPlayer?.PhysicalResistance ?? 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.BookSetText

Performs the displayed calls and state updates.

Parameters: text

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

public void BookSetText(string text)

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void BookSetText(string text) => Invoke(() =>

        {

            ISessionBook book = GetOpenBook();

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

            if (!book.YokoTrySetText(text))

                Error("UO.BookSetText: read-only book or text exceeds the book page/line limits.");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ConnectClient

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void ConnectClient()

Result: void.

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.SessionControl is { } session) { session.RequestConnect(); return; } if (NetClient.Socket.IsConnected || NetClient.Socket.IsConnecting) return; LoginScene loginScene = Client.Game.GetScene<LoginScene>(); if (loginScene == null) { GameScene gameScene = Client.Game.GetScene<GameScene>(); if (gameScene != null) { // This API normally runs from YokoScripts.Update inside // GameScene.Update. Replacing the scene reentrantly would // clear the world underneath the remainder of that frame. gameScene.RequestReconnectPreservingYoko(); return; } loginScene = new LoginScene(_world); Client.Game.SetScene(loginScene); } string account = !string.IsNullOrEmpty(LoginScene.Account) ? LoginScene.Account : Settings.GlobalSettings.Username; string password = LoginScene.ResolveReconnectPassword(account); // UO.Connect means reconnect the current character, including the // remembered shard/character selection, even when global automatic // reconnect is disabled. loginScene.Reconnect = true; loginScene.Connect( account, password ); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.SessionControl is { } session) { session.RequestConnect(); return; } if (NetClient.Socket.IsConnected || NetClient.Socket.IsConnecting) return; LoginScene loginScene = Client.Game.GetScene<LoginScene>(); if (loginScene == null) { GameScene gameScene = Client.Game.GetScene<GameScene>(); if (gameScene != null) { // This API normally runs from YokoScripts.Update inside // GameScene.Update. Replacing the scene reentrantly would // clear the world underneath the remainder of that frame. gameScene.RequestReconnectPreservingYoko(); return; } loginScene = new LoginScene(_world); Client.Game.SetScene(loginScene); } string account = !string.IsNullOrEmpty(LoginScene.Account) ? LoginScene.Account : Settings.GlobalSettings.Username; string password = LoginScene.ResolveReconnectPassword(account); // UO.Connect means reconnect the current character, including the // remembered shard/character selection, even when global automatic // reconnect is disabled. loginScene.Reconnect = true; loginScene.Connect( account, password ); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Scenes.LoginScene.ResolveReconnectPassword: LoginScene.ResolveReconnectPassword(account).

Internal implementation code; this is not a standalone script.

public void ConnectClient() => Invoke(() =>

        {

            if (_world.SessionControl is { } session)

            {

                session.RequestConnect();

                return;

            }

            if (NetClient.Socket.IsConnected || NetClient.Socket.IsConnecting)

                return;



            LoginScene loginScene = Client.Game.GetScene<LoginScene>();



            if (loginScene == null)

            {

                GameScene gameScene = Client.Game.GetScene<GameScene>();

                if (gameScene != null)

                {

                    // This API normally runs from YokoScripts.Update inside

                    // GameScene.Update. Replacing the scene reentrantly would

                    // clear the world underneath the remainder of that frame.

                    gameScene.RequestReconnectPreservingYoko();

                    return;

                }



                loginScene = new LoginScene(_world);

                Client.Game.SetScene(loginScene);

            }



            string account = !string.IsNullOrEmpty(LoginScene.Account)

                ? LoginScene.Account

                : Settings.GlobalSettings.Username;

            string password = LoginScene.ResolveReconnectPassword(account);



            // UO.Connect means reconnect the current character, including the

            // remembered shard/character selection, even when global automatic

            // reconnect is disabled.

            loginScene.Reconnect = true;

            loginScene.Connect(

                account,

                password

            );

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CurrentProfilePath

Returns the value of the expression below.

Parameters: No parameters.

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

public string CurrentProfilePath

Result: string.

Result: ProfileManager.ProfilePath ?? string.Empty.

Internal implementation code; this is not a standalone script.

public string CurrentProfilePath => ProfileManager.ProfilePath ?? string.Empty;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.DeleteJournal

Performs the displayed calls and state updates.

Parameters: text

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

public void DeleteJournal(string text)

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void DeleteJournal(string text) => Invoke(() =>

        {

            string[] patterns = SplitPatterns(text);

            for (int i = JournalManager.Entries.Count - 1; i >= 0; --i)

            {

                if (Matches(JournalManager.Entries[i].Text, patterns))

                {

                    JournalManager.Entries.RemoveAt(i);

                }

            }

            _journalLine = Math.Min(_journalLine, JournalManager.Entries.Count);

            _journalMatchCount = 0;

            _lastJournalMatch = null;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.FindType

Returns the value of the expression below.

Parameters: type, color, containerId, range, recursive

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

public int FindType(int type, int color, int containerId, int range, bool recursive)

Result: int.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int FindType(int type, int color, int containerId, int range, bool recursive)

        {

            return Invoke(() =>

            {

                ResetFindResults();

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

                int effectiveRange = ResolveFindRange(range);



                foreach (Item item in _world.Items.Values)

                {

                    if (!MatchesFindIdentity(item, type, color, ignoredTypes)

                        || !MatchesFindContainer(item, containerId, effectiveRange, recursive))

                    {

                        continue;

                    }



                    RegisterFound(item);

                }



                // Mobiles (players, NPCs and monsters) live in World.Mobiles rather

                // than World.Items. The UO API treats a mobile as a ground/world object,

                // so include it whenever FindType searches the ground.

                if (IsGroundFindContainer(containerId))

                {

                    foreach (Mobile mobile in _world.Mobiles.Values)

                    {

                        if (!MatchesFindMobile(mobile, type, color, effectiveRange, ignoredTypes))

                        {

                            continue;

                        }



                        RegisterFound(mobile);

                    }

                }



                return _findItem;

            });

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GameServerAddress

Returns the value of the expression below.

Parameters: No parameters.

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

public string GameServerAddress

Result: string.

Result: Settings.GlobalSettings.IP ?? string.Empty.

Internal implementation code; this is not a standalone script.

public string GameServerAddress => Settings.GlobalSettings.IP ?? string.Empty;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetJournalEntry

Returns the value of the expression below.

Parameters: index

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

private JournalEntry GetJournalEntry(int index)

Result: JournalEntry.

Result: Invoke(() => GetJournalEntryUnsafe(index)).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

private JournalEntry GetJournalEntry(int index) => Invoke(() => GetJournalEntryUnsafe(index));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetJournalEntryUnsafe

Returns the value of the expression below.

Parameters: index

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

private static JournalEntry GetJournalEntryUnsafe(int index)

Result: JournalEntry.

Result: actualIndex >= 0 && actualIndex < JournalManager.Entries.Count ? JournalManager.Entries[actualIndex] : null.

Internal implementation code; this is not a standalone script.

private static JournalEntry GetJournalEntryUnsafe(int index)

        {

            int actualIndex = JournalManager.Entries.Count - 1 - index;

            return actualIndex >= 0 && actualIndex < JournalManager.Entries.Count ? JournalManager.Entries[actualIndex] : null;

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetMenuItems

Returns the value of the expression below.

Parameters: caption, extended

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

public string[] GetMenuItems(string caption, bool extended)

Result: string[].

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { SessionMenu menu = _world.ServerMenus.Snapshot().LastOrDefault(value => !value.IsDisposed && value.YokoCaption.IndexOf(caption ?? string.Empty, StringComparison.OrdinalIgnoreCase) >= 0); return menu == null ? Array.Empty<string>() : extended ? menu.GetYokoItemsEx() : menu.GetYokoItems(); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { SessionMenu menu = _world.ServerMenus.Snapshot().LastOrDefault(value => !value.IsDisposed && value.YokoCaption.IndexOf(caption ?? string.Empty, StringComparison.OrdinalIgnoreCase) >= 0); return menu == null ? Array.Empty<string>() : extended ? menu.GetYokoItemsEx() : menu.GetYokoItems(); }). Overload candidates: the source does not establish which candidate is selected.

Internal implementation code; this is not a standalone script.

public string[] GetMenuItems(string caption, bool extended) => Invoke(() =>

        {

            SessionMenu menu = _world.ServerMenus.Snapshot().LastOrDefault(value => !value.IsDisposed

                && value.YokoCaption.IndexOf(caption ?? string.Empty, StringComparison.OrdinalIgnoreCase) >= 0);

            return menu == null ? Array.Empty<string>() : extended ? menu.GetYokoItemsEx() : menu.GetYokoItems();

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetOpenBook

Returns the value of the expression below.

Parameters: No parameters.

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

private ISessionBook GetOpenBook()

Result: ISessionBook.

Result: _world.Books.Last.

Internal implementation code; this is not a standalone script.

private ISessionBook GetOpenBook() => _world.Books.Last;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetQuantity

Returns the value of the expression below.

Parameters: id

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

public int GetQuantity(int id)

Result: int.

Result: Invoke(() => _world.Items.Get((uint)id) is Item item && !item.IsDestroyed ? item.Amount : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetQuantity(int id) => Invoke(() => _world.Items.Get((uint)id) is Item item && !item.IsDestroyed ? item.Amount : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetStrength

Returns the value of the expression below.

Parameters: id

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

public int GetStrength(int id)

Result: int.

Result: Invoke(() => _world.Player is { IsDestroyed: false } player && player.Serial == unchecked((uint)id) ? player.Strength : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetStrength(int id) => Invoke(() => _world.Player is { IsDestroyed: false } player && player.Serial == unchecked((uint)id) ? player.Strength : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetTradeOpponent

Returns the value of the expression below.

Parameters: tradeNumber

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

public int GetTradeOpponent(int tradeNumber)

Result: int.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetTradeOpponent(int tradeNumber) => Invoke(() =>

        {

            ISessionTrade gump = FindNumberedTrade(tradeNumber);

            return (int)(gump?.LocalSerial ?? 0);

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetX

Returns the value of the expression below.

Parameters: id

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

public int GetX(int id)

Result: int.

Result: WithEntity(id, e => e.X).

Calls: WithEntity.

Calls:

Internal implementation code; this is not a standalone script.

public int GetX(int id) => WithEntity(id, e => e.X);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.HttpRequest

Checks the conditions below and returns the displayed result.

Parameters: method, url, body

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

public string[] HttpRequest(string method, string url, string body)

Result: string[].

Result: new[] { string.Empty, string.Empty, "0", string.Empty }.

Calls: CancellationTokenSource.CreateLinkedTokenSource, lifetime.CancelAfter, string.Equals, _httpClient.Send, `response.Content.ReadAsByteArrayAsync(lifetime.Token)

                .GetAwaiter().GetResult`, `response.Content.ReadAsByteArrayAsync(lifetime.Token)

                .GetAwaiter`, `response.Content.ReadAsByteArrayAsync`, `string.IsNullOrWhiteSpace`.

Conditions: request.Method == HttpMethod.Post; !string.IsNullOrWhiteSpace(charset).

Calls:

Internal implementation code; this is not a standalone script.

public string[] HttpRequest(string method, string url, string body)

        {

            try

            {

                // ResponseHeadersRead ends HttpClient's own timeout at the headers.

                // Keep one deadline over both the request and the response body.

                using var lifetime = CancellationTokenSource.CreateLinkedTokenSource(_cancellationToken);

                lifetime.CancelAfter(_httpClient.Timeout);

                using var request = new HttpRequestMessage(

                    string.Equals(method, "POST", StringComparison.OrdinalIgnoreCase) ? HttpMethod.Post : HttpMethod.Get,

                    url);

                if (request.Method == HttpMethod.Post)

                    request.Content = new StringContent(body ?? string.Empty);

                using HttpResponseMessage response = _httpClient.Send(request,

                    HttpCompletionOption.ResponseHeadersRead, lifetime.Token);



                byte[] responseBytes = response.Content.ReadAsByteArrayAsync(lifetime.Token)

                    .GetAwaiter().GetResult();

                Encoding encoding = Encoding.UTF8;

                string charset = response.Content.Headers.ContentType?.CharSet;

                if (!string.IsNullOrWhiteSpace(charset))

                {

                    charset = charset.Trim().Trim('\"');

                    try { encoding = Encoding.GetEncoding(charset); }

                    catch (ArgumentException) { encoding = Encoding.UTF8; }

                }

                string responseBody = encoding.GetString(responseBytes);

                string headers = string.Join("\r\n", response.Headers.Concat(response.Content.Headers)

                    .Select(pair => pair.Key + ": " + string.Join(", ", pair.Value)));

                return new[]

                {

                    responseBody,

                    headers,

                    ((int)response.StatusCode).ToString(CultureInfo.InvariantCulture),

                    Convert.ToBase64String(responseBytes)

                };

            }

            catch (OperationCanceledException) when (_cancellationToken.IsCancellationRequested)

            {

                throw;

            }

            catch (Exception ex)

            {

                Error("UO.HTTP: " + ex.Message);

                return new[] { string.Empty, string.Empty, "0", string.Empty };

            }

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Intelligence

Reads the current character value from the local client model.

Parameters: No parameters.

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

public int Intelligence

Result: int.

Result: Invoke(() => _world.Player is { IsDestroyed: false } player ? player.Intelligence : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int Intelligence => Invoke(() => _world.Player is { IsDestroyed: false } player ? player.Intelligence : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsGumpCanBeClosed

Returns the value of the expression below.

Parameters: index

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

public int IsGumpCanBeClosed(int index)

Result: int.

Result: Invoke(() => ServerGumpsUnsafe().ElementAtOrDefault(index)?.CanCloseWithRightClick == true ? 1 : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int IsGumpCanBeClosed(int index) => Invoke(() => ServerGumpsUnsafe().ElementAtOrDefault(index)?.CanCloseWithRightClick == true ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsNpc

Returns the value of the expression below.

Parameters: id

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

public int IsNpc(int id)

Result: int.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int IsNpc(int id) => Invoke(() =>

            _world.Mobiles.Get(unchecked((uint)id)) is Mobile mobile && !mobile.IsDestroyed ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MatchesFindMobile

Returns the value of the expression below.

Parameters: mobile, type, color, range, ignoredTypes

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

private bool MatchesFindMobile(Mobile mobile, int type, int color, int range, IgnoreTypeFilter ignoredTypes)

Result: bool.

Calls: IsSelfMobile, MatchesFindIdentity, MatchesFindMobileRange.

Calls:

Internal implementation code; this is not a standalone script.

private bool MatchesFindMobile(Mobile mobile, int type, int color, int range, IgnoreTypeFilter ignoredTypes)

        {

            return !IsSelfMobile(mobile)

                && MatchesFindIdentity(mobile, type, color, ignoredTypes)

                && MatchesFindMobileRange(mobile, range);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MatchesFindMobileRange

Returns the value of the expression below.

Parameters: mobile, range

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

private bool MatchesFindMobileRange(Mobile mobile, int range)

Result: bool.

Calls: Math.Abs.

Internal implementation code; this is not a standalone script.

private bool MatchesFindMobileRange(Mobile mobile, int range)

        {

            return mobile.Distance <= range

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

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MenuPresent

Returns the value of the expression below.

Parameters: No parameters.

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

public int MenuPresent()

Result: int.

Result: WaitingMenu().

Calls: WaitingMenu.

Calls:

Internal implementation code; this is not a standalone script.

public int MenuPresent() => WaitingMenu();

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Poisoned

Returns the value of the expression below.

Parameters: id

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

public int Poisoned(int id)

Result: int.

Result: Invoke(() => (_world.Get(unchecked((uint)id)) as Mobile)?.IsPoisoned == true ? 1 : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RegisterFoundSerial

Performs the displayed calls and state updates.

Parameters: serial

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

private void RegisterFoundSerial(int serial)

Result: void.

Calls: _foundItems.Add.

Conditions: _findItem == 0.

Internal implementation code; this is not a standalone script.

private void RegisterFoundSerial(int serial)

        {

            _foundItems.Add(serial);

            if (_findItem == 0)

            {

                _findItem = serial;

            }

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ResetProfile

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void ResetProfile()

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void ResetProfile() => Invoke(() =>

        {

            if (!ProfileManager.ResetCurrentProfileToDefault())

                Error("UO.ResetProfile: no active profile to reset.");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RuntimeProductVersion

Returns the value of the expression below.

Parameters: No parameters.

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

public string RuntimeProductVersion

Result: string.

Result: YokoScriptEditorGump.PRODUCT_VERSION.

Internal implementation code; this is not a standalone script.

public string RuntimeProductVersion => YokoScriptEditorGump.PRODUCT_VERSION;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetAutoShopRule

Performs the displayed calls and state updates.

Parameters: rules, buy, type, color, quantity, maxPrice, name

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

`private static void SetAutoShopRule(List rules, bool buy, int type, int color,

        int quantity, int maxPrice, string name)`

Result: void.

Calls: rules.FirstOrDefault, rules.Remove, rules.Contains, rules.Add, string.IsNullOrWhiteSpace, name.Trim, Math.Min, Math.Max.

Conditions: rules == null || type < 0 || type > ushort.MaxValue; quantity <= 0; existing != null; !rules.Contains(existing).

Calls:

Internal implementation code; this is not a standalone script.

private static void SetAutoShopRule(List<BackNewbieItemRule> rules, bool buy, int type, int color,

            int quantity, int maxPrice, string name)

        {

            if (rules == null || type < 0 || type > ushort.MaxValue)

                return;

            bool anyHue = color < 0 || color == ushort.MaxValue;

            BackNewbieItemRule existing = rules.FirstOrDefault(rule => BackNewbieRuleLists.BelongsTo(rule, BackNewbieRuleLists.DefaultId)

                && rule.Graphic == (ushort)type

                && rule.AnyHue == anyHue && (anyHue || rule.Hue == (ushort)color));

            if (quantity <= 0)

            {

                if (existing != null) rules.Remove(existing);

            }

            else

            {

                existing ??= new BackNewbieItemRule();

                if (!rules.Contains(existing)) rules.Add(existing);

                existing.Name = string.IsNullOrWhiteSpace(name) ? $"Graphic 0x{type:X4}" : name.Trim();

                existing.Graphic = (ushort)type;

                existing.Hue = anyHue ? (ushort)0 : (ushort)color;

                existing.AnyHue = anyHue;

                existing.Amount = (ushort)Math.Min(ushort.MaxValue, quantity);

                existing.MaxPrice = (uint)Math.Max(0, maxPrice);

                existing.MatchName = name?.Trim() ?? string.Empty;

                existing.Enabled = true;

            }

            Profile profile = ProfileManager.CurrentProfile;

            if (profile != null)

            {

                if (buy) profile.BackNewbieAutoBuyEnabled = rules.Count > 0;

                else profile.BackNewbieAutoSellEnabled = rules.Count > 0;

                UIManager.GetGump<OptionsGump>()?.SetBackNewbieAutomationEnabled(

                    buy ? BackNewbieAutomationType.AutoBuy : BackNewbieAutomationType.AutoSell, rules.Count > 0);

                ProfileManager.SaveCurrentProfile();

            }

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetStatLockState

Performs the displayed calls and state updates.

Parameters: stat, state

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

public void SetStatLockState(int stat, int state)

Result: void.

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player == null || stat < 0 || stat > 2 || state < 0 || state > 2) return; Lock value = (Lock)state; GameActions.ChangeStatLock((byte)stat, value); if (stat == 0) _world.Player.StrLock = value; else if (stat == 1) _world.Player.DexLock = value; else _world.Player.IntLock = value; }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player == null || stat < 0 || stat > 2 || state < 0 || state > 2) return; Lock value = (Lock)state; GameActions.ChangeStatLock((byte)stat, value); if (stat == 0) _world.Player.StrLock = value; else if (stat == 1) _world.Player.DexLock = value; else _world.Player.IntLock = value; }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.GameActions.ChangeStatLock: GameActions.ChangeStatLock((byte)stat, value).

Internal implementation code; this is not a standalone script.

public void SetStatLockState(int stat, int state) => Invoke(() =>

        {

            if (_world.Player == null || stat < 0 || stat > 2 || state < 0 || state > 2) return;

            Lock value = (Lock)state;

            GameActions.ChangeStatLock((byte)stat, value);

            if (stat == 0) _world.Player.StrLock = value;

            else if (stat == 1) _world.Player.DexLock = value;

            else _world.Player.IntLock = value;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.StepQueued

Returns the value of the expression below.

Parameters: direction, running

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

public int StepQueued(int direction, bool running)

Result: int.

Result: result == STEP_QUEUE_OVERFLOW ? STEP_QUEUE_GENERAL_ERROR : result.

Calls: QueueStep.

Calls:

Internal implementation code; this is not a standalone script.

public int StepQueued(int direction, bool running)

        {

            int result = QueueStep(direction, running, false).Result;

            return result == STEP_QUEUE_OVERFLOW ? STEP_QUEUE_GENERAL_ERROR : result;

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.StopScript

Performs the displayed calls and state updates.

Parameters: index

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

public void StopScript(int index)

Result: void.

Calls: _manager.StopScript.

Calls:

Internal implementation code; this is not a standalone script.

public void StopScript(int index) => _manager.StopScript(index);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TradeCount

Returns the value of the expression below.

Parameters: No parameters.

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

public int TradeCount()

Result: int.

Result: Invoke(() => _world.Trades.Snapshot().Length).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int TradeCount() => Invoke(() => _world.Trades.Snapshot().Length);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.WaitTargetTile

Performs the displayed calls and state updates.

Parameters: type, x, y, z

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

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

Result: void.

Calls: _manager.QueueTargetTile.

Calls:

Internal implementation code; this is not a standalone script.

public void WaitTargetTile(int type, int x, int y, int z) => _manager.QueueTargetTile((ushort)type, (ushort)x, (ushort)y, (short)z, _cancellationToken);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.WarMode

Returns the value of the expression below.

Parameters: No parameters.

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

public int WarMode()

Result: int.

Result: Invoke(() => _world.Player?.InWarMode == true ? 1 : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int WarMode() => Invoke(() => _world.Player?.InWarMode == true ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.WarpMouse

Performs the displayed calls and state updates.

Parameters: x, y

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

private static void WarpMouse(int x, int y)

Result: void.

Calls: RequireGameInput, SDL3.SDL.SDL_WarpMouseInWindow.

Calls:

Internal implementation code; this is not a standalone script.

private static void WarpMouse(int x, int y)

        {

            GameController game = RequireGameInput();

            Mouse.Position = new Point(x, y);

            SDL3.SDL.SDL_WarpMouseInWindow(game.Window.Handle, x, y);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.WithEntity

Returns the value of the expression below.

Parameters: id, selector

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

private int WithEntity(int id, Func<Entity, int> selector)

Result: int.

Result: Invoke(() => _world.Get((uint)id) is Entity entity ? selector(entity) : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

private int WithEntity(int id, Func<Entity, int> selector) => Invoke(() => _world.Get((uint)id) is Entity entity ? selector(entity) : 0);

ClassicUO.Game.Managers.YokoInjectionManager.AddMenuHook

Performs the displayed calls and state updates.

Parameters: caption, item, persistent

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

internal void AddMenuHook(string caption, string item, bool persistent)

Result: void.

Calls: _menuHooks.Add.

Internal implementation code; this is not a standalone script.

internal void AddMenuHook(string caption, string item, bool persistent)
        {
            lock (_menuHooksLock)
            {
                _menuHooks.Add(new YokoMenuHook
                {
                    Caption = caption ?? string.Empty,
                    Item = item ?? string.Empty,
                    Persistent = persistent
                });
            }
        }

InjectionScript.Runtime.InjectionApiUO.ApiNameExists

Returns the value of the expression below.

Parameters: name

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

public int ApiNameExists(string name)

Result: int.

Calls: NormalizeApiName, metadata.NativeSubrutines.Any.

Calls:

Internal implementation code; this is not a standalone script.

public int ApiNameExists(string name)

        {

            string normalized = NormalizeApiName(name);

            return metadata.NativeSubrutines.Any(definition =>

                definition.Name.Equals(normalized, StringComparison.OrdinalIgnoreCase)) ? 1 : 0;

        }

InjectionScript.Runtime.InjectionApiUO.CastCore

Checks the conditions below and returns the displayed result.

Parameters: spellName

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

private bool CastCore(string spellName)

Result: bool.

Result: false; true.

Calls: ConvertSpellName, SystemMessage, bridge.Cast, Timer.

Conditions: !spellId.HasValue; bridge.Cast(spellId.Value) == 0.

Calls:

Internal implementation code; this is not a standalone script.

private bool CastCore(string spellName)

        {

            var spellId = ConvertSpellName(spellName);

            if (!spellId.HasValue)

            {

                SystemMessage("Unknown spell name");

                return false;

            }

            if (bridge.Cast(spellId.Value) == 0)

                return false;

            ticksSpell = Timer();



            return true;

        }

InjectionScript.Runtime.InjectionApiUO.ClearClassMask

Checks the conditions below and returns the displayed result.

Parameters: name

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.ClassMasks.cs:87.

private int ClearClassMask(string name)

Result: int.

Result: classRules.Remove(name) ? 1 : 0; count.

Calls: classRules.Remove, classRules.Clear.

Conditions: name != null.

Internal implementation code; this is not a standalone script.

private int ClearClassMask(string name)
        {
            lock (classRulesSync)
            {
                if (name != null) return classRules.Remove(name) ? 1 : 0;
                int count = classRules.Count;
                classRules.Clear();
                return count;
            }
        }

InjectionScript.Runtime.InjectionApiUO.CompactFindTypeExtended

Checks the conditions below and returns the displayed result.

Parameters: values

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

private InjectionValue CompactFindTypeExtended(InjectionValue[] values)

Result: InjectionValue.

Result: new InjectionValue(string.Empty); serial == 0 ? new InjectionValue(string.Empty) : new InjectionValue(NumberConversions.ToHex(serial)).

Calls: ResolveType, NumberConversions.ToInt, ConvertContainer, ResolveCompactDistance, ToBoolean, ResolveCompactMaxZ, ParseIntMask, bridge.GetIgnoreList.

Conditions: values == null || values.Length < 7 || values.Length > 14; mobileOnly && itemOnly; !itemOnly && container <= 1; !mobileOnly && notorieties.Count == 0.

Calls:

Internal implementation code; this is not a standalone script.

private InjectionValue CompactFindTypeExtended(InjectionValue[] values)
        {
            if (values == null || values.Length < 7 || values.Length > 14)
                throw new NativeSubrutineException("UO.FindType extended route expects 7..14 arguments.");

            int type = ResolveType(values[0]);
            int color = NumberConversions.ToInt(values[1]);
            int container = ConvertContainer(values[2]);
            int distance = ResolveCompactDistance(values[3]);
            InjectionValue notoriety = values[4];
// …
            if (mobileOnly && itemOnly)
                return new InjectionValue(string.Empty);
// …
            if (!itemOnly && container <= 1)
// …
            if (!mobileOnly && notorieties.Count == 0)
// …
            if (nearest)
// …
            return serial == 0 ? new InjectionValue(string.Empty) : new InjectionValue(NumberConversions.ToHex(serial));
// …

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

InjectionScript.Runtime.InjectionApiUO.CompactInJournal

Checks the conditions below and returns the displayed result.

Parameters: values

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

private int CompactInJournal(InjectionValue[] values)

Result: int.

Result: result.

Calls: values[0].ToString, NumberConversions.ToInt, CurrentJournalTime, JournalTimestampToAge, ToBoolean, bridge.InJournalFiltered, SelectJournalSearchResult.

Conditions: values == null || values.Length < 3 || values.Length > 7.

Calls:

Internal implementation code; this is not a standalone script.

private int CompactInJournal(InjectionValue[] values)

        {

            if (values == null || values.Length < 3 || values.Length > 7)

                throw new NativeSubrutineException("UO.InJournal compact form expects pattern, serial, color[, startTime[, endTime[, newestOnly[, caseSensitive]]]].");



            string pattern = values[0].ToString() ?? string.Empty;

            int serial = NumberConversions.ToInt(values[1]);

            int color = NumberConversions.ToInt(values[2]);

            int now = CurrentJournalTime();

            int startTime = values.Length > 3 ? NumberConversions.ToInt(values[3]) : 0;

            int endTime = values.Length > 4 ? NumberConversions.ToInt(values[4]) : 0;

            bool hasTimeRange = startTime > 0 || endTime > 0;

            int startAge = hasTimeRange ? JournalTimestampToAge(startTime, now) : 0;

            int endAge = endTime > 0 ? JournalTimestampToAge(endTime, now) : 0;

            bool newestOnly = values.Length > 5 && ToBoolean(values[5]);

            bool caseSensitive = values.Length > 6 && ToBoolean(values[6]);



            int result = bridge.InJournalFiltered(pattern, serial, color, startAge, endAge, newestOnly, caseSensitive);

            SelectJournalSearchResult(result, pattern, !caseSensitive);

            return result;

        }

InjectionScript.Runtime.InjectionApiUO.Dead

Returns the value of the expression below.

Parameters: No parameters.

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

public int Dead()

Result: int.

Result: bridge.Dead().

Calls: bridge.Dead.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.Drag

Returns the value of the expression below.

Parameters: id

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

public int Drag(InjectionValue id)

Result: int.

Result: Drag(id, InjectionValue.Zero, InjectionValue.Zero).

Calls: Drag.

Calls:

Internal implementation code; this is not a standalone script.

public int Drag(InjectionValue id) => Drag(id, InjectionValue.Zero, InjectionValue.Zero);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::StealthContainer

Returns the value of the expression below.

Parameters: index

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

int StealthContainer(int index)

Result: int.

Result: ConvertClientSearchContainer(arguments[index]).

Calls: ConvertClientSearchContainer.

Calls:

Internal implementation code; this is not a standalone script.

int StealthContainer(int index)

            {

                return ConvertClientSearchContainer(arguments[index]);

            }

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:2031.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "addchatuserignore": bridge.AddChatUserIgnore(Text(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:2029.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "addjournalignore": bridge.AddJournalIgnore(Text(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:2027.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "clearjournal": DeleteJournal(); 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:1645.

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

Calls:

Internal implementation code; this is not a standalone script.

case "clienttargetresponsepresent": return new InjectionValue(bridge.ClientTargetResponsePresent());

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:1551.

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

Calls:

Internal implementation code; this is not a standalone script.

case "confirmtrade": return new InjectionValue(bridge.ConfirmTrade(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:1300.

Result: new InjectionValue(state.ConnectedTime == default(DateTime) ? 0d : state.ConnectedTime.ToOADate()).

Calls:

Internal implementation code; this is not a standalone script.

case "connectedtime":

                    UpdateConnectionState();

                    return new InjectionValue(state.ConnectedTime == default(DateTime) ? 0d : state.ConnectedTime.ToOADate());

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:1446.

Result: new InjectionValue(flag)).ToArray()).

Calls:

Internal implementation code; this is not a standalone script.

case "convertintegertoflags":

                    return new InjectionValue(bridge.ConvertTileFlags(Arg(0), Arg(1))

                        .Select(flag => new InjectionValue(flag)).ToArray());

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:1998.

Result: new InjectionValue(bridge.ChangeProfileSelection(requestedProfile, requestedShard, requestedCharacter)).

Calls:

Internal implementation code; this is not a standalone script.

case "extchangeprofile":

                {

                    string requestedProfile = Text(0);

                    string requestedShard = arguments.Length > 1 ? Text(1) : string.Empty;

                    string requestedCharacter = arguments.Length > 2 ? Text(2) : string.Empty;

                    return new InjectionValue(bridge.ChangeProfileSelection(requestedProfile, requestedShard, requestedCharacter));

                }

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:1378.

Result: new InjectionValue(bridge.FindItem).

Calls:

Internal implementation code; this is not a standalone script.

case "finditem": return new InjectionValue(bridge.FindItem);

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:1510.

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

Calls:

Internal implementation code; this is not a standalone script.

case "getaltname": return new InjectionValue(bridge.GetAltName(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:2015.

Result: StringArray(bridge.GetBuffBarInfo()).

Calls:

Internal implementation code; this is not a standalone script.

case "getbuffbarinfo": return StringArray(bridge.GetBuffBarInfo());

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:1852.

new []

Result: [].

Calls:

Internal implementation code; this is not a standalone script.

case "getlandtilesarray":

                    return FindPortableTiles(Arg(0), Arg(1), Arg(2), Arg(3), Arg(4), new[] { Arg(5) }, false);

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:1461.

Result: new InjectionValue(0); new InjectionValue(step.Length > 1 ? step[1] : Arg(5)).

Conditions: bridge.IsOnline() == 0 || Arg(4) != bridge.WorldNumber.

Calls:

Internal implementation code; this is not a standalone script.

case "getnextstepz":

                {

                    if (bridge.IsOnline() == 0 || Arg(4) != bridge.WorldNumber)

                        return new InjectionValue(0);

                    int[] step = bridge.CheckWorldStep(Arg(0), Arg(1), Arg(5), Arg(2), Arg(3), Arg(4));

                    return new InjectionValue(step.Length > 1 ? step[1] : Arg(5));

                }

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:1843.

Calls:

Internal implementation code; this is not a standalone script.

case "getpatharray":

                    return BuildPortablePath(bridge.GetX(bridge.Self), bridge.GetY(bridge.Self), bridge.GetZ(bridge.Self),

                        Arg(0), Arg(1), bridge.GetZ(bridge.Self), bridge.WorldNumber, Arg(3), 255, Arg(2) != 0, false);

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:1368.

Result: new InjectionValue(arguments.Length > 0 ? bridge.GetStrength(Arg(0)) : bridge.Strength).

Calls:

Internal implementation code; this is not a standalone script.

case "getstr": return new InjectionValue(arguments.Length > 0 ? bridge.GetStrength(Arg(0)) : bridge.Strength);

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:1377.

Result: ReadGoldValue().

Calls:

Internal implementation code; this is not a standalone script.

case "gold": return ReadGoldValue();

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:1602.

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

Calls:

Internal implementation code; this is not a standalone script.

case "isgumpcanbeclosed": return new InjectionValue(bridge.IsGumpCanBeClosed(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:1512.

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

Calls:

Internal implementation code; this is not a standalone script.

case "ismovable": return new InjectionValue(bridge.IsMovable(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:1514.

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

Calls:

Internal implementation code; this is not a standalone script.

case "istrade": return new InjectionValue(bridge.IsTrade());

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:1531.

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

Calls:

Internal implementation code; this is not a standalone script.

case "lastcontainer": return new InjectionValue(bridge.GetLastContainer());

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:2045.

Result: new InjectionValue(selectedJournalEntry?.Timestamp ?? 0d).

Internal implementation code; this is not a standalone script.

case "linetime": return new InjectionValue(selectedJournalEntry?.Timestamp ?? 0d);

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:1589.

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

Calls:

Internal implementation code; this is not a standalone script.

case "menuhookpresent": return new InjectionValue(bridge.MenuHookPresent());

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:1535.

Result: new InjectionValue(ReadPredictedCoordinate(2)).

Calls:

Internal implementation code; this is not a standalone script.

case "predictedz": return new InjectionValue(ReadPredictedCoordinate(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:1553.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "renamemobile": bridge.RenameMobile(Arg(0), Text(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:1641.

Result: new InjectionValue(IsTargeting()).

Calls:

Internal implementation code; this is not a standalone script.

case "targetpresent": return new InjectionValue(IsTargeting());

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:1331.

Result: new InjectionValue(state.MoveExitOnDisconnect).

Conditions: arguments.Length > 0.

Calls:

Internal implementation code; this is not a standalone script.

case "moveexitondisconnect": if (arguments.Length > 0) state.MoveExitOnDisconnect = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveExitOnDisconnect);

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:1333.

Result: new InjectionValue(state.MoveOpenDoor).

Conditions: arguments.Length > 0.

Calls:

Internal implementation code; this is not a standalone script.

case "moveopendoor": if (arguments.Length > 0) state.MoveOpenDoor = Arg(0) != 0 ? 1 : 0; return new InjectionValue(state.MoveOpenDoor);

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:1336.

Result: new InjectionValue(state.MoveTurnCost).

Conditions: arguments.Length > 0.

Calls:

Internal implementation code; this is not a standalone script.

case "moveturncost": if (arguments.Length > 0) state.MoveTurnCost = Math.Max(0, Arg(0)); return new InjectionValue(state.MoveTurnCost);

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:2898.

Calls:

Internal implementation code; this is not a standalone script.

case "buy":

                    bridge.SetAutoBuyRule(Arg(0), arguments.Length > 1 ? Arg(1) : -1, arguments.Length > 2 ? Arg(2) : 1, arguments.Length > 3 ? Arg(3) : 0, arguments.Length > 4 ? Text(4) : string.Empty);

                    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:2872.

Calls:

Internal implementation code; this is not a standalone script.

case "cancelmove": MoveOff(); 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:3076.

Calls:

Internal implementation code; this is not a standalone script.

case "boxhack":

                case "fixtalk":

                case "fixwalk":

                    SystemMessage($"{name}: obsolete native-client patch; ClassicUO does not require it.");

                    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:3076.

Calls:

Internal implementation code; this is not a standalone script.

case "boxhack":

                case "fixtalk":

                case "fixwalk":

                    SystemMessage($"{name}: obsolete native-client patch; ClassicUO does not require it.");

                    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:2923.

Calls:

Internal implementation code; this is not a standalone script.

case "infocolor": SystemMessage($"0x{bridge.GetColor(Arg(0, bridge.LastTarget)):X4}"); 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:2978.

Conditions: createdSerial == 0.

Calls:

Internal implementation code; this is not a standalone script.

case "makefakeitem":

                {

                    int graphic = Arg(0);

                    int serial = Arg(1, 0);

                    int amount = Arg(2, 1);

                    int hue = Arg(3, 0);

                    int x = Arg(4, bridge.GetX(bridge.Self));

                    int y = Arg(5, bridge.GetY(bridge.Self));

                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);

                    if (createdSerial == 0)

                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");

                    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:3023.

Calls:

Internal implementation code; this is not a standalone script.

case "removehat": Unequip("Hat"); 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:3026.

Calls:

Internal implementation code; this is not a standalone script.

case "reqprofile":

                    SystemMessage(GetProfile(arguments.Length > 0 ? arguments[0] : new InjectionValue("lasttarget")));

                    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:3075.

Calls:

Internal implementation code; this is not a standalone script.

case "version": SystemMessage($"{bridge.RuntimeProductName} v{bridge.RuntimeProductVersion}"); break;

InjectionScript.Runtime.InjectionApiUO.FilterMobiles

Performs the displayed calls and state updates.

Parameters: distance, notoriety, body, maxZ, color, includeSelf, includeIgnored, aliveOnly, visibleOnly, nameMask

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

`private IEnumerable FilterMobiles(int distance, InjectionValue notoriety, InjectionValue body,

        int maxZ, int color, bool includeSelf, bool includeIgnored = false, bool aliveOnly = false,

        bool visibleOnly = false, InjectionValue nameMask = default(InjectionValue))`

Result: IEnumerable<int>.

Calls: bridge.GetIgnoreList, state.IgnoreTypeLists.FilterFor, ParseIntMask, ParseTypeMask, bridge.GetZ, bridge.GetFindDistance, Math.Max, bridge.GetFindVertical.

Conditions: (!includeSelf && id == self) || ignored.Contains(id) || MatchesIgnoredType(id, ignoredTypes); effectiveDistance >= 0 && bridge.GetDistance(id) > effectiveDistance; effectiveMaxZ >= 0 && Math.Abs(bridge.GetZ(id) - selfZ) > effectiveMaxZ; notorieties.Count > 0 && !notorieties.Contains(bridge.GetNotoriety(id)).

Calls:

Internal implementation code; this is not a standalone script.

private IEnumerable<int> FilterMobiles(int distance, InjectionValue notoriety, InjectionValue body,

            int maxZ, int color, bool includeSelf, bool includeIgnored = false, bool aliveOnly = false,

            bool visibleOnly = false, InjectionValue nameMask = default(InjectionValue))

        {

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

            IgnoreTypeFilter ignoredTypes = includeIgnored ? IgnoreTypeFilter.Empty : state.IgnoreTypeLists.FilterFor(state.SelectedIgnoreList);

            HashSet<int> notorieties = ParseIntMask(notoriety);

            HashSet<int> bodies = ParseTypeMask(body);

            int self = bridge.Self;

            int selfZ = bridge.GetZ(self);

            int effectiveDistance = distance < 0 ? bridge.GetFindDistance() : Math.Max(0, distance);

            int effectiveMaxZ = maxZ < 0 ? bridge.GetFindVertical() : Math.Max(0, maxZ);



            foreach (int id in bridge.GetMobiles())

            {

                if ((!includeSelf && id == self) || ignored.Contains(id) || MatchesIgnoredType(id, ignoredTypes))

                    continue;

                if (effectiveDistance >= 0 && bridge.GetDistance(id) > effectiveDistance)

                    continue;

                if (effectiveMaxZ >= 0 && Math.Abs(bridge.GetZ(id) - selfZ) > effectiveMaxZ)

                    continue;

                if (notorieties.Count > 0 && !notorieties.Contains(bridge.GetNotoriety(id)))

                    continue;

                if (bodies.Count > 0 && !bodies.Contains(bridge.GetGraphics(id)))

                    continue;

                if (color >= 0 && color != 0xFFFF && bridge.GetColor(id) != color)

                    continue;

                if (aliveOnly && bridge.IsDead(id) != 0)

                    continue;

                if (visibleOnly && bridge.IsVisible(id) == 0)

                    continue;

                if (!MatchesTextMask(bridge.GetName(id), nameMask))

                    continue;

                yield return id;

            }

        }

InjectionScript.Runtime.InjectionApiUO.FindType

Returns the value of the expression below.

Parameters: type

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

public string FindType(InjectionValue type)

Result: string.

Result: FindType(ResolveType(type)).

Calls: FindType, ResolveType.

Calls:

Internal implementation code; this is not a standalone script.

public string FindType(InjectionValue type)

            => FindType(ResolveType(type));

InjectionScript.Runtime.InjectionApiUO.GListClear

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void GListClear()

Result: void.

Calls: globalList.Clear.

Internal implementation code; this is not a standalone script.

public void GListClear() => globalList.Clear();

InjectionScript.Runtime.InjectionApiUO.GListGet

Returns the value of the expression below.

Parameters: nameValue

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

public InjectionValue GListGet(InjectionValue nameValue)

Result: InjectionValue.

Result: index >= 0 ? globalList[index].Value : InjectionValue.Zero.

Calls: nameValue.ToString, globalList.FindIndex.

Calls:

Internal implementation code; this is not a standalone script.

public InjectionValue GListGet(InjectionValue nameValue)

        {

            string name = nameValue.ToString();

            int index = globalList.FindIndex(pair => pair.Key.Equals(name, StringComparison.OrdinalIgnoreCase));

            return index >= 0 ? globalList[index].Value : InjectionValue.Zero;

        }

InjectionScript.Runtime.InjectionApiUO.GetAbilityID

Returns the value of the expression below.

Parameters: abilityName

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

public int GetAbilityID(string abilityName)

Result: int.

Result: bridge.ResolveAbility(abilityName).

Calls: bridge.ResolveAbility.

Calls:

Internal implementation code; this is not a standalone script.

public int GetAbilityID(string abilityName) => bridge.ResolveAbility(abilityName);

InjectionScript.Runtime.InjectionApiUO.GetDirection

Checks the conditions below and returns the displayed result.

Parameters: currentX, currentY, targetX, targetY

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

private int GetDirection(int currentX, int currentY, int targetX, int targetY)

Result: int.

Result: 6; 2; 4; 0; 5; 1.

Conditions: targetX < currentX && targetY == currentY; targetX > currentX && targetY == currentY; targetX == currentX && targetY > currentY; targetX == currentX && targetY < currentY.

Internal implementation code; this is not a standalone script.

private int GetDirection(int currentX, int currentY, int targetX, int targetY)

        {

            if (targetX < currentX && targetY == currentY)

                return 6;

            else if (targetX > currentX && targetY == currentY)

                return 2;

            else if (targetX == currentX && targetY > currentY)

                return 4;

            else if (targetX == currentX && targetY < currentY)

                return 0;

            else if (targetX < currentX && targetY > currentY)

                return 5;

            else if (targetX > currentX && targetY < currentY)

                return 1;

            else if (targetX < currentX && targetY < currentY)

                return 7;

            else if (targetX > currentX && targetY > currentY)

                return 3;



            // The only remaining case is an already reached destination. Returning

            // north is harmless and keeps legacy callers from receiving a misleading

            // unsupported-route failure for valid coordinates.

            return 0;

        }

InjectionScript.Runtime.InjectionApiUO.GetDistance

Returns the value of the expression below.

Parameters: x, y

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

public int GetDistance(int x, int y)

Result: int.

Result: GetDistance(bridge.GetX(bridge.Self), bridge.GetY(bridge.Self), x, y).

Calls: GetDistance, bridge.GetX, bridge.GetY.

Calls:

Internal implementation code; this is not a standalone script.

public int GetDistance(int x, int y) => GetDistance(bridge.GetX(bridge.Self), bridge.GetY(bridge.Self), x, y);

InjectionScript.Runtime.InjectionApiUO.GetJournalText

Returns the value of the expression below.

Parameters: index

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

public string GetJournalText(int index)

Result: string.

Result: selectedJournalEntry?.Text ?? string.Empty.

Calls: SelectJournalEntry, ReadJournalSnapshot.

Calls:

Internal implementation code; this is not a standalone script.

public string GetJournalText(int index)

        {

            SelectJournalEntry(ReadJournalSnapshot(index));

            return selectedJournalEntry?.Text ?? string.Empty;

        }

InjectionScript.Runtime.InjectionApiUO.GetQuantity

Returns the value of the expression below.

Parameters: id

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

public int GetQuantity(string id)

Result: int.

Result: GetQuantity(GetObject(id)).

Calls: GetQuantity, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

public int GetQuantity(string id) => GetQuantity(GetObject(id));

InjectionScript.Runtime.InjectionApiUO.GetSerial

Returns the value of the expression below.

Parameters: No parameters.

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

public string GetSerial()

Result: string.

Result: NumberConversions.ToHex(bridge.Self).

Calls: NumberConversions.ToHex.

Calls:

Internal implementation code; this is not a standalone script.

public string GetSerial() => NumberConversions.ToHex(bridge.Self);

InjectionScript.Runtime.InjectionApiUO.GetStaticTiles

Returns the value of the expression below.

Parameters: x, y, map

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

public InjectionValue GetStaticTiles(InjectionValue x, InjectionValue y, InjectionValue map)

Result: InjectionValue.

Result: ToArray(bridge.GetStaticTiles(NumberConversions.ToInt(x), NumberConversions.ToInt(y), NumberConversions.ToInt(map))).

Calls: ToArray, bridge.GetStaticTiles, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public InjectionValue GetStaticTiles(InjectionValue x, InjectionValue y, InjectionValue map)

            => ToArray(bridge.GetStaticTiles(NumberConversions.ToInt(x), NumberConversions.ToInt(y), NumberConversions.ToInt(map)));

InjectionScript.Runtime.InjectionApiUO.GumpLinesResult

Checks the conditions below and returns the displayed result.

Parameters: lines

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

private InjectionValue GumpLinesResult(string[] lines)

Result: InjectionValue.

Result: StringArray(lines).

Calls: Array.Empty<string>, bridge.TextPrint, bridge.TextOpen, StringArray.

Conditions: lines == null; state.SilentMode == 0 && lines.Length > 0.

Calls:

Internal implementation code; this is not a standalone script.

private InjectionValue GumpLinesResult(string[] lines)

        {

            if (lines == null)

                lines = Array.Empty<string>();



            if (state.SilentMode == 0 && lines.Length > 0)

            {

                foreach (string line in lines)

                    bridge.TextPrint(line ?? string.Empty);

                bridge.TextOpen();

            }



            return StringArray(lines);

        }

InjectionScript.Runtime.InjectionApiUO.InJournal

Returns the value of the expression below.

Parameters: pattern

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

public int InJournal(string pattern)

Result: int.

Result: InJournalCore(pattern, -1, ignoreCase: false).

Calls: InJournalCore.

Calls:

Internal implementation code; this is not a standalone script.

public int InJournal(string pattern)

            => InJournalCore(pattern, -1, ignoreCase: false);

InjectionScript.Runtime.InjectionApiUO.InJournalBetweenTimes

Returns the value of the expression below.

Parameters: pattern, startTime

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

public int InJournalBetweenTimes(string pattern, int startTime)

Result: int.

Result: InJournalBetweenTimesCore(pattern, startTime, CurrentJournalTime(), -1, ignoreCase: false).

Calls: InJournalBetweenTimesCore, CurrentJournalTime.

Calls:

Internal implementation code; this is not a standalone script.

public int InJournalBetweenTimes(string pattern, int startTime)

            => InJournalBetweenTimesCore(pattern, startTime, CurrentJournalTime(), -1, ignoreCase: false);

InjectionScript.Runtime.InjectionApiUO.JournalTimer

Returns the value of the expression below.

Parameters: index

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

public int JournalTimer(int index)

Result: int.

Result: JournalEntryTime(index).

Calls: JournalEntryTime.

Calls:

Internal implementation code; this is not a standalone script.

public int JournalTimer(int index) => JournalEntryTime(index);

InjectionScript.Runtime.InjectionApiUO.Msg

Performs the displayed calls and state updates.

Parameters: message

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

public void Msg(string message)

Result: void.

Calls: bridge.ServerPrint.

Calls:

Internal implementation code; this is not a standalone script.

public void Msg(string message) => bridge.ServerPrint(message);

InjectionScript.Runtime.InjectionApiUO.PlayWav

Returns the value of the expression below.

Parameters: file

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

public int PlayWav(string file)

Result: int.

Result: bridge.PlayWav(file).

Calls: bridge.PlayWav.

Calls:

Internal implementation code; this is not a standalone script.

public int PlayWav(string file) => bridge.PlayWav(file);

InjectionScript.Runtime.InjectionApiUO.Poisoned

Returns the value of the expression below.

Parameters: id

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

public int Poisoned(InjectionValue id)

Result: int.

Result: bridge.Poisoned(GetObject(id)).

Calls: bridge.Poisoned, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

public int Poisoned(InjectionValue id) => bridge.Poisoned(GetObject(id));

InjectionScript.Runtime.InjectionApiUO.ReadPredictedCoordinate

Checks the conditions below and returns the displayed result.

Parameters: component

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

private int ReadPredictedCoordinate(int component)

Result: int.

Result: predicted.PredictedX; predicted.PredictedY; predicted.PredictedZ; predicted.PredictedDirection; bridge.GetX(self); bridge.GetY(self).

Calls: bridge.GetX, bridge.GetY, bridge.GetZ, bridge.GetDir, nameof.

Conditions: bridge is IPredictedMovementBridge predicted.

Calls:

Internal implementation code; this is not a standalone script.

private int ReadPredictedCoordinate(int component)

        {

            if (bridge is IPredictedMovementBridge predicted)

            {

                switch (component)

                {

                    case 0: return predicted.PredictedX;

                    case 1: return predicted.PredictedY;

                    case 2: return predicted.PredictedZ;

                    case 3: return predicted.PredictedDirection;

                }

            }

            else

            {

                // Compatibility with external bridges predating queued reads.

                int self = bridge.Self;

                switch (component)

                {

                    case 0: return bridge.GetX(self);

                    case 1: return bridge.GetY(self);

                    case 2: return bridge.GetZ(self);

                    case 3: return bridge.GetDir(self);

                }

            }

            throw new ArgumentOutOfRangeException(nameof(component));

        }

InjectionScript.Runtime.InjectionApiUO.SelectGump

Performs the displayed calls and state updates.

Parameters: id

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

public void SelectGump(InjectionValue id)

Result: void.

Calls: bridge.SelectGump, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public void SelectGump(InjectionValue id) => bridge.SelectGump(NumberConversions.ToInt(id));

InjectionScript.Runtime.InjectionApiUO.SendGumpSelect

Returns the value of the expression below.

Parameters: serial, gumpId, triggerId

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

public int SendGumpSelect(InjectionValue serial, InjectionValue gumpId, InjectionValue triggerId)

Result: int.

Result: bridge.SendGumpSelect(NumberConversions.ToInt(serial), NumberConversions.ToInt(gumpId), NumberConversions.ToInt(triggerId)).

Calls: bridge.SendGumpSelect, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public int SendGumpSelect(InjectionValue serial, InjectionValue gumpId, InjectionValue triggerId)

            => bridge.SendGumpSelect(NumberConversions.ToInt(serial), NumberConversions.ToInt(gumpId), NumberConversions.ToInt(triggerId));

InjectionScript.Runtime.InjectionApiUO.SetShowZ

Performs the displayed calls and state updates.

Parameters: stateValue

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

public void SetShowZ(InjectionValue stateValue)

Result: void.

Calls: NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public void SetShowZ(InjectionValue stateValue) => showZ = NumberConversions.ToInt(stateValue) != 0 ? 1 : 0;

InjectionScript.Runtime.InjectionApiUO.Target

Performs the displayed calls and state updates.

Parameters: targetKey, target, targetType, type, x, y, z

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

`public void Target(

        InjectionValue targetKey,

        InjectionValue target,

        InjectionValue targetType,

        InjectionValue type,

        InjectionValue x,

        InjectionValue y,

        InjectionValue z

    )`

Result: void.

Calls: NumberConversions.ToInt, selector.Equals, TryGetObject, bridge.Target, ResolveType.

Conditions: targetTypeValue == 0 && !selector.Equals("ground", StringComparison.OrdinalIgnoreCase).

Calls:

Internal implementation code; this is not a standalone script.

public void Target

        (

            InjectionValue targetKey,

            InjectionValue target,

            InjectionValue targetType,

            InjectionValue type,

            InjectionValue x,

            InjectionValue y,

            InjectionValue z

        )

        {

            int targetTypeValue = NumberConversions.ToInt(targetType);

            string selector = target.Kind == InjectionValueKind.String ? target.String : string.Empty;

            int serial = 0;



            if (targetTypeValue == 0 && !selector.Equals("ground", StringComparison.OrdinalIgnoreCase))

                TryGetObject(target, out serial);



            bridge.Target

            (

                NumberConversions.ToInt(targetKey),

                serial,

                targetTypeValue,

                ResolveType(type),

                NumberConversions.ToInt(x),

                NumberConversions.ToInt(y),

                NumberConversions.ToInt(z)

            );

        }

InjectionScript.Runtime.InjectionApiUO.TerminateAll

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void TerminateAll()

Result: void.

Calls: bridge.Terminate.

Calls:

Internal implementation code; this is not a standalone script.

public void TerminateAll() => bridge.Terminate("all");

InjectionScript.Runtime.InjectionApiUO.TextClear

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void TextClear()

Result: void.

Calls: bridge.TextClear.

Calls:

Internal implementation code; this is not a standalone script.

public void TextClear() => bridge.TextClear();

InjectionScript.Runtime.InjectionApiUO.TicksSpell

Returns the value of the expression below.

Parameters: No parameters.

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

public int TicksSpell()

Result: int.

Result: ticksSpell.

Internal implementation code; this is not a standalone script.

public int TicksSpell() => ticksSpell;

InjectionScript.Runtime.InjectionApiUO.UpdateConnectionState

Performs the displayed calls and state updates.

Parameters: No parameters.

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

private void UpdateConnectionState()

Result: void.

Calls: connectionTimes.GetConnectionTimes, bridge.IsOnline.

Conditions: bridge is IApiConnectionTimesBridge connectionTimes; state.LastConnectionState == online; online != 0.

Calls:

Internal implementation code; this is not a standalone script.

private void UpdateConnectionState()

        {

            if (bridge is IApiConnectionTimesBridge connectionTimes)

            {

                // Never infer a session event from a script's first observation.

                // A pause can span both disconnect and login without an offline query.

                ApiConnectionTimes times = connectionTimes.GetConnectionTimes();

                state.ConnectedTime = times.Connected;

                state.DisconnectedTime = times.Disconnected;

                return;

            }



            // Compatibility for external hosts without session-owned timestamps.

            int online = bridge.IsOnline() != 0 ? 1 : 0;

            if (state.LastConnectionState == online)

                return;

            state.LastConnectionState = online;

            if (online != 0) state.ConnectedTime = timeSource.Now;

            else state.DisconnectedTime = timeSource.Now;

        }

InjectionScript.Runtime.InjectionApiUO.UpdateObject

Performs the displayed calls and state updates.

Parameters: id

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

public void UpdateObject(InjectionValue id)

Result: void.

Calls: bridge.UpdateObject, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

public void UpdateObject(InjectionValue id) => bridge.UpdateObject(GetObject(id));

InjectionScript.Runtime.InjectionApiUO.WaitTargetObject

Performs the displayed calls and state updates.

Parameters: id

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

public void WaitTargetObject(int id)

Result: void.

Calls: bridge.WaitTargetObject, Timer.

Calls:

Internal implementation code; this is not a standalone script.

public void WaitTargetObject(int id)

        {

            bridge.WaitTargetObject(id);

            ticksTarget = Timer();

        }

InjectionScript.Runtime.InjectionApiUO.WaitTargetType

Performs the displayed calls and state updates.

Parameters: type

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

public void WaitTargetType(InjectionValue type)

Result: void.

Calls: WaitTargetType, ResolveType.

Calls:

Internal implementation code; this is not a standalone script.

public void WaitTargetType(InjectionValue type) => WaitTargetType(ResolveType(type), -1);

InjectionScript.Runtime.InjectionApiUO.WaitWithEvents

Performs the displayed calls and state updates.

Parameters: milliseconds

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

private void WaitWithEvents(int milliseconds)

Result: void.

Calls: Math.Max, injectionApi.Wait, DispatchLegacyEvents, Math.Min.

Conditions: remaining == 0.

Calls:

Internal implementation code; this is not a standalone script.

private void WaitWithEvents(int milliseconds)

        {

            int remaining = Math.Max(0, milliseconds);

            if (remaining == 0)

            {

                injectionApi.Wait(0);

                DispatchLegacyEvents();

                return;

            }



            while (remaining > 0)

            {

                int slice = Math.Min(remaining, 25);

                injectionApi.Wait(slice);

                remaining -= slice;

                DispatchLegacyEvents();

            }

        }

InjectionScript.Runtime.InjectionApiUO.Register [FindList]

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:304.

values

Result: values.

Result: new InjectionValue(CompactFindList(values)).

Calls: CompactFindList.

Calls:

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactFindList(values))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [FollowersMax]

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:1049.

Result: bridge.FollowersMax.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.FollowersMax

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetEnergyResist]

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:1046.

Result: bridge.EnergyResistance.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.EnergyResistance

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetMaxMana]

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:1027.

Result: bridge.MaxMana.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.MaxMana

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetRace]

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:1050.

Result: bridge.Race.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Race

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetStrength]

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 [MaxStamina]

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:1029.

Result: bridge.MaxStamina.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.MaxStamina

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.InjectionRuntime.IsRemainderTextCommand

Returns the value of the expression below.

Parameters: command

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/NativeConsoleDispatch.cs:262.

private static bool IsRemainderTextCommand(string command)

Result: bool.

Calls: command.Equals.

Internal implementation code; this is not a standalone script.

private static bool IsRemainderTextCommand(string command) =>
            command.Equals("Msg", StringComparison.OrdinalIgnoreCase)
            || command.Equals("Say", StringComparison.OrdinalIgnoreCase)
            || command.Equals("Print", StringComparison.OrdinalIgnoreCase)
            || command.Equals("ConsolePrint", StringComparison.OrdinalIgnoreCase)
            || command.Equals("TextPrint", StringComparison.OrdinalIgnoreCase);

InjectionScript.Runtime.NativeSubrutineDefinition.Call

Checks the conditions below and returns the displayed result.

Parameters: argumentValues

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/NativeSubrutineDefinition.cs:312.

public InjectionValue Call(InjectionValue[] argumentValues)

Result: InjectionValue.

Result: variadicSubrutine(argumentValues); injVal; new InjectionValue(returnValue, subrutine.Method.ReturnType).

Calls: variadicSubrutine, argumentValues[i].ConvertTo, subrutine.DynamicInvoke, ExceptionDispatchInfo.Capture(ex.InnerException).Throw, ExceptionDispatchInfo.Capture.

Conditions: argumentValues.Length != parameterKinds.Length; variadicSubrutine != null; returnValue is InjectionValue injVal; ex.InnerException is OperationCanceledException.

Calls:

Internal implementation code; this is not a standalone script.

public InjectionValue Call(InjectionValue[] argumentValues)

        {

            if (argumentValues.Length != parameterKinds.Length)

                throw new NativeSubrutineException($"Mismatch of argument ({argumentValues.Length}) and parameters ({parameterKinds.Length}) count and parameters for {Name}.");



            if (variadicSubrutine != null)

                return variadicSubrutine(argumentValues);



            object[] args = new object[argumentValues.Length];

            for (int i = 0; i < argumentValues.Length; i++)

                args[i] = argumentValues[i].ConvertTo(parameterKinds[i]);



            try

            {

                var returnValue = subrutine.DynamicInvoke(args);

                if (returnValue is InjectionValue injVal)

                    return injVal;



                return new InjectionValue(returnValue, subrutine.Method.ReturnType);

            }

            catch (TargetInvocationException ex)

            {

                if (ex.InnerException is OperationCanceledException)

                    ExceptionDispatchInfo.Capture(ex.InnerException).Throw();

                if (ex.InnerException != null)

                    throw new NativeSubrutineException(ex.InnerException.Message, ex.InnerException);

                else

                    throw;

            }

        }

InjectionScript.Runtime.State.NamedIgnoreLists.Remove

Performs the displayed calls and state updates.

Parameters: name, type, hue

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/State/NamedIgnoreLists.cs:44.

public void Remove(string name, int? type = null, int? hue = null)

Result: void.

Calls: RequireName, Normalize, lists.Remove, lists.TryGetValue, filter.Rules.Where.

Conditions: type.HasValue; hue.HasValue; !type.HasValue; lists.TryGetValue(name, out var filter).

Calls:

Internal implementation code; this is not a standalone script.

public void Remove(string name, int? type = null, int? hue = null)
        {
            name = RequireName(name);
            if (type.HasValue) type = Normalize(type.Value);
            if (hue.HasValue) hue = Normalize(hue.Value);
            lock (sync)
            {
                if (!type.HasValue) lists.Remove(name);
                else if (lists.TryGetValue(name, out var filter))
                    lists[name] = new IgnoreTypeFilter(filter.Rules.Where(rule => rule.Type != type.Value
                        || hue.HasValue && rule.Hue != hue.Value));
            }
        }

Clone this wiki locally