ZH TW Runtime Helpers 8 - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

輔助函式 8

內部實作程式碼,不能作為獨立腳本執行。

ClassicUO.CSharp.CSharpCallbacks.Exists

執行所示呼叫及狀態更新。

參數: string name

來源: Project_Full/src/ClassicUO.CSharp/CSharpCallbacks.cs:136.

public bool Exists(string name)

結果: bool.

呼叫:

  • Verify
  • routines.ContainsKey
  • (name ?? "").Trim

內部實作程式碼,不能作為獨立腳本執行。

public bool Exists(string name) { Verify(); lock (sync) return routines.ContainsKey((name ?? "").Trim()); }

ClassicUO.Game.GameActions.Print

執行所示呼叫及狀態更新。

參數: World world, string message, ushort hue = 946, MessageType type = MessageType.Regular, byte font = 3, bool unicode = true

來源: Project_Full/src/ClassicUO.Client/Game/GameActions.cs:481.

public static void Print(World world, string message, ushort hue = 946, MessageType type = MessageType.Regular, byte font = 3, bool unicode = true)

結果: void.

條件:

  • systemChat != null && !systemChat.IsDisposed && SystemChatControl.NeedsDirectViewportFallback(messageSequence, systemChat.MessageSequence)

呼叫:

  • NormalizeLocalDisplayFont
  • ShouldTrackLocalViewportLine
  • Print
  • SystemChatControl.NeedsDirectViewportFallback
  • systemChat.AddLineIfSequenceUnchanged

內部實作程式碼,不能作為獨立腳本執行。

public static void Print(World world, string message, ushort hue = 946, MessageType type = MessageType.Regular, byte font = 3, bool unicode = true)
        {
            NormalizeLocalDisplayFont(message, ref font, ref unicode);

            SystemChatControl systemChat = ShouldTrackLocalViewportLine(type) ? UIManager.SystemChat : null;
            long messageSequence = systemChat?.MessageSequence ?? -1;

            Print
            (
                world,
                null,
                message,
                hue,
                type,
                font,
                unicode
            );

            // MessageManager normally delivers local Regular/System lines
            // synchronously to SystemChatControl. If a profile/filter combination did not add the
            // line, put it directly into the same in-world viewport control.
            // The sequence check prevents duplicate lines on the normal route.
            if (systemChat != null && !systemChat.IsDisposed
                && SystemChatControl.NeedsDirectViewportFallback(messageSequence, systemChat.MessageSequence))
            {
                systemChat.AddLineIfSequenceUnchanged(messageSequence, message, font, hue, unicode);
            }
        }

ClassicUO.Game.GameActions.Rename

執行所示呼叫及狀態更新。

參數: uint serial, string name

來源: Project_Full/src/ClassicUO.Client/Game/GameActions.cs:817.

public static void Rename(uint serial, string name)

結果: void.

呼叫:

  • Socket.Send_RenameRequest

內部實作程式碼,不能作為獨立腳本執行。

public static void Rename(uint serial, string name)
        {
            Socket.Send_RenameRequest(serial, name);
        }

ClassicUO.Game.GameActions.RequestPartyAccept

執行所示呼叫及狀態更新。

參數: uint serial

來源: Project_Full/src/ClassicUO.Client/Game/GameActions.cs:542.

public static void RequestPartyAccept(uint serial)

結果: void.

呼叫:

  • Socket.Send_PartyAccept
  • UIManager.GetGump<PartyInviteGump>
  • .Dispose

內部實作程式碼,不能作為獨立腳本執行。

public static void RequestPartyAccept(uint serial)
        {
            Socket.Send_PartyAccept(serial);

            UIManager.GetGump<PartyInviteGump>()?.Dispose();
        }

ClassicUO.Game.GameActions.ShouldTrackLocalViewportLine

執行所示呼叫及狀態更新。

參數: MessageType type

來源: Project_Full/src/ClassicUO.Client/Game/GameActions.cs:388.

internal static bool ShouldTrackLocalViewportLine(MessageType type)

結果: bool.

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

internal static bool ShouldTrackLocalViewportLine(MessageType type) =>
            type == MessageType.Regular || type == MessageType.System;

ClassicUO.Game.GameActions.ToggleWarMode

執行所示呼叫及狀態更新。

參數: PlayerMobile player

來源: Project_Full/src/ClassicUO.Client/Game/GameActions.cs:25.

public static void ToggleWarMode(PlayerMobile player)

結果: void.

呼叫:

  • RequestWarMode

內部實作程式碼,不能作為獨立腳本執行。

public static void ToggleWarMode(PlayerMobile player)
        {
            RequestWarMode(player, !player.InWarMode);
        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Backpack

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:154.

public int Backpack

結果: int.

呼叫:

  • Invoke
  • player.FindItemByLayer

內部實作程式碼,不能作為獨立腳本執行。

public int Backpack => Invoke(() => _world.Player is { IsDestroyed: false } player

            ? unchecked((int)(player.FindItemByLayer(Layer.Backpack)?.Serial ?? 0)) : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ChangeProfileSelection

執行所示呼叫及狀態更新。

參數: string profileName, string shardName, string characterName

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:521.

public int ChangeProfileSelection(string profileName, string shardName, string characterName)

結果: int.

條件:

  • _world.SessionControl != null
  • NetClient.Socket.IsConnected || NetClient.Socket.IsConnecting || _world.InGame
  • _manager.RunningScriptCount > 1
  • string.IsNullOrWhiteSpace(profileName)

呼叫:

  • Invoke
  • ReportStatus
  • string.IsNullOrWhiteSpace
  • shardName.Trim
  • ProfileManager.TryResolveProfileCharacter
  • profileName.Trim
  • characterName.Trim
  • ProfileManager.SaveCurrentProfile
  • ProfileManager.UnLoadProfile
  • Settings.GlobalSettings.Save
  • LastCharacterManager.OverrideLastCharacter

內部實作程式碼,不能作為獨立腳本執行。

public int ChangeProfileSelection(string profileName, string shardName, string characterName) => Invoke(() =>

        {

            if (_world.SessionControl != null)

            {

                ReportStatus("Choose another profile in ClassicUO Manager. A running session keeps its own profile.");

                return -2;

            }

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

                return -2;

            if (_manager.RunningScriptCount > 1)

                return -3;

            if (string.IsNullOrWhiteSpace(profileName))

                return -4;



            string targetShard = !string.IsNullOrWhiteSpace(shardName)

                ? shardName.Trim()

                : !string.IsNullOrWhiteSpace(ProfileManager.CurrentProfile?.ServerName)

                    ? ProfileManager.CurrentProfile.ServerName

                    : !string.IsNullOrWhiteSpace(_world.ServerName) && _world.ServerName != "_"

                        ? _world.ServerName

                        : Settings.GlobalSettings.LastServerName;

            if (string.IsNullOrWhiteSpace(targetShard))

                return -4;



            if (!ProfileManager.TryResolveProfileCharacter(targetShard, profileName.Trim(), out string storedCharacter))

                return -4;



            string targetCharacter = !string.IsNullOrWhiteSpace(characterName)

                ? characterName.Trim()

                : storedCharacter;



            ProfileManager.SaveCurrentProfile();

            ProfileManager.UnLoadProfile();

            Settings.GlobalSettings.LastServerName = targetShard;

            Settings.GlobalSettings.Save();

            if (!string.IsNullOrWhiteSpace(targetCharacter))

                LastCharacterManager.OverrideLastCharacter(targetCharacter, false);

            return 0;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ClientTargetResponsePresent

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:931.

public int ClientTargetResponsePresent()

結果: int.

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

public int ClientTargetResponsePresent() => _clientTargetResponsePresent ? 1 : 0;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CloseGumpUnsafe

執行所示呼叫及狀態更新。

參數: Gump gump

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3123.

private void CloseGumpUnsafe(Gump gump)

結果: void.

條件:

  • gump?.CanCloseWithRightClick == true
  • ReferenceEquals(_selectedServerGump, gump)

呼叫:

  • gump.Dispose
  • ReferenceEquals

內部實作程式碼,不能作為獨立腳本執行。

private void CloseGumpUnsafe(Gump gump)

        {

            if (gump?.CanCloseWithRightClick == true)

            {

                gump.Dispose();

                if (ReferenceEquals(_selectedServerGump, gump))

                    _selectedServerGump = null;

            }

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Equip

執行所示呼叫及狀態更新。

參數: int layer, int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2213.

public int Equip(int layer, int id)

結果: int.

呼叫:

  • Invoke
  • TryEquipItem

內部實作程式碼,不能作為獨立腳本執行。

public int Equip(int layer, int id) => Invoke(() => TryEquipItem(layer, id));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetEasyUO

執行所示呼叫及狀態更新。

參數: int number

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3380.

public string GetEasyUO(int number)

結果: string.

條件:

  • !OperatingSystem.IsWindows()

呼叫:

  • OperatingSystem.IsWindows
  • Registry.CurrentUser.OpenSubKey
  • .GetValue
  • number.ToString
  • .ToString

內部實作程式碼,不能作為獨立腳本執行。

public string GetEasyUO(int number)

        {

            if (!OperatingSystem.IsWindows())

            {

                return string.Empty;

            }

            using RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\EasyUO", false);

            return key?.GetValue(number.ToString(CultureInfo.InvariantCulture))?.ToString()

                ?? key?.GetValue("*" + number.ToString(CultureInfo.InvariantCulture))?.ToString()

                ?? string.Empty;

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetLastContainer

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:273.

public int GetLastContainer()

結果: int.

呼叫:

  • Invoke

內部實作程式碼,不能作為獨立腳本執行。

public int GetLastContainer() => Invoke(() => (int)_world.LastContainer);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetName

執行所示呼叫及狀態更新。

參數: int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:329.

public string GetName(int id)

結果: string.

呼叫:

  • Invoke
  • _world.Get

內部實作程式碼,不能作為獨立腳本執行。

public string GetName(int id) => Invoke(() => _world.Get((uint)id)?.Name ?? string.Empty);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetScriptsList

執行所示呼叫及狀態更新。

參數: 沒有參數。

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

public int[] GetScriptsList()

結果: int[].

呼叫:

  • _manager.GetScriptsList

內部實作程式碼,不能作為獨立腳本執行。

public int[] GetScriptsList() => _manager.GetScriptsList();

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GlobalChatJoin

執行所示呼叫及狀態更新。

參數: string channel

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1735.

public void GlobalChatJoin(string channel)

結果: void.

呼叫:

  • Invoke
  • NetClient.Socket.Send_ChatJoinCommand

內部實作程式碼,不能作為獨立腳本執行。

public void GlobalChatJoin(string channel) => Invoke(() => NetClient.Socket.Send_ChatJoinCommand(channel ?? string.Empty));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.InJournalEx

執行所示呼叫及狀態更新。

參數: string pattern, int limit, bool ignoreCase

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

public int InJournalEx(string pattern, int limit, bool ignoreCase)

結果: int.

呼叫:

  • FindJournal

內部實作程式碼,不能作為獨立腳本執行。

public int InJournalEx(string pattern, int limit, bool ignoreCase)

            => FindJournal(pattern, null, null, limit, false, ignoreCase);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsContainer

執行所示呼叫及狀態更新。

參數: int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:246.

public int IsContainer(int id)

結果: int.

呼叫:

  • Invoke
  • _world.Get

內部實作程式碼,不能作為獨立腳本執行。

public int IsContainer(int id) => Invoke(() => (_world.Get(unchecked((uint)id)) as Item)?.ItemData.IsContainer == true ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsHouse

執行所示呼叫及狀態更新。

參數: int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:251.

public int IsHouse(int id)

結果: int.

呼叫:

  • Invoke
  • _world.Get

內部實作程式碼,不能作為獨立腳本執行。

public int IsHouse(int id) => Invoke(() => (_world.Get(unchecked((uint)id)) as Item)?.IsMulti == true ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsTreeTile

執行所示呼叫及狀態更新。

參數: int x, int y

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:674.

public int IsTreeTile(int x, int y)

結果: int.

呼叫:

  • Invoke
  • AnyTileAt
  • StaticFilters.IsTree

內部實作程式碼,不能作為獨立腳本執行。

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

            tile is Static or Multi && StaticFilters.IsTree(tile.Graphic, out _)) ? 1 : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.IsWarMode

執行所示呼叫及狀態更新。

參數: int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2291.

public int IsWarMode(int id)

結果: int.

呼叫:

  • Invoke
  • _world.Get

內部實作程式碼,不能作為獨立腳本執行。

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MatchesFindMobile

執行所示呼叫及狀態更新。

參數: Mobile mobile, HashSet<ushort> wantedTypes, HashSet<ushort> wantedColors, int range, IgnoreTypeFilter ignoredTypes

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:4135.

private bool MatchesFindMobile(Mobile mobile, HashSet<ushort> wantedTypes, HashSet<ushort> wantedColors, int range, IgnoreTypeFilter ignoredTypes)

結果: bool.

呼叫:

  • IsSelfMobile
  • MatchesFindIdentity
  • MatchesFindMobileRange

內部實作程式碼,不能作為獨立腳本執行。

private bool MatchesFindMobile(Mobile mobile, HashSet<ushort> wantedTypes, HashSet<ushort> wantedColors, int range, IgnoreTypeFilter ignoredTypes)

        {

            return !IsSelfMobile(mobile)

                && MatchesFindIdentity(mobile, wantedTypes, wantedColors, ignoredTypes)

                && MatchesFindMobileRange(mobile, range);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.OpenContainer

執行所示呼叫及狀態更新。

參數: int id, int delay

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1495.

public void OpenContainer(int id, int delay)

結果: void.

條件:

  • delay > 0

呼叫:

  • UseObject
  • Wait

內部實作程式碼,不能作為獨立腳本執行。

public void OpenContainer(int id, int delay)

        {

            UseObject(id);

            if (delay > 0)

            {

                Wait(delay);

            }

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PrintFormattedJournal

執行所示呼叫及狀態更新。

參數: text, textColorRgb, backgroundColorRgb, fontSize, fontName

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1862.

`public void PrintFormattedJournal(string text, int textColorRgb, int backgroundColorRgb,

        int fontSize, string fontName)`

結果: void.

呼叫: Invoke.

呼叫:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { using var journalContext = new JournalMessageContext("script"); text ??= string.Empty; int effectivePointSize = Math.Clamp(fontSize <= 0 ? 10 : fontSize, 4, 72); string effectiveFontName = string.IsNullOrWhiteSpace(fontName) ? "Consolas" : fontName.Trim(); uint textArgb = 0xFF000000u | (unchecked((uint)textColorRgb) & 0x00FFFFFFu); ushort hue = ClientFontManager.FindNearestUoHue(textArgb); // ClassicUO's in-world system chat uses UO font IDs rather than arbitrary // desktop point sizes. Map the requested point size to a stable UO font // index while retaining the exact Stealth formatting request in IDE output. byte uoFont = (byte)Math.Clamp((effectivePointSize + 1) / 3, 0, byte.MaxValue); GameActions.Print(_world, text, hue, SCRIPT_PRINT_MESSAGE_TYPE, uoFont, true); string background = backgroundColorRgb < 0 ? "default" : $"#{(unchecked((uint)backgroundColorRgb) & 0x00FFFFFFu):X6}"; _manager.AppendIdeOutput(_scriptKey, $"UO.AddToSystemJournalEx [text=#{(textArgb & 0x00FFFFFFu):X6}; bg={background}; " + $"font='{effectiveFontName}' {effectivePointSize}pt; uoFont={uoFont}; hue=0x{hue:X4}] {text}"); ReportStatus($"UO.AddToSystemJournalEx formatted journal line: {effectiveFontName} " + $"{effectivePointSize}pt, background {background}"); }). 多載候選:來源未確認實際選用哪個候選。
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { using var journalContext = new JournalMessageContext("script"); text ??= string.Empty; int effectivePointSize = Math.Clamp(fontSize <= 0 ? 10 : fontSize, 4, 72); string effectiveFontName = string.IsNullOrWhiteSpace(fontName) ? "Consolas" : fontName.Trim(); uint textArgb = 0xFF000000u | (unchecked((uint)textColorRgb) & 0x00FFFFFFu); ushort hue = ClientFontManager.FindNearestUoHue(textArgb); // ClassicUO's in-world system chat uses UO font IDs rather than arbitrary // desktop point sizes. Map the requested point size to a stable UO font // index while retaining the exact Stealth formatting request in IDE output. byte uoFont = (byte)Math.Clamp((effectivePointSize + 1) / 3, 0, byte.MaxValue); GameActions.Print(_world, text, hue, SCRIPT_PRINT_MESSAGE_TYPE, uoFont, true); string background = backgroundColorRgb < 0 ? "default" : $"#{(unchecked((uint)backgroundColorRgb) & 0x00FFFFFFu):X6}"; _manager.AppendIdeOutput(_scriptKey, $"UO.AddToSystemJournalEx [text=#{(textArgb & 0x00FFFFFFu):X6}; bg={background}; " + $"font='{effectiveFontName}' {effectivePointSize}pt; uoFont={uoFont}; hue=0x{hue:X4}] {text}"); ReportStatus($"UO.AddToSystemJournalEx formatted journal line: {effectiveFontName} " + $"{effectivePointSize}pt, background {background}"); }). 多載候選:來源未確認實際選用哪個候選。
  • ClassicUO.Game.GameActions.Print: GameActions.Print(_world, text, hue, SCRIPT_PRINT_MESSAGE_TYPE, uoFont, true).
  • ClassicUO.Game.Managers.YokoInjectionManager.AppendIdeOutput: _manager.AppendIdeOutput(_scriptKey, $"UO.AddToSystemJournalEx [text=#{(textArgb & 0x00FFFFFFu):X6}; bg={background}; " + $"font='{effectiveFontName}' {effectivePointSize}pt; uoFont={uoFont}; hue=0x{hue:X4}] {text}").
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ReportStatus: ReportStatus($"UO.AddToSystemJournalEx formatted journal line: {effectiveFontName} " + $"{effectivePointSize}pt, background {background}").

內部實作程式碼,不能作為獨立腳本執行。

public void PrintFormattedJournal(string text, int textColorRgb, int backgroundColorRgb,

            int fontSize, string fontName) => Invoke(() =>

        {

            using var journalContext = new JournalMessageContext("script");

            text ??= string.Empty;

            int effectivePointSize = Math.Clamp(fontSize <= 0 ? 10 : fontSize, 4, 72);

            string effectiveFontName = string.IsNullOrWhiteSpace(fontName) ? "Consolas" : fontName.Trim();

            uint textArgb = 0xFF000000u | (unchecked((uint)textColorRgb) & 0x00FFFFFFu);

            ushort hue = ClientFontManager.FindNearestUoHue(textArgb);



            // ClassicUO's in-world system chat uses UO font IDs rather than arbitrary

            // desktop point sizes. Map the requested point size to a stable UO font

            // index while retaining the exact Stealth formatting request in IDE output.

            byte uoFont = (byte)Math.Clamp((effectivePointSize + 1) / 3, 0, byte.MaxValue);

            GameActions.Print(_world, text, hue, SCRIPT_PRINT_MESSAGE_TYPE, uoFont, true);



            string background = backgroundColorRgb < 0

                ? "default"

                : $"#{(unchecked((uint)backgroundColorRgb) & 0x00FFFFFFu):X6}";

            _manager.AppendIdeOutput(_scriptKey,

                $"UO.AddToSystemJournalEx [text=#{(textArgb & 0x00FFFFFFu):X6}; bg={background}; "

                + $"font='{effectiveFontName}' {effectivePointSize}pt; uoFont={uoFont}; hue=0x{hue:X4}] {text}");

            ReportStatus($"UO.AddToSystemJournalEx formatted journal line: {effectiveFontName} "

                + $"{effectivePointSize}pt, background {background}");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RenameMobile

執行所示呼叫及狀態更新。

參數: int mobileId, string name

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:297.

public void RenameMobile(int mobileId, string name)

結果: void.

呼叫:

  • Invoke
  • GameActions.Rename

內部實作程式碼,不能作為獨立腳本執行。

public void RenameMobile(int mobileId, string name) => Invoke(() => GameActions.Rename((uint)mobileId, name ?? string.Empty));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Salute

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1582.

public void Salute()

結果: void.

呼叫:

  • Invoke
  • GameActions.EmoteAction

內部實作程式碼,不能作為獨立腳本執行。

public void Salute() => Invoke(() => GameActions.EmoteAction("salute"));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Say

執行所示呼叫及狀態更新。

參數: string message

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:1567.

public void Say(string message)

結果: void.

呼叫:

  • SendServerSpeech

內部實作程式碼,不能作為獨立腳本執行。

public void Say(string message) => SendServerSpeech("UO.Say", message);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SendGumpSelect

執行所示呼叫及狀態更新。

參數: int triggerId

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2993.

public int SendGumpSelect(int triggerId)

結果: int.

呼叫:

  • Invoke
  • ServerGumpsUnsafe().LastOrDefault
  • ServerGumpsUnsafe
  • SendGumpButtonUnsafe

內部實作程式碼,不能作為獨立腳本執行。

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

        {

            Gump gump = _selectedServerGump != null && !_selectedServerGump.IsDisposed

                ? _selectedServerGump : ServerGumpsUnsafe().LastOrDefault();

            return SendGumpButtonUnsafe(gump, triggerId, "no active server gump");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetFindVertical

執行所示呼叫及狀態更新。

參數: int distance

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:206.

public void SetFindVertical(int distance)

結果: void.

呼叫:

  • Math.Clamp

內部實作程式碼,不能作為獨立腳本執行。

public void SetFindVertical(int distance) => State.FindVertical = Math.Clamp(distance, 0, 120);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetJournalLine

執行所示呼叫及狀態更新。

參數: int index, string text

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:2204.

public void SetJournalLine(int index, string text)

結果: void.

條件:

  • entry != null

呼叫:

  • Invoke
  • GetJournalEntryUnsafe

內部實作程式碼,不能作為獨立腳本執行。

public void SetJournalLine(int index, string text) => Invoke(() =>

        {

            JournalEntry entry = GetJournalEntryUnsafe(index);

            if (entry != null)

            {

                entry.Text = text ?? string.Empty;

            }

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SetSpeechFilter

執行所示呼叫及狀態更新。

參數: int enabled

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:3979.

public void SetSpeechFilter(int enabled)

結果: void.

呼叫:

  • Invoke
  • _manager.SetSpeechFilter

內部實作程式碼,不能作為獨立腳本執行。

public void SetSpeechFilter(int enabled) => Invoke(() => _manager.SetSpeechFilter(enabled != 0));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.WaitTargetObject

執行所示呼叫及狀態更新。

參數: int id

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:847.

public void WaitTargetObject(int id)

結果: void.

呼叫:

  • _manager.QueueTarget

內部實作程式碼,不能作為獨立腳本執行。

public void WaitTargetObject(int id) => _manager.QueueTarget((uint)id, _cancellationToken);

ClassicUO.Game.Managers.YokoInjectionManager.ClearPendingTargets

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3305.

internal void ClearPendingTargets()

結果: void.

呼叫:

  • _pendingTargets.TryDequeue

內部實作程式碼,不能作為獨立腳本執行。

internal void ClearPendingTargets()

        {

            lock (_pendingTargetLock)

                while (_pendingTargets.TryDequeue(out _)) { }

        }

ClassicUO.Game.Managers.YokoInjectionManager.GetScriptName

執行所示呼叫及狀態更新。

參數: int index

來源: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:2811.

internal string GetScriptName(int index)

結果: string.

呼叫:

  • ElementAt
  • RunningScripts

內部實作程式碼,不能作為獨立腳本執行。

internal string GetScriptName(int index) => ElementAt(RunningScripts(), index)?.Name ?? string.Empty;

ClassicUO.Game.Managers.YokoInjectionManager.RequestedAutoloadPath

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/YokoInjectionManager.cs:3547.

private string RequestedAutoloadPath()

結果: string.

呼叫:

  • string.IsNullOrWhiteSpace
  • Path.GetFullPath
  • Path.Combine
  • Path.GetFileName
  • requested.Trim

內部實作程式碼,不能作為獨立腳本執行。

private string RequestedAutoloadPath()

        {

            string requested = ProfileManager.CurrentProfile?.YokoAutoloadFile;

            return string.IsNullOrWhiteSpace(requested) ? SelectedAutoloadPath

                : Path.GetFullPath(Path.Combine(AutoloadPath, Path.GetFileName(requested.Trim())));

        }

ClassicUO.Game.Map.Map.GetUsedChunks

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Map/Map.cs:251.

public IEnumerable<Chunk> GetUsedChunks()

結果: IEnumerable<Chunk>.

呼叫:

  • GetChunk

內部實作程式碼,不能作為獨立腳本執行。

public IEnumerable<Chunk> GetUsedChunks()
        {
            foreach (int i in _usedIndices)
            {
                yield return GetChunk(i);
            }
        }

ClassicUO.Game.UI.Gumps.SystemChatControl.NeedsDirectViewportFallback

執行所示呼叫及狀態更新。

參數: long before, long after

來源: Project_Full/src/ClassicUO.Client/Game/UI/Gumps/SystemChatControl.cs:458.

internal static bool NeedsDirectViewportFallback(long before, long after)

結果: bool.

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

internal static bool NeedsDirectViewportFallback(long before, long after) => before == after;

InjectionScript.Runtime.FollowStopCondition.Parse

執行所示呼叫及狀態更新。

參數: InjectionValue value, bool coordinateGoal = false

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/FollowStopCondition.cs:64.

public static FollowStopCondition[] Parse(InjectionValue value, bool coordinateGoal = false)

結果: FollowStopCondition[].

條件:

  • value.Kind != InjectionValueKind.Array
  • row.Kind != InjectionValueKind.Array || row.Array.Length != 3 || row.Array[0].Kind != InjectionValueKind.String || row.Array[1].Kind != InjectionValueKind.String || !Fields.TryGetValue((row.Array[0].String ?? string.Empty).Trim(), out FollowStopField field)
  • threshold.Kind != InjectionValueKind.Integer && threshold.Kind != InjectionValueKind.Decimal
  • double.IsNaN(number) || double.IsInfinity(number)

呼叫:

  • Fields.TryGetValue
  • (row.Array[0].String ?? string.Empty).Trim
  • row.Array[1].String.Trim
  • double.IsNaN
  • double.IsInfinity

內部實作程式碼,不能作為獨立腳本執行。

public static FollowStopCondition[] Parse(InjectionValue value, bool coordinateGoal = false)
        {
            if (value.Kind != InjectionValueKind.Array)
                throw new StatementFailedException("Follow: conditions must be an array of [field, comparison, number] rows.");
            var result = new FollowStopCondition[value.Array.Length];
            for (int i = 0; i < result.Length; i++)
            {
                InjectionValue row = value.Array[i];
                if (row.Kind != InjectionValueKind.Array || row.Array.Length != 3
                    || row.Array[0].Kind != InjectionValueKind.String || row.Array[1].Kind != InjectionValueKind.String
                    || !Fields.TryGetValue((row.Array[0].String ?? string.Empty).Trim(), out FollowStopField field))
                    throw new StatementFailedException("Follow: each condition needs a supported field, comparison and numeric threshold.");
                FollowComparison comparison;
                switch (row.Array[1].String.Trim())
                {
                    case "=": comparison = FollowComparison.Equal; break;
                    case "<>": comparison = FollowComparison.NotEqual; break;
                    case "<": comparison = FollowComparison.Less; break;
                    case "<=": comparison = FollowComparison.LessOrEqual; break;
                    case ">": comparison = FollowComparison.Greater; break;
                    case ">=": comparison = FollowComparison.GreaterOrEqual; break;
                    default: throw new StatementFailedException("Follow: comparison must be =, <>, <, <=, > or >=.");
                }
                InjectionValue threshold = row.Array[2];
                if (threshold.Kind != InjectionValueKind.Integer && threshold.Kind != InjectionValueKind.Decimal)
                    throw new StatementFailedException("Follow: threshold must be a number (use 1/0 or true/false for flags).");
                double number = threshold.Kind == InjectionValueKind.Integer ? threshold.Integer : threshold.Decimal;
                if (double.IsNaN(number) || double.IsInfinity(number))
                    throw new StatementFailedException("Follow: threshold must be finite.");
                result[i] = new FollowStopCondition(field, comparison, number);
                if (coordinateGoal && result[i].RequiresMobile)
                    throw new StatementFailedException("Follow: target.* conditions require a character target; use distance, height, elapsed or self.* for coordinates.");
            }
            return result;
        }

InjectionScript.Runtime.InjectionApi.GetWordCount

執行所示呼叫及狀態更新。

參數: string value

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApi.cs:46.

private static int GetWordCount(string value)

結果: int.

呼叫:

  • GetWordCount

內部實作程式碼,不能作為獨立腳本執行。

private static int GetWordCount(string value) => GetWordCount(value," ");

InjectionScript.Runtime.InjectionApiUO.AddObject

執行所示呼叫及狀態更新。

參數: string name

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3921.

public void AddObject(string name)

結果: void.

呼叫:

  • SystemMessage
  • bridge.AddObject

內部實作程式碼,不能作為獨立腳本執行。

public void AddObject(string name)

        {

            SystemMessage($"What is {name}");

            bridge.AddObject(name);

        }

InjectionScript.Runtime.InjectionApiUO.ConColor

執行所示呼叫及狀態更新。

參數: InjectionValue color

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6089.

public void ConColor(InjectionValue color)

結果: void.

呼叫:

  • NumberConversions.ToInt

內部實作程式碼,不能作為獨立腳本執行。

public void ConColor(InjectionValue color)

        {

            systemMessageColor = NumberConversions.ToInt(color);

        }

InjectionScript.Runtime.InjectionApiUO.Count

執行所示呼叫及狀態更新。

參數: InjectionValue type, InjectionValue color

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5328.

public int Count(InjectionValue type, InjectionValue color)

結果: int.

呼叫:

  • Count
  • ResolveType
  • NumberConversions.ToInt

內部實作程式碼,不能作為獨立腳本執行。

public int Count(InjectionValue type, InjectionValue color) 

            => Count(ResolveType(type), NumberConversions.ToInt(color), 0);

InjectionScript.Runtime.InjectionApiUO.CurrentJournalTime

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5613.

private int CurrentJournalTime()

結果: int.

條件:

  • milliseconds <= 0d

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

private int CurrentJournalTime()

        {

            double milliseconds = timeSource.SinceStart.TotalMilliseconds;

            if (milliseconds <= 0d)

                return 0;

            return milliseconds >= int.MaxValue ? int.MaxValue : (int)milliseconds;

        }

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::SerializeMapFigure

回傳下列表達式的值。

參數: fields, figureText

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1219.

string SerializeMapFigure(int[] fields, string figureText)

結果: string.

結果: string.Join("|", fields.Select(value => value.ToString(CultureInfo.InvariantCulture))) + "|" + (figureText ?? string.Empty).

呼叫: string.Join, fields.Select.

內部實作程式碼,不能作為獨立腳本執行。

string SerializeMapFigure(int[] fields, string figureText)

                => string.Join("|", fields.Select(value => value.ToString(CultureInfo.InvariantCulture))) + "|" + (figureText ?? string.Empty);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1638.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "cancelwaittarget": bridge.CancelWaitTarget(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1817.

結果: new InjectionValue(bridge.CheckLag(Arg(0, 10_000))).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "checklag": return new InjectionValue(bridge.CheckLag(Arg(0, 10_000)));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1820.

結果: InjectionValue.Unit.

內部實作程式碼,不能作為獨立腳本執行。

case "clearbadobjectlist": state.BadObjects.Clear(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1290.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "clearshoplist":

                    bridge.ClearAutoShopRules(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1643.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "clientrequestobjecttarget": bridge.RequestClientTarget(false); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1607.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "closeclientgump": bridge.CloseClientGump(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1235.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "fillinfowindow":

                    bridge.TextPrint(Text(0));

                    bridge.TextOpen();

                    return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1371.

結果: new InjectionValue(arguments.Length > 0 ? bridge.GetDexterity(Arg(0)) : bridge.Dexterity).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "getdex": return new InjectionValue(arguments.Length > 0 ? bridge.GetDexterity(Arg(0)) : bridge.Dexterity);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1883.

結果: new InjectionValue(Array.Empty<InjectionValue>()).

條件: bridge is IApiGumpAccess reader; snapshot == null || state.IgnoredGumpIds.Contains(snapshot.Id) || state.IgnoredGumpSerials.Contains(snapshot.Serial).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "getgumpinfo":

                {

                    int index = Arg(0);

                    GumpSnapshot snapshot;

                    if (bridge is IApiGumpAccess reader)

                        snapshot = reader.ReadGump(index);

                    else

                    {

                        int id = bridge.GetGumpId(index);

                        snapshot = id == 0 ? null : new GumpSnapshot(bridge.GetGumpSerial(index), id,

                            bridge.GetGumpTextLines(index), bridge.GetGumpButtonsDescription(index), bridge.GetGumpFullLines(index));

                    }

                    if (snapshot == null || state.IgnoredGumpIds.Contains(snapshot.Id)

                        || state.IgnoredGumpSerials.Contains(snapshot.Serial))

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

                    return new InjectionValue(new[]

                    {

                        new InjectionValue(snapshot.Serial), new InjectionValue(snapshot.Id), StringArray(snapshot.Text),

                        StringArray(snapshot.Buttons), StringArray(snapshot.Controls)

                    });

                }

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1374.

結果: new InjectionValue(arguments.Length > 0 ? bridge.GetMana(Arg(0)) : bridge.Mana).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "getmana": return new InjectionValue(arguments.Length > 0 ? bridge.GetMana(Arg(0)) : bridge.Mana);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1352.

結果: new InjectionValue(state.WalkUnmountTimer).

內部實作程式碼,不能作為獨立腳本執行。

case "getwalkunmounttimer": return new InjectionValue(state.WalkUnmountTimer);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2041.

結果: new InjectionValue(selectedJournalEntry?.Font ?? 0).

內部實作程式碼,不能作為獨立腳本執行。

case "linetextfont": return new InjectionValue(selectedJournalEntry?.Font ?? 0);

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1710.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "partycanlootme": bridge.PartyCanLoot(Arg(0) != 0); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1704.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "partyprivatemessageto": bridge.PartySay(Text(1), Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1270.

結果: new InjectionValue(bridge.PlayWav(Text(0))).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "playwav": return new InjectionValue(bridge.PlayWav(Text(0)));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1689.

結果: new InjectionValue(0); new InjectionValue(bridge.Step(Arg(0) & 7, Arg(1) != 0)).

條件: state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0; state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina; state.MoveOpenDoor != 0.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "step":

                    if (state.MoveExitOnDisconnect != 0 && bridge.IsOnline() == 0)

                        return new InjectionValue(0);

                    if (state.MoveCheckStamina > 0 && bridge.Stamina < state.MoveCheckStamina)

                        return new InjectionValue(0);

                    if (state.MoveOpenDoor != 0)

                        bridge.OpenDoor();

                    return new InjectionValue(bridge.Step(Arg(0) & 7, Arg(1) != 0));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1528.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "stopallscripts": bridge.StopAllScripts(); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1652.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "targettoxyz":

                    bridge.TargetToTile(0, Arg(0), Arg(1), Arg(2)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1721.

結果: InjectionValue.False; InjectionValue.True.

條件: !state.MapFigures.ContainsKey(id) || !TryMapFigureArg(1, out int[] figure, out string figureText); bridge.SetMapFigure(id, figure[0], figure[1], figure[2], figure[3], figure[4], figure[5], figure[6], figure[7], figure[8], figure[9], figureText) == 0.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "updatefigure":

                {

                    int id = Arg(0);

                    if (!state.MapFigures.ContainsKey(id) || !TryMapFigureArg(1, out int[] figure, out string figureText))

                        return InjectionValue.False;

                    if (bridge.SetMapFigure(id, figure[0], figure[1], figure[2], figure[3], figure[4], figure[5], figure[6], figure[7], figure[8], figure[9], figureText) == 0)

                        return InjectionValue.False;

                    state.MapFigures[id] = SerializeMapFigure(figure, figureText);

                    return InjectionValue.True;

                }

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1251.

結果: new InjectionValue(bridge.UseType(ResolveType(arguments[0]), arguments.Length > 1 ? Arg(1) : -1)).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "usetype": return new InjectionValue(bridge.UseType(ResolveType(arguments[0]), arguments.Length > 1 ? Arg(1) : -1));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1258.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "waitgump": CompactWaitGump(arguments); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1272.

結果: InjectionValue.Unit.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "waittargetobject": WaitTargetObject(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2851.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "addtype":

                    AddType(arguments);

                    break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:2961.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "fontcolor": state.FontColor = Arg(0, state.FontColor); break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

此分支僅處理指定的命令名稱。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3024.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

case "removeneckless": Unequip("Neck"); break;

InjectionScript.Runtime.InjectionApiUO.FindMobile

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3773.

public int FindMobile()

結果: int.

呼叫:

  • FindMobile

內部實作程式碼,不能作為獨立腳本執行。

public int FindMobile() => FindMobile(new InjectionValue("all"), new InjectionValue("all"),

            new InjectionValue("all"), new InjectionValue("all"));

InjectionScript.Runtime.InjectionApiUO.FindType

執行所示呼叫及狀態更新。

參數: InjectionValue type, InjectionValue color, InjectionValue container

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4718.

public string FindType(InjectionValue type, InjectionValue color, InjectionValue container)

結果: string.

呼叫:

  • FindType

內部實作程式碼,不能作為獨立腳本執行。

public string FindType(InjectionValue type, InjectionValue color, InjectionValue container)

            => FindType(type, color, container, new InjectionValue(-1));

InjectionScript.Runtime.InjectionApiUO.FindType

執行所示呼叫及狀態更新。

參數: int type

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4704.

public string FindType(int type)

結果: string.

呼叫:

  • FindType

內部實作程式碼,不能作為獨立腳本執行。

public string FindType(int type)

            => FindType(type, -1, -1);

InjectionScript.Runtime.InjectionApiUO.GetDistance

執行所示呼叫及狀態更新。

參數: int x1, int y1, int x2, int y2

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3692.

public int GetDistance(int x1, int y1, int x2, int y2)

結果: int.

呼叫:

  • Math.Abs
  • Math.Max

內部實作程式碼,不能作為獨立腳本執行。

public int GetDistance(int x1, int y1, int x2, int y2)

        {

            int dx = Math.Abs(x1 - x2);

            int dy = Math.Abs(y1 - y2);



            return Math.Max(dx, dy);

        }

InjectionScript.Runtime.InjectionApiUO.GetGump

執行所示呼叫及狀態更新。

參數: string identifier

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3363.

public InjectionValue GetGump(string identifier)

結果: InjectionValue.

呼叫:

  • LastGump

內部實作程式碼,不能作為獨立腳本執行。

public InjectionValue GetGump(string identifier) => LastGump(identifier, -1);

InjectionScript.Runtime.InjectionApiUO.GetStatus

執行所示呼叫及狀態更新。

參數: string id

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4044.

public void GetStatus(string id)

結果: void.

呼叫:

  • GetStatus
  • GetObject

內部實作程式碼,不能作為獨立腳本執行。

public void GetStatus(string id) => GetStatus(GetObject(id));

InjectionScript.Runtime.InjectionApiUO.JournalColor

執行所示呼叫及狀態更新。

參數: int index

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5530.

public string JournalColor(int index)

結果: string.

呼叫:

  • bridge.JournalColor

內部實作程式碼,不能作為獨立腳本執行。

public string JournalColor(int index) => bridge.JournalColor(index);

InjectionScript.Runtime.InjectionApiUO.MoveItem

執行所示呼叫及狀態更新。

參數: InjectionValue id

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4590.

public int MoveItem(InjectionValue id)

結果: int.

呼叫:

  • CompactMoveItem

內部實作程式碼,不能作為獨立腳本執行。

public int MoveItem(InjectionValue id)

            => CompactMoveItem(new[] { id });

InjectionScript.Runtime.InjectionApiUO.MoveItem

執行所示呼叫及狀態更新。

參數: InjectionValue id, InjectionValue amount, InjectionValue targetContainer

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4594.

public int MoveItem(InjectionValue id, InjectionValue amount, InjectionValue targetContainer)

結果: int.

呼叫:

  • CompactMoveItem

內部實作程式碼,不能作為獨立腳本執行。

public int MoveItem(InjectionValue id, InjectionValue amount, InjectionValue targetContainer)

            => CompactMoveItem(new[] { id, amount, targetContainer });

InjectionScript.Runtime.InjectionApiUO.ParseTypeMask::ResolveEntry

依照程式碼所示的規則解析或查找參數值。

參數: entry

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5060.

InjectionValue ResolveEntry(InjectionValue entry)

結果: InjectionValue.

結果: entry; new InjectionValue(string.Join("|", parts)).

呼叫: (entry.String ?? string.Empty).Split, state.Types.TryGet, graphic.ToString, string.Join.

條件: entry.Kind != InjectionValueKind.String; state.Types.TryGet(parts[i], out int graphic).

內部實作程式碼,不能作為獨立腳本執行。

InjectionValue ResolveEntry(InjectionValue entry)

            {

                if (entry.Kind != InjectionValueKind.String) return entry;

                string[] parts = (entry.String ?? string.Empty).Split('|');

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

                    if (state.Types.TryGet(parts[i], out int graphic))

                        parts[i] = graphic.ToString(CultureInfo.InvariantCulture);

                return new InjectionValue(string.Join("|", parts));

            }

InjectionScript.Runtime.InjectionApiUO.Press

執行所示呼叫及狀態更新。

參數: int key

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:5391.

public void Press(int key)

結果: void.

呼叫:

  • KeyPress

內部實作程式碼,不能作為獨立腳本執行。

public void Press(int key) => KeyPress(key);

InjectionScript.Runtime.InjectionApiUO.SendGumpSelect

執行所示呼叫及狀態更新。

參數: InjectionValue gumpIndex, InjectionValue triggerId

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3349.

public int SendGumpSelect(InjectionValue gumpIndex, InjectionValue triggerId)

結果: int.

呼叫:

  • bridge.SendGumpSelect
  • NumberConversions.ToInt

內部實作程式碼,不能作為獨立腳本執行。

public int SendGumpSelect(InjectionValue gumpIndex, InjectionValue triggerId)

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

InjectionScript.Runtime.InjectionApiUO.SetReceivingContainer

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4467.

public void SetReceivingContainer()

結果: void.

呼叫:

  • UnsetReceivingContainer

內部實作程式碼,不能作為獨立腳本執行。

public void SetReceivingContainer() => UnsetReceivingContainer();

InjectionScript.Runtime.InjectionApiUO.TicksSkill

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3488.

public int TicksSkill()

結果: int.

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

public int TicksSkill() => ticksSkill;

InjectionScript.Runtime.InjectionApiUO.TicksUse

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:3487.

public int TicksUse()

結果: int.

呼叫:

—

內部實作程式碼,不能作為獨立腳本執行。

public int TicksUse() => ticksUse;

InjectionScript.Runtime.InjectionApiUO.Track

執行所示呼叫及狀態更新。

參數: InjectionValue flagRaw, InjectionValue x, InjectionValue y

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:6108.

public void Track(InjectionValue flagRaw, InjectionValue x, InjectionValue y)

結果: void.

呼叫:

  • Track
  • NumberConversions.ToInt

內部實作程式碼,不能作為獨立腳本執行。

public void Track(InjectionValue flagRaw, InjectionValue x, InjectionValue y)

            => Track(NumberConversions.ToInt(flagRaw), NumberConversions.ToInt(x), NumberConversions.ToInt(y));

InjectionScript.Runtime.InjectionApiUO.UseType

執行所示呼叫及狀態更新。

參數: string type, string color

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4089.

public int UseType(string type, string color)

結果: int.

呼叫:

  • UseType
  • ResolveType
  • NumberConversions.ToInt

內部實作程式碼,不能作為獨立腳本執行。

public int UseType(string type, string color) => UseType(ResolveType(type), NumberConversions.ToInt(color));

InjectionScript.Runtime.InjectionApiUO.WaitTargetObjectType

執行所示呼叫及狀態更新。

參數: InjectionValue id, InjectionValue type, InjectionValue color

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4361.

public void WaitTargetObjectType(InjectionValue id, InjectionValue type, InjectionValue color)

結果: void.

條件:

  • first <= 0 || second <= 0

呼叫:

  • GetObject
  • bridge.FindType
  • ResolveType
  • NumberConversions.ToInt
  • SystemMessage
  • bridge.CancelNextTarget
  • bridge.WaitTargetObject

內部實作程式碼,不能作為獨立腳本執行。

public void WaitTargetObjectType(InjectionValue id, InjectionValue type, InjectionValue color)

        {

            int first = GetObject(id);

            int second = bridge.FindType(ResolveType(type), NumberConversions.ToInt(color), 1, -1, false);

            if (first <= 0 || second <= 0)

            {

                SystemMessage("UO.WaitTargetObjectType: object or ground item not found");

                bridge.CancelNextTarget();

                return;

            }

            bridge.WaitTargetObject(first, second);

        }

InjectionScript.Runtime.InjectionApiUO.WaitTargetTile

執行所示呼叫及狀態更新。

參數: InjectionValue selector

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4301.

public void WaitTargetTile(InjectionValue selector)

結果: void.

條件:

  • !name.Equals("lasttile", StringComparison.OrdinalIgnoreCase)
  • tile.Length < 4

呼叫:

  • (selector.String ?? string.Empty).Trim
  • name.Equals
  • bridge.LastTile
  • Array.Empty<int>
  • SystemMessage
  • bridge.CancelNextTarget
  • bridge.WaitTargetTile
  • Timer

內部實作程式碼,不能作為獨立腳本執行。

public void WaitTargetTile(InjectionValue selector)

        {

            string name = selector.Kind == InjectionValueKind.String

                ? (selector.String ?? string.Empty).Trim()

                : string.Empty;

            if (!name.Equals("lasttile", StringComparison.OrdinalIgnoreCase))

                throw new NativeSubrutineException("UO.WaitTargetTile(one argument) accepts only 'lasttile'.");



            int[] tile = bridge.LastTile() ?? Array.Empty<int>();

            if (tile.Length < 4)

            {

                SystemMessage("UO.WaitTargetTile: lasttile is unavailable; next target request canceled.");

                bridge.CancelNextTarget();

                return;

            }

            bridge.WaitTargetTile(tile[0], tile[1], tile[2], tile[3]);

            ticksTarget = Timer();

        }

InjectionScript.Runtime.InjectionApiUO.RegisterCompactSearchApi [FindAnyType]

呼叫時執行已儲存的處理函式 delegate。註冊方法在建立 API 時建立此 delegate。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:4712.

values

結果: values.

結果: new InjectionValue(FindAnyType(values[0], CombineMask(values, 1))).

呼叫: FindAnyType, CombineMask.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetDexterity]

呼叫時執行已儲存的處理函式 delegate。註冊方法在建立 API 時建立此 delegate。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1032.

結果: bridge.Dexterity.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

() => bridge.Dexterity

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetFollowers]

呼叫時執行已儲存的處理函式 delegate。註冊方法在建立 API 時建立此 delegate。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1048.

結果: bridge.Followers.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

() => bridge.Followers

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [ResistPhysical]

呼叫時執行已儲存的處理函式 delegate。註冊方法在建立 API 時建立此 delegate。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1042.

結果: bridge.Armor.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

() => bridge.Armor

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

回傳下列表達式的值。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1007.

結果: getter(bridge.Self).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

() => getter(bridge.Self)

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

回傳下列表達式的值。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1013.

value

結果: value.

結果: getter(GetObject(value)).

呼叫: getter, GetObject.

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

value => getter(GetObject(value))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

回傳下列表達式的值。

參數: 沒有參數。

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApiUO.cs:1007.

結果: getter(bridge.Self).

呼叫:

內部實作程式碼,不能作為獨立腳本執行。

() => getter(bridge.Self)

InjectionScript.Runtime.State.Globals.SetGlobal

執行所示呼叫及狀態更新。

參數: string name, int value

來源: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/State/Globals.cs:43.

public void SetGlobal(string name, int value)

結果: void.

呼叫:

  • SetGlobal
  • value.ToString

內部實作程式碼,不能作為獨立腳本執行。

public void SetGlobal(string name, int value) => SetGlobal(name, value.ToString(CultureInfo.InvariantCulture));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.InspectableGumpsUnsafe

執行所示呼叫及狀態更新。

參數: 沒有參數。

來源: Project_Full/src/ClassicUO.Client/Game/Managers/ClassicUOInjectionApiBridge.cs:4252.

private List<Gump> InspectableGumpsUnsafe()

結果: List<Gump>.

呼叫:

  • `UIManager.Gumps.Where(g => ReferenceEquals(g.World, _world)

              && !g.IsDisposed && g.IsVisible && g is not YokoInfoGump)
    
              .Reverse().Select(g => (Gump)g.SessionState ?? g).Distinct().ToList`
    
  • `UIManager.Gumps.Where(g => ReferenceEquals(g.World, _world)

              && !g.IsDisposed && g.IsVisible && g is not YokoInfoGump)
    
              .Reverse().Select(g => (Gump)g.SessionState ?? g).Distinct`
    
  • `UIManager.Gumps.Where(g => ReferenceEquals(g.World, _world)

              && !g.IsDisposed && g.IsVisible && g is not YokoInfoGump)
    
              .Reverse().Select`
    
  • `UIManager.Gumps.Where(g => ReferenceEquals(g.World, _world)

              && !g.IsDisposed && g.IsVisible && g is not YokoInfoGump)
    
              .Reverse`
    
  • UIManager.Gumps.Where

  • ReferenceEquals

  • ServerGumpsUnsafe().Where(g => !visible.Contains(g)).Concat(visible).ToList

  • ServerGumpsUnsafe().Where(g => !visible.Contains(g)).Concat

  • ServerGumpsUnsafe().Where

  • ServerGumpsUnsafe

  • visible.Contains

內部實作程式碼,不能作為獨立腳本執行。

private List<Gump> InspectableGumpsUnsafe()

        {

            // Inspector windows must not inspect themselves. Use session-owned

            // records for server dialogs and the actual controls for local UI.

            List<Gump> visible = UIManager.Gumps.Where(g => ReferenceEquals(g.World, _world)

                && !g.IsDisposed && g.IsVisible && g is not YokoInfoGump)

                .Reverse().Select(g => (Gump)g.SessionState ?? g).Distinct().ToList();

            return ServerGumpsUnsafe().Where(g => !visible.Contains(g)).Concat(visible).ToList();

        }
⚠️ **GitHub.com Fallback** ⚠️