Skip to content

EN Runtime Helpers 6

Codex edited this page Oct 12, 2026 · 1 revision

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

Helper functions 6

Internal implementation code; this is not a standalone script.

ClassicUO.CSharp.CSharpCallbacks.Remove

Performs the displayed calls and state updates.

Parameters: listener

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

private void Remove(Listener listener)

Result: void.

Calls: listeners.Remove, listener.Source.Dispose.

Conditions: listener.Closed.

Internal implementation code; this is not a standalone script.

private void Remove(Listener listener)
    {
        lock (sync) { if (listener.Closed) return; listener.Closed = true; listeners.Remove(listener); }
        listener.Source.Dispose();
    }

ClassicUO.CSharp.CSharpCallbacks.RemoveState

Performs the displayed calls and state updates.

Parameters: name

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

private void RemoveState(string name)

Result: void.

Calls: stateEvents.Remove, .Dispose.

Internal implementation code; this is not a standalone script.

private void RemoveState(string name)
    {
        StateEvent? state;
        lock (sync) { stateEvents.Remove(name, out state); }
        state?.Subscription?.Dispose();
    }

ClassicUO.CSharp.CSharpExecutionScope.VerifyActive

Performs the displayed calls and state updates.

Parameters: No parameters.

Source: Project_Full/src/ClassicUO.CSharp/CSharpScriptEngine.cs:576.

internal static void VerifyActive()

Result: void.

Calls: .Verify.

Conditions: CurrentFinalization.Value?.IsActive == true.

Internal implementation code; this is not a standalone script.

internal static void VerifyActive()
    {
        Current.Value?.Verify();
        if (CurrentFinalization.Value?.IsActive == true)
            throw new InvalidOperationException("Game API calls are unavailable from a CLR finalizer.");
    }

ClassicUO.Configuration.ProfileManager.EncodePathSegment

Checks the conditions below and returns the displayed result.

Parameters: value

Source: Project_Full/src/ClassicUO.Client/Configuration/ProfileManager.cs:311.

private static string EncodePathSegment(string value)

Result: string.

Result: "UnknownServer"; result.

Calls: string.IsNullOrWhiteSpace, IsWindowsTrimmedSuffix, builder.Append('~').Append, builder.Append, ((int)character).ToString, builder.ToString, result.Split, baseName.Equals.

Conditions: string.IsNullOrWhiteSpace(value); windowsInvalid || windowsTrimmedAtEnd; `baseName.Equals("CON", StringComparison.OrdinalIgnoreCase)

            || baseName.Equals("PRN", StringComparison.OrdinalIgnoreCase)

            || baseName.Equals("AUX", StringComparison.OrdinalIgnoreCase)

            || baseName.Equals("NUL", StringComparison.OrdinalIgnoreCase)

            || baseName.Length == 4

            && (baseName.StartsWith("COM", StringComparison.OrdinalIgnoreCase)

                || baseName.StartsWith("LPT", StringComparison.OrdinalIgnoreCase))

            && baseName[3] is >= '1' and <= '9'`.

Internal implementation code; this is not a standalone script.

private static string EncodePathSegment(string value)

        {

            if (string.IsNullOrWhiteSpace(value))

                return "UnknownServer";



            var builder = new StringBuilder(value.Length);



            for (int index = 0; index < value.Length; index++)

            {

                char character = value[index];

                bool windowsInvalid = character < 32

                                      || character is '<' or '>' or ':' or '"' or '/' or '\\' or '|' or '?' or '*' or '~';

                bool windowsTrimmedAtEnd = (character == '.' || character == ' ')

                                           && IsWindowsTrimmedSuffix(value, index);



                if (windowsInvalid || windowsTrimmedAtEnd)

                    builder.Append('~').Append(((int)character).ToString("X4"));

                else

                    builder.Append(character);

            }



            string result = builder.Length == 0 ? "UnknownServer" : builder.ToString();

            string baseName = result.Split('.')[0];



            if (baseName.Equals("CON", StringComparison.OrdinalIgnoreCase)

                || baseName.Equals("PRN", StringComparison.OrdinalIgnoreCase)

                || baseName.Equals("AUX", StringComparison.OrdinalIgnoreCase)

                || baseName.Equals("NUL", StringComparison.OrdinalIgnoreCase)

                || baseName.Length == 4

                && (baseName.StartsWith("COM", StringComparison.OrdinalIgnoreCase)

                    || baseName.StartsWith("LPT", StringComparison.OrdinalIgnoreCase))

                && baseName[3] is >= '1' and <= '9')

            {

                result = "~005F" + result;

            }



            return result;

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ActivateHandle

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void ActivateHandle()

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void ActivateHandle() => Invoke(() => SDL3.SDL.SDL_RaiseWindow(RequireGameView("ActivateHandle").Window.Handle));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AddChatUserIgnore

Performs the displayed calls and state updates.

Parameters: name

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

public void AddChatUserIgnore(string name)

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void AddChatUserIgnore(string name) => Invoke(() => JournalManager.AddYokoIgnoredUser(name));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.AddMenuHook

Performs the displayed calls and state updates.

Parameters: caption, item, persistent

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

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

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public void AddMenuHook(string caption, string item, bool persistent) => Invoke(() => _manager.AddMenuHook(caption, item, persistent));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CloseClientWindow

Performs the displayed calls and state updates.

Parameters: uiWindowType, id

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

public void CloseClientWindow(int uiWindowType, int id)

Result: void.

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (uiWindowType == 2) _world.CharacterPanels.Profile(unchecked((uint)id))?.Close(true); if (uiWindowType == 0) _world.NativePopups.Close(SessionPopupKind.Paperdoll, unchecked((uint)id)); if (uiWindowType == 3) _world.Containers.Close(unchecked((uint)id)); bool MatchesType(Gump gump) => uiWindowType switch { 0 => gump is PaperDollGump, 1 => gump is StatusGumpBase, 2 => gump is ProfileGump, 3 => gump is ContainerGump, _ => false }; foreach (Gump gump in UIManager.Gumps.Where(gump => !gump.IsDisposed && gump.LocalSerial == unchecked((uint)id) && MatchesType(gump)).ToArray()) gump.Dispose(); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (uiWindowType == 2) _world.CharacterPanels.Profile(unchecked((uint)id))?.Close(true); if (uiWindowType == 0) _world.NativePopups.Close(SessionPopupKind.Paperdoll, unchecked((uint)id)); if (uiWindowType == 3) _world.Containers.Close(unchecked((uint)id)); bool MatchesType(Gump gump) => uiWindowType switch { 0 => gump is PaperDollGump, 1 => gump is StatusGumpBase, 2 => gump is ProfileGump, 3 => gump is ContainerGump, _ => false }; foreach (Gump gump in UIManager.Gumps.Where(gump => !gump.IsDisposed && gump.LocalSerial == unchecked((uint)id) && MatchesType(gump)).ToArray()) gump.Dispose(); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.CloseClientWindow::MatchesType: MatchesType(gump).

Internal implementation code; this is not a standalone script.

public void CloseClientWindow(int uiWindowType, int id) => Invoke(() =>

        {

            if (uiWindowType == 2) _world.CharacterPanels.Profile(unchecked((uint)id))?.Close(true);

            if (uiWindowType == 0) _world.NativePopups.Close(SessionPopupKind.Paperdoll, unchecked((uint)id));

            if (uiWindowType == 3) _world.Containers.Close(unchecked((uint)id));

            bool MatchesType(Gump gump) => uiWindowType switch

            {

                0 => gump is PaperDollGump,

                1 => gump is StatusGumpBase,

                2 => gump is ProfileGump,

                3 => gump is ContainerGump,

                _ => false

            };



            foreach (Gump gump in UIManager.Gumps.Where(gump => !gump.IsDisposed

                         && gump.LocalSerial == unchecked((uint)id) && MatchesType(gump)).ToArray())

                gump.Dispose();

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ConfirmTrade

Returns the value of the expression below.

Parameters: tradeNumber

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

public int ConfirmTrade(int tradeNumber)

Result: int.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

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

        {

            ISessionTrade gump = FindNumberedTrade(tradeNumber);

            if (gump == null) return 0;

            if (!gump.ImAccepting)

            {

                gump.ImAccepting = true;

                GameActions.AcceptTrade(gump.ID1, true);

            }

            return 1;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ContainerOf

Returns the value of the expression below.

Parameters: id

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

public int ContainerOf(int id)

Result: int.

Result: Invoke(() => _world.Items.Get((uint)id) is Item item ? (int)item.Container : 0).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int ContainerOf(int id) => Invoke(() => _world.Items.Get((uint)id) is Item item ? (int)item.Container : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.DescribeControl

Checks the conditions below and returns the displayed result.

Parameters: control

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

private static string DescribeControl(Control control)

Result: string.

Result: logical.Describe(); string.IsNullOrWhiteSpace(text) ? common : common + $" text={text}".

Calls: logical.Describe, control.GetType, GetControlText, string.IsNullOrWhiteSpace.

Conditions: control is SessionGumpControl logical; control is Button button; control is Checkbox checkbox.

Calls:

Internal implementation code; this is not a standalone script.

private static string DescribeControl(Control control)

        {

            if (control is SessionGumpControl logical) return logical.Describe();

            string common = $"{control.GetType().Name} page={control.Page} id=0x{control.LocalSerial:X8} "

                + $"x={control.X} y={control.Y} width={control.Width} height={control.Height}";



            if (control is Button button)

            {

                return common + $" ButtonID={button.ButtonID} action={button.ButtonAction} toPage={button.ToPage} "

                    + $"normal=0x{button.ButtonGraphicNormal:X4} pressed=0x{button.ButtonGraphicPressed:X4} over=0x{button.ButtonGraphicOver:X4}";

            }



            if (control is Checkbox checkbox)

            {

                string kind = checkbox is RadioButton ? "RadioButton" : "Checkbox";

                return $"{kind} page={control.Page} ID={control.LocalSerial} x={control.X} y={control.Y} "

                    + $"checked={checkbox.IsChecked} inactive=0x{checkbox.InactiveGraphic:X4} active=0x{checkbox.ActiveGraphic:X4}";

            }



            string text = GetControlText(control);

            return string.IsNullOrWhiteSpace(text) ? common : common + $" text={text}";

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Exec

Performs the displayed calls and state updates.

Parameters: subrutineName

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

public void Exec(string subrutineName)

Result: void.

Calls: _manager.RunNamedProcedureFromScript.

Internal implementation code; this is not a standalone script.

public void Exec(string subrutineName)

        {

            _manager.RunNamedProcedureFromScript(subrutineName, _csharpGlobals?.Cancellation ?? _cancellationToken);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetDropDelay

Returns the value of the expression below.

Parameters: No parameters.

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

public int GetDropDelay()

Result: int.

Result: State.GrabDelay.

Internal implementation code; this is not a standalone script.

public int GetDropDelay() => State.GrabDelay;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetFlags

Returns the value of the expression below.

Parameters: id

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

public int GetFlags(int id)

Result: int.

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

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetFlags(int id) => Invoke(() => _world.Get((uint)id) is Entity entity ? (int)entity.Flags : 0);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetGumpCount

Returns the value of the expression below.

Parameters: No parameters.

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

public int GetGumpCount()

Result: int.

Result: Invoke(() => ServerGumpsUnsafe().Count).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetGumpCount() => Invoke(() => ServerGumpsUnsafe().Count);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetGumpSerial

Returns the value of the expression below.

Parameters: index

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

public int GetGumpSerial(int index)

Result: int.

Result: Invoke(() => (int)(ServerGumpsUnsafe().ElementAtOrDefault(index)?.LocalSerial ?? 0)).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int GetGumpSerial(int index) => Invoke(() => (int)(ServerGumpsUnsafe().ElementAtOrDefault(index)?.LocalSerial ?? 0));

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetScriptPath

Returns the value of the expression below.

Parameters: index

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

public string GetScriptPath(int index)

Result: string.

Result: _manager.GetScriptPath(index).

Calls: _manager.GetScriptPath.

Calls:

Internal implementation code; this is not a standalone script.

public string GetScriptPath(int index) => _manager.GetScriptPath(index);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetStaticArt::Write16

Performs the displayed calls and state updates.

Parameters: buffer, offset, value

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

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

Result: void.

Internal implementation code; this is not a standalone script.

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

            {

                buffer[offset] = (byte)value;

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

            }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetWaitTargetQueue

Returns the value of the expression below.

Parameters: No parameters.

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

public int[] GetWaitTargetQueue()

Result: int[].

Result: _manager.GetPendingTargetSerials().

Calls: _manager.GetPendingTargetSerials.

Calls:

Internal implementation code; this is not a standalone script.

public int[] GetWaitTargetQueue() => _manager.GetPendingTargetSerials();

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.JournalEntryCount

Returns the value of the expression below.

Parameters: No parameters.

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

public int JournalEntryCount()

Result: int.

Result: Invoke(() => JournalManager.Entries.Count).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int JournalEntryCount() => Invoke(() => JournalManager.Entries.Count);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.JournalMatchCount

Returns the value of the expression below.

Parameters: No parameters.

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

public int JournalMatchCount()

Result: int.

Result: _journalMatchCount.

Internal implementation code; this is not a standalone script.

public int JournalMatchCount() => _journalMatchCount;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget

Returns the value of the expression below.

Parameters: No parameters.

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

public int LastTarget

Result: int.

Result: Invoke(() => (int)_world.TargetManager.LastTargetInfo.Serial).

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

public int LastTarget => Invoke(() => (int)_world.TargetManager.LastTargetInfo.Serial);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTile

Returns the value of the expression below.

Parameters: No parameters.

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

public int[] LastTile()

Result: int[].

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { LastTargetInfo info = _world.TargetManager.LastTargetInfo; return new[] { (int)info.Graphic, (int)info.X, (int)info.Y, (int)info.Z }; }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { LastTargetInfo info = _world.TargetManager.LastTargetInfo; return new[] { (int)info.Graphic, (int)info.X, (int)info.Y, (int)info.Z }; }). Overload candidates: the source does not establish which candidate is selected.

Internal implementation code; this is not a standalone script.

public int[] LastTile() => Invoke(() =>

        {

            LastTargetInfo info = _world.TargetManager.LastTargetInfo;

            return new[] { (int)info.Graphic, (int)info.X, (int)info.Y, (int)info.Z };

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.MoveTo

Returns the value of the expression below.

Parameters: x, y, z, accuracy, running, staminaThreshold, openDoor, throughCorner, throughNpcs, heuristicMultiplier, turnCost, exitOnDisconnect, accuracyZ, optimized, betweenTwoCorners

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

`public int MoveTo(int x, int y, int z, int accuracy, bool running, int staminaThreshold,

        bool openDoor, bool throughCorner, bool throughNpcs, int heuristicMultiplier,

        int turnCost, bool exitOnDisconnect, int accuracyZ = 255, bool optimized = true,

        bool betweenTwoCorners = false)`

Result: int.

Calls: Invoke.

Internal implementation code; this is not a standalone script.

public int MoveTo(int x, int y, int z, int accuracy, bool running, int staminaThreshold,

            bool openDoor, bool throughCorner, bool throughNpcs, int heuristicMultiplier,

            int turnCost, bool exitOnDisconnect, int accuracyZ = 255, bool optimized = true,

            bool betweenTwoCorners = false) => Invoke(() =>

        {

            if (_world.Player == null) return 0;

            _manager.StopFollowing();

            Pathfinder pathfinder = _world.Player.Pathfinder;

            bool started = pathfinder.WalkTo(

                x,

                y,

                z,

                Math.Clamp(accuracy, 0, 20),

                running,

                Math.Max(0, staminaThreshold),

                openDoor,

                throughCorner,

                throughNpcs,

                Math.Max(1, heuristicMultiplier),

                Math.Max(0, turnCost),

                exitOnDisconnect,

                Math.Clamp(accuracyZ, 0, 255),

                optimized,

                betweenTwoCorners,

                ScriptPathObstacles.Create(_csharpState, this), incremental: true);

            if (started)

            {

                _lastMovementPathfinder = pathfinder;

                _lastMovementPlayer = _world.Player;

                _lastMovementMap = _world.Map;

                _lastMovementMapIndex = _world.MapIndex;

                Interlocked.Exchange(ref _lastMovementRequestId, pathfinder.AutoWalkRequestGeneration);

                _pathCancellation.Unregister();

                long generation = pathfinder.AutoWalkGeneration;

                if (pathfinder.AutoWalking)

                    _pathCancellation = _cancellationToken.Register(() => _manager.ReleaseScriptMovement(pathfinder, generation));

            }

            return started ? 1 : 0;

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ReceiveObjectName

Performs the displayed calls and state updates.

Parameters: id, delay

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

public void ReceiveObjectName(int id, int delay)

Result: void.

Calls: Click, Stopwatch.StartNew, Math.Max, string.IsNullOrEmpty, GetName, Wait, Math.Min.

Calls:

Internal implementation code; this is not a standalone script.

public void ReceiveObjectName(int id, int delay)

        {

            Click(id);

            var elapsed = Stopwatch.StartNew();

            while (elapsed.ElapsedMilliseconds < Math.Max(0, delay) && string.IsNullOrEmpty(GetName(id)))

                Wait((int)Math.Min(25, Math.Max(1L, delay - elapsed.ElapsedMilliseconds)));

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.RequestVirtuesGump

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void RequestVirtuesGump()

Result: void.

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player != null) GameActions.ReplyGump(_world.Player, 0x000001CD, 0x00000001, new[] { _world.Player.Serial }, Array.Empty<Tuple<ushort, string>>()); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player != null) GameActions.ReplyGump(_world.Player, 0x000001CD, 0x00000001, new[] { _world.Player.Serial }, Array.Empty<Tuple<ushort, string>>()); }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.GameActions.ReplyGump: GameActions.ReplyGump(_world.Player, 0x000001CD, 0x00000001, new[] { _world.Player.Serial }, Array.Empty<Tuple<ushort, string>>()).

Internal implementation code; this is not a standalone script.

public void RequestVirtuesGump() => Invoke(() =>

        {

            if (_world.Player != null)

                GameActions.ReplyGump(_world.Player, 0x000001CD, 0x00000001, new[] { _world.Player.Serial }, Array.Empty<Tuple<ushort, string>>());

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ResolveGumpUnsafe

Parses or resolves the argument using the rules shown in the code.

Parameters: gumpId

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

private Gump ResolveGumpUnsafe(int gumpId)

Result: Gump.

Result: _selectedServerGump != null && !_selectedServerGump.IsDisposed ? _selectedServerGump : gumps.LastOrDefault().

Calls: ServerGumpsUnsafe, gumps.LastOrDefault, gumps.FirstOrDefault.

Conditions: gumpId == -1.

Calls:

Internal implementation code; this is not a standalone script.

private Gump ResolveGumpUnsafe(int gumpId)

        {

            List<Gump> gumps = ServerGumpsUnsafe();

            if (gumpId == -1)

            {

                return _selectedServerGump != null && !_selectedServerGump.IsDisposed ? _selectedServerGump : gumps.LastOrDefault();

            }

            return gumps.FirstOrDefault(g => g.LocalSerial == (uint)gumpId || g.ServerSerial == (uint)gumpId)

                ?? (gumpId >= 0 && gumpId < gumps.Count ? gumps[gumpId] : null);

        }

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SelectContainer

Returns the value of the expression below.

Parameters: No parameters.

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

public int SelectContainer()

Result: int.

Result: SelectObject() is Item item ? (int)item.Serial : 0.

Calls: SelectObject.

Calls:

Internal implementation code; this is not a standalone script.

public int SelectContainer() => SelectObject() is Item item ? (int)item.Serial : 0;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.SendServerSpeech

Performs the displayed calls and state updates.

Parameters: command, message

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

private void SendServerSpeech(string command, string message)

Result: void.

Calls: Invoke.

Calls:

Internal implementation code; this is not a standalone script.

private void SendServerSpeech(string command, string message) => Invoke(() =>

        {

            GameActions.Say(message ?? string.Empty, allowYokoCommand: SCRIPT_SAY_ALLOW_YOKO_COMMAND);

            ReportStatus($"{command} delivered through ClassicUO server speech");

        });

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.StartScript

Returns the value of the expression below.

Parameters: path

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

public int StartScript(string path)

Result: int.

Result: _manager.StartScript(path).

Calls: _manager.StartScript.

Calls:

Internal implementation code; this is not a standalone script.

public int StartScript(string path) => _manager.StartScript(path);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ToClassicUOCastIndex

Returns the value of the expression below.

Parameters: spellId

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

internal static int ToClassicUOCastIndex(int spellId)

Result: int.

Result: spellId.

Internal implementation code; this is not a standalone script.

internal static int ToClassicUOCastIndex(int spellId) => spellId;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TryMoveItemRequest

Returns the value of the expression below.

Parameters: id, amount, destination, x, y, z

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

private bool TryMoveItemRequest(int id, int amount, int destination, int x, int y, int z)

Result: bool.

Result: TryMoveItemRequest(_world, id, amount, destination, x, y, z).

Calls: TryMoveItemRequest.

Internal implementation code; this is not a standalone script.

private bool TryMoveItemRequest(int id, int amount, int destination, int x, int y, int z)

            => TryMoveItemRequest(_world, id, amount, destination, x, y, z);

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.UseAbility

Returns the value of the expression below.

Parameters: abilityId

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

public int UseAbility(int abilityId)

Result: int.

Calls: Invoke.

Calls:

  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player == null || abilityId < 1 || abilityId > AbilityData.Abilities.Length) return 0; int primary = (byte)_world.Player.Abilities[0] & 0x7F; int secondary = (byte)_world.Player.Abilities[1] & 0x7F; if (abilityId == primary) { GameActions.UsePrimaryAbility(_world); return 1; } if (abilityId == secondary) { GameActions.UseSecondaryAbility(_world); return 1; } return 0; }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.Invoke: Invoke(() => { if (_world.Player == null || abilityId < 1 || abilityId > AbilityData.Abilities.Length) return 0; int primary = (byte)_world.Player.Abilities[0] & 0x7F; int secondary = (byte)_world.Player.Abilities[1] & 0x7F; if (abilityId == primary) { GameActions.UsePrimaryAbility(_world); return 1; } if (abilityId == secondary) { GameActions.UseSecondaryAbility(_world); return 1; } return 0; }). Overload candidates: the source does not establish which candidate is selected.
  • ClassicUO.Game.GameActions.UsePrimaryAbility: GameActions.UsePrimaryAbility(_world).
  • ClassicUO.Game.GameActions.UseSecondaryAbility: GameActions.UseSecondaryAbility(_world).

Internal implementation code; this is not a standalone script.

public int UseAbility(int abilityId) => Invoke(() =>

        {

            if (_world.Player == null || abilityId < 1 || abilityId > AbilityData.Abilities.Length)

                return 0;



            int primary = (byte)_world.Player.Abilities[0] & 0x7F;

            int secondary = (byte)_world.Player.Abilities[1] & 0x7F;

            if (abilityId == primary)

            {

                GameActions.UsePrimaryAbility(_world);

                return 1;

            }

            if (abilityId == secondary)

            {

                GameActions.UseSecondaryAbility(_world);

                return 1;

            }

            return 0;

        });

ClassicUO.Game.Managers.YokoIdeToolBuffers.AppendOutput

Performs the displayed calls and state updates.

Parameters: scriptKey, text

Source: Project_Full/src/ClassicUO.Client/Game/Managers/YokoIdeToolBuffers.cs:124.

internal void AppendOutput(string scriptKey, string text)

Result: void.

Calls: _output.Add, _clock, NormalizeKey, NormalizeText, TrimOldest.

Internal implementation code; this is not a standalone script.

internal void AppendOutput(string scriptKey, string text)
        {
            lock (_sync)
            {
                _output.Add(new YokoOutputEntry
                {
                    Sequence = ++_sequence,
                    Timestamp = _clock(),
                    ScriptKey = NormalizeKey(scriptKey),
                    Text = NormalizeText(text)
                });
                TrimOldest(_output);
                _revision++;
            }
        }

ClassicUO.Game.Managers.YokoInjectionManager.InvokeOnGameThread

Dispatches work to the game thread and observes cancellation.

Parameters: callback, cancellationToken

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

internal void InvokeOnGameThread(Action callback, CancellationToken cancellationToken)

Result: void.

Calls: InvokeOnGameThread.

Internal implementation code; this is not a standalone script.

internal void InvokeOnGameThread(Action callback, CancellationToken cancellationToken)
        {
            InvokeOnGameThread(() =>
            {
                callback();
                return true;
            }, cancellationToken);
        }

ClassicUO.Game.Managers.YokoInjectionManager.PauseResumeScript

Performs the displayed calls and state updates.

Parameters: index

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

internal void PauseResumeScript(int index)

Result: void.

Calls: ElementAt, RunningScripts, script.ToggleManualPause, MarkRuntimeStateChanged.

Conditions: script == null.

Calls:

Internal implementation code; this is not a standalone script.

internal void PauseResumeScript(int index)
        {
            YokoRunningScript script = ElementAt(RunningScripts(), index);
            if (script == null)
                return;

            script.ToggleManualPause();
            MarkRuntimeStateChanged();
        }

ClassicUO.Game.Managers.YokoInjectionManager.SetStatus

Performs the displayed calls and state updates.

Parameters: text, scriptKey

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

internal void SetStatus(string text, string scriptKey = null)

Result: void.

Calls: IsScriptPublicationCurrent, Volatile.Write, PublishStatus.

Conditions: !IsScriptPublicationCurrent(scriptKey).

Internal implementation code; this is not a standalone script.

internal void SetStatus(string text, string scriptKey = null)
        {
            if (!IsScriptPublicationCurrent(scriptKey))
                return;
            Volatile.Write(ref _statusPriority, 1);
            PublishStatus(text, scriptKey);
        }

ClassicUO.Game.SerialHelper.IsMobile

Returns the value of the expression below.

Parameters: serial

Source: Project_Full/src/ClassicUO.Client/Game/SerialHelper.cs:16.

public static bool IsMobile(uint serial)

Result: bool.

Result: serial > 0 && serial < 0x40000000.

Internal implementation code; this is not a standalone script.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static bool IsMobile(uint serial)
        {
            return serial > 0 && serial < 0x40000000;
        }

ClassicUO.Game.World.ChangeSeason

Performs the displayed calls and state updates.

Parameters: season, music

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

public void ChangeSeason(Season season, int music)

Result: void.

Calls: Map.GetUsedChunks, .GetHeadObject, obj.UpdateGraphicBySeason, .GetCurrentMusic, audio.PlayMusic.

Conditions: audio != null && (currentMusic == null || currentMusic.Index == audio.LoginMusicIndex).

Calls:

Internal implementation code; this is not a standalone script.

public void ChangeSeason(Season season, int music)

        {

            Season = season;



            foreach (Chunk chunk in Map.GetUsedChunks())

            {

                for (int x = 0; x < 8; x++)

                {

                    for (int y = 0; y < 8; y++)

                    {

                        for (GameObject obj = chunk?.GetHeadObject(x, y); obj != null; obj = obj.TNext)

                        {

                            obj.UpdateGraphicBySeason();

                        }

                    }

                }

            }



            //TODO(deccer): refactor this out into _audioPlayer.PlayMusic(...)

            var audio = Client.Game?.Audio;

            UOMusic currentMusic = audio?.GetCurrentMusic();

            if (audio != null && (currentMusic == null || currentMusic.Index == audio.LoginMusicIndex))

            {

                audio.PlayMusic(music, false);

            }

        }

InjectionScript.Runtime.InjectionApi.GetWord

Returns the value of the expression below.

Parameters: value, wordIndex

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApi.cs:41.

private static string GetWord(string value,int wordIndex)

Result: string.

Result: GetWord(value,wordIndex," ").

Calls: GetWord.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApi.SplitWords

Returns the value of the expression below.

Parameters: value, delimiter

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionApi.cs:36.

private static string[] SplitWords(string value,string delimiter)

Result: string[].

Result: string.IsNullOrEmpty(delimiter)||delimiter==" "?value.Split((char[])null,StringSplitOptions.RemoveEmptyEntries):value.Split(new[]{delimiter},StringSplitOptions.RemoveEmptyEntries).

Calls: string.IsNullOrEmpty, value.Split.

Internal implementation code; this is not a standalone script.

private static string[] SplitWords(string value,string delimiter)
        {
            value=value??string.Empty;
            return string.IsNullOrEmpty(delimiter)||delimiter==" "?value.Split((char[])null,StringSplitOptions.RemoveEmptyEntries):value.Split(new[]{delimiter},StringSplitOptions.RemoveEmptyEntries);
        }

InjectionScript.Runtime.InjectionApiUO.CalculateDirection

Checks the conditions below and returns the displayed result.

Parameters: fromX, fromY, toX, toY

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

private static int CalculateDirection(int fromX, int fromY, int toX, int toY)

Result: int.

Result: 100; dy < 0 ? 0 : 4; dx > 0 ? 2 : 6; dy < 0 ? 1 : 3; dy > 0 ? 5 : 7.

Calls: Math.Sign.

Conditions: dx == 0 && dy == 0; dx == 0; dy == 0; dx > 0.

Internal implementation code; this is not a standalone script.

private static int CalculateDirection(int fromX, int fromY, int toX, int toY)

        {

            int dx = Math.Sign(toX - fromX);

            int dy = Math.Sign(toY - fromY);

            if (dx == 0 && dy == 0) return 100;

            if (dx == 0) return dy < 0 ? 0 : 4;

            if (dy == 0) return dx > 0 ? 2 : 6;

            if (dx > 0) return dy < 0 ? 1 : 3;

            return dy > 0 ? 5 : 7;

        }

InjectionScript.Runtime.InjectionApiUO.CompactAttackNearest

Checks the conditions below and returns the displayed result.

Parameters: values

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

private int CompactAttackNearest(InjectionValue[] values)

Result: int.

Result: 0; serial.

Calls: ResolveCompactDistance, bridge.GetFindDistance, ResolveCompactMaxZ, bridge.GetFindVertical, ToBoolean, NumberConversions.ToInt, TryResolveClassRules, FilterMobiles.

Conditions: !TryResolveClassRules(classMask, out EquipmentClassRule[] rules); serial != 0.

Calls:

Internal implementation code; this is not a standalone script.

private int CompactAttackNearest(InjectionValue[] values)

        {

            InjectionValue notoriety = values[0];

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

            InjectionValue body = values.Length > 2 ? values[2] : InjectionValue.MinusOne;

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

            bool nearest = values.Length <= 4 || ToBoolean(values[4]);

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

            InjectionValue classMask = values.Length > 6 ? values[6] : default(InjectionValue);

            bool aliveOnly = values.Length > 7 && ToBoolean(values[7]);

            bool visibleOnly = values.Length > 8 && ToBoolean(values[8]);



            // Resolve once, before any attack. A misspelled/undefined class must

            // never degrade into an unrestricted search or a name substring match.

            if (!TryResolveClassRules(classMask, out EquipmentClassRule[] rules))

                return 0;

            IEnumerable<int> mobiles = FilterMobiles(distance, notoriety, body, maxZ, color, false,

                false, aliveOnly, visibleOnly);

            int serial = SelectClassCandidate(mobiles, rules, nearest);

            if (serial != 0)

                bridge.Attack(serial);

            return serial;

        }

InjectionScript.Runtime.InjectionApiUO.CompactWaitGump

Checks the conditions below and returns the displayed result.

Parameters: values

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

private int CompactWaitGump(InjectionValue[] values)

Result: int.

Result: 1; 0.

Calls: CollectGumpButtons, automation.QueueGumpButtons, buttons.ToArray, CompactWaitGump, (value.String ?? string.Empty).Contains, `(value.String ?? string.Empty)

                    .Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries)

                    .Select(part => new InjectionValue(part.Trim())).ToArray`, `(value.String ?? string.Empty)

                    .Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries)

                    .Select`, `(value.String ?? string.Empty)

                    .Split`.

Conditions: values == null || values.Length == 0; bridge is IApiGumpAutomation automation; value.Kind == InjectionValueKind.Array; CompactWaitGump(value.Array) == 0.

Calls:

Internal implementation code; this is not a standalone script.

private int CompactWaitGump(InjectionValue[] values)

        {

            if (values == null || values.Length == 0)

                throw new NativeSubrutineException("UO.WaitGump requires at least one trigger/button id.");



            if (bridge is IApiGumpAutomation automation)

            {

                var buttons = new List<int>();

                CollectGumpButtons(values, buttons);

                automation.QueueGumpButtons(buttons.ToArray());

                return 1;

            }



            foreach (InjectionValue value in values)

            {

                if (value.Kind == InjectionValueKind.Array)

                {

                    if (CompactWaitGump(value.Array) == 0)

                        return 0;

                    continue;

                }



                if (value.Kind == InjectionValueKind.String

                    && ((value.String ?? string.Empty).Contains('|') || (value.String ?? string.Empty).Contains(',')))

                {

                    InjectionValue[] nested = (value.String ?? string.Empty)

                        .Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries)

                        .Select(part => new InjectionValue(part.Trim())).ToArray();

                    if (CompactWaitGump(nested) == 0)

                        return 0;

                    continue;

                }



                int triggerId = NumberConversions.ToInt(value);

                if (bridge.WaitGumpSelect(triggerId, 30_000) == 0)

                    return 0;

            }

            return 1;

        }

InjectionScript.Runtime.InjectionApiUO.ConvertLayer

Checks the conditions below and returns the displayed result.

Parameters: layer

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

private int ConvertLayer(string layer)

Result: int.

Result: value.

Calls: layerNameToNumber.TryGetValue, (layer ?? string.Empty).Trim.

Conditions: layerNameToNumber.TryGetValue((layer ?? string.Empty).Trim(), out int value).

Internal implementation code; this is not a standalone script.

private int ConvertLayer(string layer)

        {

            if (layerNameToNumber.TryGetValue((layer ?? string.Empty).Trim(), out int value))

                return value;

            throw new NativeSubrutineException($"Unknown equipment layer '{layer}'. Use a documented layer such as Rhand, Lhand, Helmet, Necklace, Backpack, Robe, Legs, or Mount.");

        }

InjectionScript.Runtime.InjectionApiUO.ConvertMoveDestination

Checks the conditions below and returns the displayed result.

Parameters: containerId

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

private int ConvertMoveDestination(InjectionValue containerId)

Result: int.

Result: ResolveTransferDestination(backpack ? new InjectionValue("backpack") : containerId, allowGround: true).

Calls: NumberConversions.TryStr2Int, .Trim, ResolveTransferDestination.

Conditions: containerId.Kind != InjectionValueKind.String && containerId.Kind != InjectionValueKind.Integer.

Calls:

Internal implementation code; this is not a standalone script.

private int ConvertMoveDestination(InjectionValue containerId)

        {

            if (containerId.Kind != InjectionValueKind.String && containerId.Kind != InjectionValueKind.Integer)

                throw new NativeSubrutineException("A move destination must be an object name or serial ID.");

            // Preserve the legacy -1 backpack selector. Resolve names before

            // lifting: a misspelled or unset container must never become ground.

            bool backpack = containerId.Kind == InjectionValueKind.Integer

                ? containerId.Integer == -1

                : NumberConversions.TryStr2Int(containerId.String?.Trim() ?? string.Empty, out int literal) && literal == -1;

            return ResolveTransferDestination(backpack ? new InjectionValue("backpack") : containerId, allowGround: true);

        }

InjectionScript.Runtime.InjectionApiUO.Count

Returns the value of the expression below.

Parameters: type

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

public int Count(InjectionValue type)

Result: int.

Result: Count(ResolveType(type), -1, -1).

Calls: Count, ResolveType.

Calls:

Internal implementation code; this is not a standalone script.

public int Count(InjectionValue type) 

            => Count(ResolveType(type), -1, -1);

InjectionScript.Runtime.InjectionApiUO.DeleteJournal

Performs the displayed calls and state updates.

Parameters: text

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

public void DeleteJournal(string text)

Result: void.

Calls: bridge.DeleteJournal, SelectJournalEntry.

Calls:

Internal implementation code; this is not a standalone script.

public void DeleteJournal(string text)

        {

            bridge.DeleteJournal(text);

            SelectJournalEntry(null);

        }

InjectionScript.Runtime.InjectionApiUO.DeleteObject

Performs the displayed calls and state updates.

Parameters: name

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

public void DeleteObject(string name)

Result: void.

Calls: objects.TryGet, objects.Remove, SystemMessage.

Conditions: objects.TryGet(name, out int value).

Calls:

Internal implementation code; this is not a standalone script.

public void DeleteObject(string name)

        {

            if (objects.TryGet(name, out int value))

            {

                objects.Remove(name);

                SystemMessage($"Object {name} has been deleted");

            }

            else

                SystemMessage($"Object {name} not found");

        }

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Text

Returns the value of the expression below.

Parameters: index

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

string Text(int index)

Result: string.

Result: index < arguments.Length ? arguments[index].ToString() : string.Empty.

Calls: arguments[index].ToString.

Calls:

Internal implementation code; this is not a standalone script.

string Text(int index) => index < arguments.Length ? arguments[index].ToString() : string.Empty;

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

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "addtojournal":

                case "addtosystemjournal":

                case "clientprint":

                    SystemMessage(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:1286.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "autobuyex":

                    bridge.SetAutoBuyRule(Arg(0), Arg(1), Arg(2), Arg(3), Text(4)); 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:1550.

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

Calls:

Internal implementation code; this is not a standalone script.

case "canceltrade": return new InjectionValue(bridge.CancelTrade(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:1306.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "connect": bridge.ConnectClient(); 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:1565.

Calls:

Internal implementation code; this is not a standalone script.

case "dist": return new InjectionValue(arguments.Length >= 4

                    ? GetDistance(Arg(0), Arg(1), Arg(2), Arg(3))

                    : bridge.GetDistance(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:1627.

Result: new InjectionValue(ChangeEquipmentItems(ArrayArg(0), true)).

Calls:

Internal implementation code; this is not a standalone script.

case "equipitems":

                    return new InjectionValue(ChangeEquipmentItems(ArrayArg(0), true));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

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

new []

Result: [].

Calls:

Internal implementation code; this is not a standalone script.

case "extendedinfo":

                    return new InjectionValue(new[] { new InjectionValue(bridge.ClientPath), new InjectionValue(bridge.CurrentProfilePath), new InjectionValue(bridge.GameServerAddress), new InjectionValue(bridge.GameServerPort) });

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

Result: new InjectionValue(bridge.FindType(ResolveType(arguments[0]), Arg(1), StealthContainer(2), -1, Arg(3) != 0)).

Calls:

Internal implementation code; this is not a standalone script.

case "findtypeex": return new InjectionValue(bridge.FindType(ResolveType(arguments[0]), Arg(1), StealthContainer(2), -1, Arg(3) != 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:1587.

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

Calls:

Internal implementation code; this is not a standalone script.

case "getactiveability": return new InjectionValue(bridge.GetActiveAbility());

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

Result: StringArray(bridge.GetMenuItems(Text(0), false)).

Calls:

Internal implementation code; this is not a standalone script.

case "getmenuitems": return StringArray(bridge.GetMenuItems(Text(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:1919.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "globalchatsendmsg": bridge.GlobalChatSend(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:1273.

Result: new InjectionValue(InJournal(Text(0))).

Calls:

Internal implementation code; this is not a standalone script.

case "injournal": return new InjectionValue(InJournal(Text(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:2043.

Result: new InjectionValue(selectedJournalEntry?.Color ?? 0).

Internal implementation code; this is not a standalone script.

case "linetextcolor":

                    return new InjectionValue(selectedJournalEntry?.Color ?? 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:1534.

Result: new InjectionValue(ReadPredictedCoordinate(1)).

Calls:

Internal implementation code; this is not a standalone script.

case "predictedy": return new InjectionValue(ReadPredictedCoordinate(1));

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

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

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "requestcontextmenu": bridge.RequestContextMenu(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

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

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "setsilentmode": state.SilentMode = Arg(0) != 0 ? 1 : 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:1655.

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "setwarmode": WarMode(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

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

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

Calls:

Internal implementation code; this is not a standalone script.

case "targetid": return new InjectionValue(bridge.GetTargetCursorId());

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

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "useobject": bridge.UseObject(Arg(0)); return InjectionValue.Unit;

InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility

This branch handles only the specified command name.

Parameters: No parameters.

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

Result: InjectionValue.Unit.

Calls:

Internal implementation code; this is not a standalone script.

case "usesecondaryability": bridge.UseSecondaryAbility(); 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:1642.

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

Calls:

Internal implementation code; this is not a standalone script.

case "waitfortarget": return new InjectionValue(bridge.WaitUntilTargeting(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:1369.

Result: new InjectionValue(bridge.Weight).

Calls:

Internal implementation code; this is not a standalone script.

case "weight": return new InjectionValue(bridge.Weight);

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

Calls:

Internal implementation code; this is not a standalone script.

case "adddir":

                case "addfindlist":

                case "addgate":

                case "addrecall":

                case "addstep":

                    LegacyList(name).Add(string.Join("|", arguments.Select(value => value.ToString())));

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

Calls:

Internal implementation code; this is not a standalone script.

case "cancelmenu": bridge.ClearMenuHooks(); 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:2858.

Conditions: arguments.Length == 0.

Calls:

Internal implementation code; this is not a standalone script.

case "clearfindlist":

                    if (arguments.Length == 0) LegacyList("AddFindList").Clear();

                    else LegacyList("AddFindList").RemoveAll(value => value.Split('|')[0]

                        .Equals(Text(0), StringComparison.OrdinalIgnoreCase));

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

Calls:

Internal implementation code; this is not a standalone script.

case "closeuo": bridge.CloseHandle(); 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:2991.

Conditions: arguments.Length == 0.

Calls:

Internal implementation code; this is not a standalone script.

case "massmove":

                    if (arguments.Length == 0) bridge.MassMove(-1, 0, 0, -1, -1, -1, 0);

                    else bridge.MassMove(NumberConversions.ToInt(arguments[0]),

                        arguments.Length > 1 ? NumberConversions.ToInt(arguments[1]) : 0,

                        arguments.Length > 2 ? ResolveType(arguments[2]) : 0,

                        arguments.Length > 3 ? ResolveTransferDestination(arguments[3], true) : -1,

                        arguments.Length > 4 ? NumberConversions.ToInt(arguments[4]) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : 0);

                    break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

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

Conditions: arguments.Length == 0.

Calls:

Internal implementation code; this is not a standalone script.

case "masspricemove":

                    if (arguments.Length == 0) bridge.MassPriceMove(-1, 0, 0, 0, -1, -1, -1, 0);

                    else bridge.MassPriceMove(NumberConversions.ToInt(arguments[0]),

                        NumberConversions.ToInt(arguments[1]), ResolveType(arguments[2]),

                        NumberConversions.ToInt(arguments[3]),

                        arguments.Length > 4 ? ResolveTransferDestination(arguments[4], true) : -1,

                        arguments.Length > 5 ? NumberConversions.ToInt(arguments[5]) : -1,

                        arguments.Length > 6 ? NumberConversions.ToInt(arguments[6]) : -1,

                        arguments.Length > 7 ? NumberConversions.ToInt(arguments[7]) : 0);

                    break;

InjectionScript.Runtime.InjectionApiUO.ExecuteLegacyManualAlias

This branch handles only the specified command name.

Parameters: No parameters.

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

Calls:

Internal implementation code; this is not a standalone script.

case "resend": bridge.Resync(); break;

InjectionScript.Runtime.InjectionApiUO.Exists

Returns the value of the expression below.

Parameters: id

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

public int Exists(int id)

Result: int.

Result: bridge.Exists(id).

Calls: bridge.Exists.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.GetLandTileAt

Returns the value of the expression below.

Parameters: x, y

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

public InjectionValue GetLandTileAt(InjectionValue x, InjectionValue y)

Result: InjectionValue.

Result: GetLandTileAt(x, y, new InjectionValue(bridge.WorldNumber)).

Calls: GetLandTileAt.

Calls:

Internal implementation code; this is not a standalone script.

public InjectionValue GetLandTileAt(InjectionValue x, InjectionValue y)

            => GetLandTileAt(x, y, new InjectionValue(bridge.WorldNumber));

InjectionScript.Runtime.InjectionApiUO.GetObject

Checks the conditions below and returns the displayed result.

Parameters: name

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

public int GetObject(string name)

Result: int.

Result: 0; id.

Calls: TryGetObject.

Conditions: !TryGetObject(name, out int id).

Calls:

Internal implementation code; this is not a standalone script.

public int GetObject(string name)

        {

            if (!TryGetObject(name, out int id))

                return 0;



            return id;

        }

InjectionScript.Runtime.InjectionApiUO.GetTileName

Returns the value of the expression below.

Parameters: group, tileId

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

public string GetTileName(InjectionValue group, InjectionValue tileId)

Result: string.

Result: bridge.GetTileDataName(NumberConversions.ToInt(group), NumberConversions.ToInt(tileId)).

Calls: bridge.GetTileDataName, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public string GetTileName(InjectionValue group, InjectionValue tileId)

            => bridge.GetTileDataName(NumberConversions.ToInt(group), NumberConversions.ToInt(tileId));

InjectionScript.Runtime.InjectionApiUO.GetUserStatic

Returns the value of the expression below.

Parameters: id

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

public string GetUserStatic(InjectionValue id)

Result: string.

Result: state.UserStatics.TryGetValue(NumberConversions.ToInt(id), out string value) ? value : string.Empty.

Calls: state.UserStatics.TryGetValue, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public string GetUserStatic(InjectionValue id)

            => state.UserStatics.TryGetValue(NumberConversions.ToInt(id), out string value) ? value : string.Empty;

InjectionScript.Runtime.InjectionApiUO.GetY

Returns the value of the expression below.

Parameters: id

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

public int GetY(string id)

Result: int.

Result: GetY(GetObject(id)).

Calls: GetY, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.Hidden

Returns the value of the expression below.

Parameters: No parameters.

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

public int Hidden()

Result: int.

Result: Hidden("self").

Calls: Hidden.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.Ignore

Performs the displayed calls and state updates.

Parameters: id

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

public void Ignore(int id)

Result: void.

Calls: bridge.Ignore.

Calls:

Internal implementation code; this is not a standalone script.

public void Ignore(int id) => bridge.Ignore(id);

InjectionScript.Runtime.InjectionApiUO.InJournal

Returns the value of the expression below.

Parameters: pattern, maxLinesOrIgnoreCase

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

public int InJournal(string pattern, int maxLinesOrIgnoreCase)

Result: int.

Calls: InJournalCore, Math.Max.

Calls:

Internal implementation code; this is not a standalone script.

public int InJournal(string pattern, int maxLinesOrIgnoreCase)

            => InJournalCore(pattern,

                maxLinesOrIgnoreCase == -1 ? -1 : Math.Max(0, maxLinesOrIgnoreCase),

                ignoreCase: maxLinesOrIgnoreCase == -1);

InjectionScript.Runtime.InjectionApiUO.IsHumanBody

Returns the value of the expression below.

Parameters: graphic

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

private static bool IsHumanBody(int graphic)

Result: bool.

Internal implementation code; this is not a standalone script.

private static bool IsHumanBody(int graphic) => graphic == 0x0190 || graphic == 0x0191

            || graphic == 0x0192 || graphic == 0x0193 || graphic == 0x025D || graphic == 0x025E

            || graphic == 0x025F || graphic == 0x0260 || graphic == 0x029A || graphic == 0x029B

            || graphic == 0x02B6 || graphic == 0x02B7;

InjectionScript.Runtime.InjectionApiUO.IsTreeTile

Returns the value of the expression below.

Parameters: x, y

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

public int IsTreeTile(InjectionValue x, InjectionValue y)

Result: int.

Result: bridge.IsTreeTile(NumberConversions.ToInt(x), NumberConversions.ToInt(y)).

Calls: bridge.IsTreeTile, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public int IsTreeTile(InjectionValue x, InjectionValue y) => bridge.IsTreeTile(NumberConversions.ToInt(x), NumberConversions.ToInt(y));

InjectionScript.Runtime.InjectionApiUO.JournalEntryTime

Returns the value of the expression below.

Parameters: index

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

private int JournalEntryTime(int index)

Result: int.

Result: JournalEntryTime(bridge.JournalTimestamp(index)).

Calls: JournalEntryTime, bridge.JournalTimestamp.

Calls:

Internal implementation code; this is not a standalone script.

private int JournalEntryTime(int index)

            => JournalEntryTime(bridge.JournalTimestamp(index));

InjectionScript.Runtime.InjectionApiUO.Morph

Performs the displayed calls and state updates.

Parameters: type

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

public void Morph(int type)

Result: void.

Calls: bridge.Morph, Timer.

Calls:

Internal implementation code; this is not a standalone script.

public void Morph(int type)

        {

            bridge.Morph(type);

            ticksAnim = Timer();

        }

InjectionScript.Runtime.InjectionApiUO.MoveItemChecked

Checks the conditions below and returns the displayed result.

Parameters: id, amount, targetContainer, x, y, z

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

private bool MoveItemChecked(int id, int amount, int targetContainer, int x, int y, int z)

Result: bool.

Result: false; bridge.MoveItem(id, amount, targetContainer, x, y, z) != 0.

Calls: bridge.GetX, bridge.GetY, Math.Max, Math.Abs, SystemMessage, bridge.MoveItem.

Conditions: id == 0; targetContainer == 0 && state.DropCheckCoord != 0; Math.Max(Math.Abs(x - playerX), Math.Abs(y - playerY)) > 2.

Calls:

Internal implementation code; this is not a standalone script.

private bool MoveItemChecked(int id, int amount, int targetContainer, int x, int y, int z)

        {

            if (id == 0)

                return false;

            if (targetContainer == 0 && state.DropCheckCoord != 0)

            {

                int playerX = bridge.GetX(bridge.Self);

                int playerY = bridge.GetY(bridge.Self);

                if (Math.Max(Math.Abs(x - playerX), Math.Abs(y - playerY)) > 2)

                {

                    SystemMessage("Drop cancelled: destination is more than 2 tiles away (DropCheckCoord is enabled).");

                    return false;

                }

            }



            return bridge.MoveItem(id, amount, targetContainer, x, y, z) != 0;

        }

InjectionScript.Runtime.InjectionApiUO.NormalizeApiName

Returns the value of the expression below.

Parameters: name

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

private static string NormalizeApiName(string name)

Result: string.

Result: (name ?? string.Empty).Trim().

Calls: (name ?? string.Empty).Trim.

Internal implementation code; this is not a standalone script.

private static string NormalizeApiName(string name)

        {

            return (name ?? string.Empty).Trim();

        }

InjectionScript.Runtime.InjectionApiUO.RDblClick

Performs the displayed calls and state updates.

Parameters: x, y

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

public void RDblClick(int x, int y)

Result: void.

Calls: bridge.RDblClick.

Calls:

Internal implementation code; this is not a standalone script.

public void RDblClick(int x, int y) => bridge.RDblClick(x, y);

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases::AddText

These functions register the API. They do not run again for every command call.

Parameters: getter, names

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

void AddText(Func<string> getter, params string[] names)

Result: void.

Calls: metadata.NativeSubrutineExists, metadata.Add, metadata.IntrinsicVariableExists, metadata.AddIntrinsicVariable.

Conditions: !metadata.NativeSubrutineExists(name, 0); !metadata.IntrinsicVariableExists(name).

Calls:

Internal implementation code; this is not a standalone script.

void AddText(Func<string> getter, params string[] names)

            {

                foreach (string shortName in names)

                {

                    string name = "UO." + shortName;

                    if (!metadata.NativeSubrutineExists(name, 0))

                        metadata.Add(new NativeSubrutineDefinition(name, getter));

                    if (!metadata.IntrinsicVariableExists(name))

                        metadata.AddIntrinsicVariable(new NativeSubrutineDefinition(name, getter));

                }

            }

InjectionScript.Runtime.InjectionApiUO.ResolveCompactDistance

Parses or resolves the argument using the rules shown in the code.

Parameters: value

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

private int ResolveCompactDistance(InjectionValue value)

Result: int.

Result: parsed < 0 ? bridge.GetFindDistance() : Math.Max(0, parsed).

Calls: NumberConversions.ToInt, bridge.GetFindDistance, Math.Max.

Calls:

Internal implementation code; this is not a standalone script.

private int ResolveCompactDistance(InjectionValue value)

        {

            int parsed = NumberConversions.ToInt(value);

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

        }

InjectionScript.Runtime.InjectionApiUO.SetArm

Performs the displayed calls and state updates.

Parameters: name

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

public void SetArm(string name)

Result: void.

Calls: SetEquip.

Calls:

Internal implementation code; this is not a standalone script.

public void SetArm(string name)

            => SetEquip(name, armSets, weaponLayers, "Arm set.");

InjectionScript.Runtime.InjectionApiUO.SetEvent

Performs the displayed calls and state updates.

Parameters: name, stateValue, repeatOrHandler

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

public void SetEvent(InjectionValue name, InjectionValue stateValue, InjectionValue repeatOrHandler)

Result: void.

Calls: repeatOrHandler.ToString, string.IsNullOrWhiteSpace, NumberConversions.TryStr2Int, SetEvent.

Conditions: !string.IsNullOrWhiteSpace(raw) && !NumberConversions.TryStr2Int(raw, out _).

Calls:

Internal implementation code; this is not a standalone script.

public void SetEvent(InjectionValue name, InjectionValue stateValue, InjectionValue repeatOrHandler)

        {

            string raw = repeatOrHandler.ToString() ?? string.Empty;

            if (!string.IsNullOrWhiteSpace(raw) && !NumberConversions.TryStr2Int(raw, out _))

                SetEvent(name, stateValue, InjectionValue.True, repeatOrHandler);

            else

                SetEvent(name, stateValue, repeatOrHandler, new InjectionValue(string.Empty));

        }

InjectionScript.Runtime.InjectionApiUO.SetJournalLine

Performs the displayed calls and state updates.

Parameters: index

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

public void SetJournalLine(int index)

Result: void.

Calls: bridge.SetJournalLine.

Calls:

Internal implementation code; this is not a standalone script.

public void SetJournalLine(int index) => bridge.SetJournalLine(index);

InjectionScript.Runtime.InjectionApiUO.Terminate

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void Terminate()

Result: void.

Calls: bridge.Terminate.

Calls:

Internal implementation code; this is not a standalone script.

public void Terminate() => bridge.Terminate(string.Empty);

InjectionScript.Runtime.InjectionApiUO.Terminate

Performs the displayed calls and state updates.

Parameters: subrutineName

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

public void Terminate(string subrutineName)

Result: void.

Calls: bridge.Terminate.

Calls:

Internal implementation code; this is not a standalone script.

public void Terminate(string subrutineName) => bridge.Terminate(subrutineName);

InjectionScript.Runtime.InjectionApiUO.TextOpen

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void TextOpen()

Result: void.

Calls: bridge.TextOpen.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.Track

Performs the displayed calls and state updates.

Parameters: flag

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

public void Track(InjectionValue flag)

Result: void.

Calls: Track, NumberConversions.ToInt, GetX, GetY.

Calls:

Internal implementation code; this is not a standalone script.

public void Track(InjectionValue flag) => Track(NumberConversions.ToInt(flag), GetX(), GetY());

InjectionScript.Runtime.InjectionApiUO.TradeCheck

Returns the value of the expression below.

Parameters: windowIndex, checkbox, stateValue

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

public int TradeCheck(InjectionValue windowIndex, InjectionValue checkbox, InjectionValue stateValue)

Result: int.

Result: bridge.TradeCheck(NumberConversions.ToInt(windowIndex), NumberConversions.ToInt(checkbox), NumberConversions.ToInt(stateValue), true).

Calls: bridge.TradeCheck, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

public int TradeCheck(InjectionValue windowIndex, InjectionValue checkbox, InjectionValue stateValue)

            => bridge.TradeCheck(NumberConversions.ToInt(windowIndex), NumberConversions.ToInt(checkbox), NumberConversions.ToInt(stateValue), true);

InjectionScript.Runtime.InjectionApiUO.Unequip

Checks the conditions below and returns the displayed result.

Parameters: supportedLayers, successMessage

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

private int Unequip(int[] supportedLayers, string successMessage)

Result: int.

Result: success ? 1 : 0.

Calls: bridge.ObjAtLayer, bridge.Unequip, injectionApi.Wait, SystemMessage.

Conditions: bridge.ObjAtLayer(layer) != 0; state.DressSpeed > 0.

Calls:

Internal implementation code; this is not a standalone script.

private int Unequip(int[] supportedLayers, string successMessage)

        {

            bool success = true;

            foreach (var layer in supportedLayers)

            {

                if (bridge.ObjAtLayer(layer) != 0)

                {

                    success &= bridge.Unequip(layer) != 0;

                    if (state.DressSpeed > 0)

                        injectionApi.Wait(state.DressSpeed);

                }

            }



            SystemMessage(success ? successMessage : "Some equipment could not be removed.");

            return success ? 1 : 0;

        }

InjectionScript.Runtime.InjectionApiUO.UnsetReceivingContainer

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public void UnsetReceivingContainer()

Result: void.

Calls: bridge.UnsetReceivingContainer.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.UseObject

Performs the displayed calls and state updates.

Parameters: id

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

public void UseObject(string id)

Result: void.

Calls: UseObject, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.UseType

Returns the value of the expression below.

Parameters: type, color

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

public int UseType(int type, int color)

Result: int.

Calls: CompactUseType.

Calls:

Internal implementation code; this is not a standalone script.

public int UseType(int type, int color) => CompactUseType(new[]

        {

            new InjectionValue(type),

            new InjectionValue(color)

        });

InjectionScript.Runtime.InjectionApiUO.WaitingForJournalText

Performs the displayed calls and state updates.

Parameters: startTime, maxDelay, text

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

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

Result: void.

Calls: WaitingForJournalText.

Calls:

Internal implementation code; this is not a standalone script.

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

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

InjectionScript.Runtime.InjectionApiUO.WaitingForMenu

Checks the conditions below and returns the displayed result.

Parameters: delayValue, menuCountValue, blockMenuValue, menuNameValue, skillOrSerial

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

public int WaitingForMenu(InjectionValue delayValue, InjectionValue menuCountValue, InjectionValue blockMenuValue, InjectionValue menuNameValue, InjectionValue skillOrSerial)

Result: int.

Result: 1; 0.

Calls: Math.Max, NumberConversions.ToInt, menuNameValue.ToString, timeSource.Now.AddMilliseconds, TriggerWaitAction, bridge.GetLastMenuIdentity, identity.Equals, bridge.GetLastMenuCaption.

Conditions: identity.Length == 0; !identity.Equals(previousIdentity, StringComparison.Ordinal); observedMenuCount >= requiredMenuCount && nameMatches; blockMenu.

Calls:

Internal implementation code; this is not a standalone script.

public int WaitingForMenu(InjectionValue delayValue, InjectionValue menuCountValue, InjectionValue blockMenuValue, InjectionValue menuNameValue, InjectionValue skillOrSerial)

        {

            int delay = Math.Max(0, NumberConversions.ToInt(delayValue));

            int requiredMenuCount = Math.Max(1, NumberConversions.ToInt(menuCountValue));

            bool blockMenu = NumberConversions.ToInt(blockMenuValue) != 0;

            string expectedName = menuNameValue.ToString() ?? string.Empty;

            DateTime deadline = timeSource.Now.AddMilliseconds(delay);

            string previousIdentity = string.Empty;

            int observedMenuCount = 0;



            TriggerWaitAction(skillOrSerial);



            do

            {

                string identity = bridge.GetLastMenuIdentity() ?? string.Empty;

                if (identity.Length == 0)

                {

                    // Reset between server menus so an identical menu opened again

                    // still counts as a new appearance.

                    previousIdentity = string.Empty;

                }

                else if (!identity.Equals(previousIdentity, StringComparison.Ordinal))

                {

                    previousIdentity = identity;

                    observedMenuCount++;

                    string caption = bridge.GetLastMenuCaption() ?? string.Empty;

                    bool nameMatches = expectedName.Length == 0

                        || caption.Equals(expectedName, StringComparison.Ordinal);

                    if (observedMenuCount >= requiredMenuCount && nameMatches)

                    {

                        if (blockMenu)

                            bridge.CloseMenu();

                        return 1;

                    }

                }



                if (timeSource.Now >= deadline)

                    break;

                bridge.Wait(Math.Min(25, Math.Max(1, delay)));

            }

            while (true);



            return 0;

        }

InjectionScript.Runtime.InjectionApiUO.WaitingMenu

Returns the value of the expression below.

Parameters: No parameters.

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

public int WaitingMenu()

Result: int.

Result: bridge.WaitingMenu().

Calls: bridge.WaitingMenu.

Calls:

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.RegisterCompactSearchApi [FindMan]

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

values

Result: values.

Result: new InjectionValue(CompactFindMan(values)).

Calls: CompactFindMan.

Calls:

Internal implementation code; this is not a standalone script.

values => new InjectionValue(CompactFindMan(values))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetFollowersMax]

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

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

Result: bridge.Intelligence.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Intelligence

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [GetStamina]

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

Result: bridge.Stamina.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Stamina

InjectionScript.Runtime.InjectionApiUO.Register [SkillVal]

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

values

Result: values.

Result: new InjectionValue(SkillVal(values[0].ToString(), NumberConversions.ToInt(values[1]))).

Calls: SkillVal, values[0].ToString, NumberConversions.ToInt.

Calls:

Internal implementation code; this is not a standalone script.

values => new InjectionValue(SkillVal(values[0].ToString(), NumberConversions.ToInt(values[1])))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [Stamina]

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

Result: bridge.Stamina.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Stamina

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases [Strength]

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

Parameters: No parameters.

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

Result: bridge.Strength.

Calls:

Internal implementation code; this is not a standalone script.

() => bridge.Strength

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

Returns the value of the expression below.

Parameters: No parameters.

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

value

Result: value.

Result: getter(GetObject(value)).

Calls: getter, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

value => getter(GetObject(value))

InjectionScript.Runtime.InjectionApiUO.RegisterCharacterGetterAliases

Returns the value of the expression below.

Parameters: No parameters.

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

value

Result: value.

Result: getter(GetObject(value)).

Calls: getter, GetObject.

Calls:

Internal implementation code; this is not a standalone script.

value => getter(GetObject(value))

InjectionScript.Runtime.InjectionRuntime.CallNativeSubrutine

Performs the displayed calls and state updates.

Parameters: name, args

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

private void CallNativeSubrutine(string name, params InjectionValue[] args)

Result: void.

Calls: Checkpoint, Metadata.TryGetNativeSubrutine, nativeSubrutine.Call.

Conditions: !Metadata.TryGetNativeSubrutine("UO." + name, args, out var nativeSubrutine).

Calls:

Internal implementation code; this is not a standalone script.

private void CallNativeSubrutine(string name, params InjectionValue[] args)
        {
            Checkpoint();
            if (!Metadata.TryGetNativeSubrutine("UO." + name, args, out var nativeSubrutine))
                throw new NativeSubrutineException($"Native UO command '{name}' with {args.Length} argument(s) was not found.");
            nativeSubrutine.Call(args);
            Checkpoint();
        }

InjectionScript.Runtime.InjectionRuntime.Exec

Performs the displayed calls and state updates.

Parameters: parameters

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

public void Exec(string parameters)

Result: void.

Calls: Tokenize(parameters).ToArray, Tokenize, command.Equals, string.IsNullOrWhiteSpace, bridge.Exec, parts.Skip(1).ToArray, parts.Skip, arguments.Select(token => token.Text).ToArray.

Conditions: parts.Length == 0; command.Equals("exec", StringComparison.OrdinalIgnoreCase); parts.Length != 2 || string.IsNullOrWhiteSpace(parts[1].Text); TryHandleLegacyConsoleCommand(command, rawArguments).

Calls:

Internal implementation code; this is not a standalone script.

public void Exec(string parameters)
        {
            ConsoleToken[] parts = Tokenize(parameters).ToArray();
            if (parts.Length == 0)
                return;

            string command = parts[0].Text;
            if (command.Equals("exec", StringComparison.OrdinalIgnoreCase))
            {
                if (parts.Length != 2 || string.IsNullOrWhiteSpace(parts[1].Text))
                    throw new NativeSubrutineException("Usage: exec script_function");
                bridge.Exec(parts[1].Text);
                return;
            }

            ConsoleToken[] arguments = parts.Skip(1).ToArray();
            string[] rawArguments = arguments.Select(token => token.Text).ToArray();
            if (TryHandleLegacyConsoleCommand(command, rawArguments))
                return;

            command = NormalizeConsoleAlias(command);
            if (IsRemainderTextCommand(command) && rawArguments.Length > 0)
                arguments = new[] { new ConsoleToken(string.Join(" ", rawArguments), true) };
            else if (command.Equals("ColorPrint", StringComparison.OrdinalIgnoreCase) && rawArguments.Length > 1)
                arguments = new[] { arguments[0], new ConsoleToken(string.Join(" ", rawArguments.Skip(1)), true) };
            else if (command.Equals("CharPrint", StringComparison.OrdinalIgnoreCase) && rawArguments.Length > 2)
                arguments = new[] { arguments[0], arguments[1], new ConsoleToken(string.Join(" ", rawArguments.Skip(2)), true) };

            InjectionValue[] args = arguments.Select(token => token.Quoted
                ? new InjectionValue(token.Text) : ToConsoleValue(token.Text)).ToArray();
            CallNativeSubrutine(command, args);
        }

InjectionScript.Runtime.InjectionValue.ToString

Returns the value of the expression below.

Parameters: No parameters.

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/InjectionValue.cs:405.

public override string ToString()

Result: string.

Result: "<unit>"; Integer.ToString(System.Globalization.CultureInfo.InvariantCulture); String; Decimal.ToString(System.Globalization.CultureInfo.InvariantCulture); FormatArray(Array, new HashSet<InjectionValue[]>(), 0); Object?.Name ?? string.Empty.

Calls: Integer.ToString, Decimal.ToString, FormatArray.

Calls:

Internal implementation code; this is not a standalone script.

public override string ToString()

        {

            switch (Kind)

            {

                case InjectionValueKind.Unit:

                    return "<unit>";

                case InjectionValueKind.Integer:

                    return Integer.ToString(System.Globalization.CultureInfo.InvariantCulture);

                case InjectionValueKind.String:

                    return String;

                case InjectionValueKind.Decimal:

                    return Decimal.ToString(System.Globalization.CultureInfo.InvariantCulture);

                case InjectionValueKind.Array:

                    return FormatArray(Array, new HashSet<InjectionValue[]>(), 0);

                case InjectionValueKind.Object:

                    return Object?.Name ?? string.Empty;

                default:

                    throw new InvalidOperationException($"Unknown InjectionValue kind {Kind}.");

            }

        }

InjectionScript.Runtime.NumberConversions.ToHex

Returns the value of the expression below.

Parameters: id

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/NumberConversions.cs:80.

public static string ToHex(short id)

Result: string.

Result: $"0x{id:X4}".

Internal implementation code; this is not a standalone script.

public static string ToHex(short id) => $"0x{id:X4}";

InjectionScript.Runtime.ObjectTypes.MemoryStreamObject.ReplaceBytes

Performs the displayed calls and state updates.

Parameters: bytes

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/ObjectTypes/MemoryStreamObject.cs:26.

internal void ReplaceBytes(byte[] bytes)

Result: void.

Calls: stream.SetLength, Array.Empty<byte>, stream.Write.

Conditions: bytes == null.

Internal implementation code; this is not a standalone script.

internal void ReplaceBytes(byte[] bytes)
        {
            stream.SetLength(0);
            stream.Position = 0;
            if (bytes == null)
                bytes = Array.Empty<byte>();
            stream.Write(bytes, 0, bytes.Length);
            stream.Position = 0;
        }

InjectionScript.Runtime.State.Globals.GetGlobal

Returns the value of the expression below.

Parameters: name

Source: Project_Full/external/InjectionScript/src/InjectionScript/Runtime/State/Globals.cs:22.

public string GetGlobal(string name)

Result: string.

Result: globals.TryGetValue(name, out var value) ? value : "N/A".

Calls: globals.TryGetValue.

Internal implementation code; this is not a standalone script.

public string GetGlobal(string name)
        {
            lock (globalsLock)
                return globals.TryGetValue(name, out var value) ? value : "N/A";
        }

InjectionScript.Runtime.State.NamedIgnoreLists.RequireName

Checks the conditions below and returns the displayed result.

Parameters: name

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

private static string RequireName(string name)

Result: string.

Result: name.Trim().

Calls: string.IsNullOrWhiteSpace, nameof, name.Trim.

Conditions: string.IsNullOrWhiteSpace(name).

Internal implementation code; this is not a standalone script.

private static string RequireName(string name)
        {
            if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Ignore list name must not be empty.", nameof(name));
            return name.Trim();
        }

Clone this wiki locally