EN Runtime Helpers 6 - LIHACHTETAN/ClassicUO-Bad-Newbie-CSharp-Scripts-IDE GitHub Wiki

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

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 listener

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

private void Remove(Listener listener)

Result: void.

Conditions:

  • listener.Closed

Calls:

  • listeners.Remove
  • listener.Source.Dispose

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

Conditions:

  • CurrentFinalization.Value?.IsActive == true

Calls:

  • .Verify

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

Performs the displayed calls and state updates.

Parameters: string value

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

private static string EncodePathSegment(string value)

Result: string.

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'`
    

Calls:

  • string.IsNullOrWhiteSpace
  • IsWindowsTrimmedSuffix
  • builder.Append('~').Append
  • builder.Append
  • ((int)character).ToString
  • builder.ToString
  • result.Split
  • baseName.Equals
  • baseName.StartsWith

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

public void ActivateHandle()

Result: void.

Calls:

  • Invoke
  • SDL3.SDL.SDL_RaiseWindow
  • RequireGameView

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: string name

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

public void AddChatUserIgnore(string name)

Result: void.

Calls:

  • Invoke
  • JournalManager.AddYokoIgnoredUser

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: string caption, string item, bool persistent

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

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

Result: void.

Calls:

  • Invoke
  • _manager.AddMenuHook

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: int uiWindowType, int id

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

public void CloseClientWindow(int uiWindowType, int id)

Result: void.

Conditions:

  • uiWindowType == 2
  • uiWindowType == 0
  • uiWindowType == 3

Calls:

  • Invoke

  • _world.CharacterPanels.Profile

  • .Close

  • _world.NativePopups.Close

  • _world.Containers.Close

  • `UIManager.Gumps.Where(gump => !gump.IsDisposed

                       && gump.LocalSerial == unchecked((uint)id) && MatchesType(gump)).ToArray`
    
  • UIManager.Gumps.Where

  • MatchesType

  • gump.Dispose

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

Performs the displayed calls and state updates.

Parameters: int tradeNumber

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

public int ConfirmTrade(int tradeNumber)

Result: int.

Conditions:

  • gump == null
  • !gump.ImAccepting

Calls:

  • Invoke
  • FindNumberedTrade
  • GameActions.AcceptTrade

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

Performs the displayed calls and state updates.

Parameters: int id

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

public int ContainerOf(int id)

Result: int.

Calls:

  • Invoke
  • _world.Items.Get

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

Performs the displayed calls and state updates.

Parameters: Control control

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

private static string DescribeControl(Control control)

Result: string.

Conditions:

  • control is SessionGumpControl logical
  • control is Button button
  • control is Checkbox checkbox

Calls:

  • logical.Describe
  • control.GetType
  • GetControlText
  • string.IsNullOrWhiteSpace

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: string subrutineName

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

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

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int GetDropDelay()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int GetDropDelay() => State.GrabDelay;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetFlags

Performs the displayed calls and state updates.

Parameters: int id

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

public int GetFlags(int id)

Result: int.

Calls:

  • Invoke
  • _world.Get

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

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int GetGumpCount()

Result: int.

Calls:

  • Invoke
  • ServerGumpsUnsafe

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.GetGumpSerial

Performs the displayed calls and state updates.

Parameters: int index

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

public int GetGumpSerial(int index)

Result: int.

Calls:

  • Invoke
  • ServerGumpsUnsafe().ElementAtOrDefault
  • ServerGumpsUnsafe

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

Performs the displayed calls and state updates.

Parameters: int index

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

public string GetScriptPath(int index)

Result: string.

Calls:

  • _manager.GetScriptPath

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

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int[] GetWaitTargetQueue()

Result: int[].

Calls:

  • _manager.GetPendingTargetSerials

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.JournalEntryCount

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int JournalEntryCount()

Result: int.

Calls:

  • Invoke

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.JournalMatchCount

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int JournalMatchCount()

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

public int JournalMatchCount() => _journalMatchCount;

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTarget

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int LastTarget

Result: int.

Calls:

  • Invoke

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.LastTile

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int[] LastTile()

Result: int[].

Calls:

  • Invoke

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: int id, int delay

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

public void ReceiveObjectName(int id, int delay)

Result: void.

Calls:

  • Click
  • Stopwatch.StartNew
  • Math.Max
  • string.IsNullOrEmpty
  • GetName
  • Wait
  • Math.Min

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

public void RequestVirtuesGump()

Result: void.

Conditions:

  • _world.Player != null

Calls:

  • Invoke
  • GameActions.ReplyGump
  • 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

Performs the displayed calls and state updates.

Parameters: int gumpId

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

private Gump ResolveGumpUnsafe(int gumpId)

Result: Gump.

Conditions:

  • gumpId == -1

Calls:

  • ServerGumpsUnsafe
  • gumps.LastOrDefault
  • gumps.FirstOrDefault

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

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int SelectContainer()

Result: int.

Calls:

  • SelectObject

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: string command, string message

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

private void SendServerSpeech(string command, string message)

Result: void.

Calls:

  • Invoke
  • GameActions.Say
  • ReportStatus

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

Performs the displayed calls and state updates.

Parameters: string path

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

public int StartScript(string path)

Result: int.

Calls:

  • _manager.StartScript

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.ToClassicUOCastIndex

Performs the displayed calls and state updates.

Parameters: int spellId

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

internal static int ToClassicUOCastIndex(int spellId)

Result: int.

Calls:

—

Internal implementation code; this is not a standalone script.

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

ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.TryMoveItemRequest

Performs the displayed calls and state updates.

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

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

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

Result: bool.

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

Performs the displayed calls and state updates.

Parameters: int abilityId

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

public int UseAbility(int abilityId)

Result: int.

Conditions:

  • _world.Player == null || abilityId < 1 || abilityId > AbilityData.Abilities.Length
  • abilityId == primary
  • abilityId == secondary

Calls:

  • Invoke
  • GameActions.UsePrimaryAbility
  • GameActions.UseSecondaryAbility

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: string scriptKey, string 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

Performs the displayed calls and state updates.

Parameters: Action callback, CancellationToken cancellationToken

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

internal void InvokeOnGameThread(Action callback, CancellationToken cancellationToken)

Result: void.

Calls:

  • InvokeOnGameThread
  • callback

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: int index

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

internal void PauseResumeScript(int index)

Result: void.

Conditions:

  • script == null

Calls:

  • ElementAt
  • RunningScripts
  • script.ToggleManualPause
  • MarkRuntimeStateChanged

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: string text, string scriptKey = null

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

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

Result: void.

Conditions:

  • !IsScriptPublicationCurrent(scriptKey)

Calls:

  • IsScriptPublicationCurrent
  • Volatile.Write
  • PublishStatus

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

Performs the displayed calls and state updates.

Parameters: uint serial

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

public static bool IsMobile(uint serial)

Result: bool.

Calls:

—

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 season, int music

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

public void ChangeSeason(Season season, int music)

Result: void.

Conditions:

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

Calls:

  • Map.GetUsedChunks
  • .GetHeadObject
  • obj.UpdateGraphicBySeason
  • .GetCurrentMusic
  • audio.PlayMusic

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

Performs the displayed calls and state updates.

Parameters: string value,int wordIndex

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

private static string GetWord(string value,int wordIndex)

Result: string.

Calls:

  • GetWord

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApi.SplitWords

Performs the displayed calls and state updates.

Parameters: string value,string delimiter

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

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

Result: string[].

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

Performs the displayed calls and state updates.

Parameters: int fromX, int fromY, int toX, int toY

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

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

Result: int.

Conditions:

  • dx == 0 && dy == 0
  • dx == 0
  • dy == 0
  • dx > 0

Calls:

  • Math.Sign

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

Performs the displayed calls and state updates.

Parameters: InjectionValue[] values

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

private int CompactAttackNearest(InjectionValue[] values)

Result: int.

Conditions:

  • !TryResolveClassRules(classMask, out EquipmentClassRule[] rules)
  • serial != 0

Calls:

  • ResolveCompactDistance
  • bridge.GetFindDistance
  • ResolveCompactMaxZ
  • bridge.GetFindVertical
  • ToBoolean
  • NumberConversions.ToInt
  • TryResolveClassRules
  • FilterMobiles
  • SelectClassCandidate
  • bridge.Attack

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

Performs the displayed calls and state updates.

Parameters: InjectionValue[] values

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

private int CompactWaitGump(InjectionValue[] values)

Result: int.

Conditions:

  • values == null || values.Length == 0
  • bridge is IApiGumpAutomation automation
  • value.Kind == InjectionValueKind.Array
  • CompactWaitGump(value.Array) == 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`
    
  • part.Trim

  • NumberConversions.ToInt

  • bridge.WaitGumpSelect

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

Performs the displayed calls and state updates.

Parameters: string layer

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

private int ConvertLayer(string layer)

Result: int.

Conditions:

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

Calls:

  • layerNameToNumber.TryGetValue
  • (layer ?? string.Empty).Trim

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

Performs the displayed calls and state updates.

Parameters: InjectionValue containerId

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

private int ConvertMoveDestination(InjectionValue containerId)

Result: int.

Conditions:

  • containerId.Kind != InjectionValueKind.String && containerId.Kind != InjectionValueKind.Integer

Calls:

  • NumberConversions.TryStr2Int
  • .Trim
  • ResolveTransferDestination

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

Performs the displayed calls and state updates.

Parameters: InjectionValue type

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

public int Count(InjectionValue type)

Result: int.

Calls:

  • Count
  • ResolveType

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: string text

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

public void DeleteJournal(string text)

Result: void.

Calls:

  • bridge.DeleteJournal
  • SelectJournalEntry

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: string name

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

public void DeleteObject(string name)

Result: void.

Conditions:

  • objects.TryGet(name, out int value)

Calls:

  • objects.TryGet
  • objects.Remove
  • SystemMessage

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

Performs the displayed calls and state updates.

Parameters: int id

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

public int Exists(int id)

Result: int.

Calls:

  • bridge.Exists

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.GetLandTileAt

Performs the displayed calls and state updates.

Parameters: InjectionValue x, InjectionValue y

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

public InjectionValue GetLandTileAt(InjectionValue x, InjectionValue y)

Result: InjectionValue.

Calls:

  • GetLandTileAt

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

Performs the displayed calls and state updates.

Parameters: string name

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

public int GetObject(string name)

Result: int.

Conditions:

  • !TryGetObject(name, out int id)

Calls:

  • TryGetObject

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

Performs the displayed calls and state updates.

Parameters: InjectionValue group, InjectionValue tileId

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

public string GetTileName(InjectionValue group, InjectionValue tileId)

Result: string.

Calls:

  • bridge.GetTileDataName
  • NumberConversions.ToInt

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

Performs the displayed calls and state updates.

Parameters: InjectionValue id

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

public string GetUserStatic(InjectionValue id)

Result: string.

Calls:

  • state.UserStatics.TryGetValue
  • NumberConversions.ToInt

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

Performs the displayed calls and state updates.

Parameters: string id

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

public int GetY(string id)

Result: int.

Calls:

  • GetY
  • GetObject

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.Hidden

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int Hidden()

Result: int.

Calls:

  • Hidden

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: int id

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

public void Ignore(int id)

Result: void.

Calls:

  • bridge.Ignore

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.InJournal

Performs the displayed calls and state updates.

Parameters: string pattern, int maxLinesOrIgnoreCase

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

public int InJournal(string pattern, int maxLinesOrIgnoreCase)

Result: int.

Calls:

  • InJournalCore
  • Math.Max

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

Performs the displayed calls and state updates.

Parameters: int graphic

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

private static bool IsHumanBody(int graphic)

Result: bool.

Calls:

—

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

Performs the displayed calls and state updates.

Parameters: InjectionValue x, InjectionValue y

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

public int IsTreeTile(InjectionValue x, InjectionValue y)

Result: int.

Calls:

  • bridge.IsTreeTile
  • NumberConversions.ToInt

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

Performs the displayed calls and state updates.

Parameters: int index

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

private int JournalEntryTime(int index)

Result: int.

Calls:

  • JournalEntryTime
  • bridge.JournalTimestamp

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: int type

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

public void Morph(int type)

Result: void.

Calls:

  • bridge.Morph
  • Timer

Internal implementation code; this is not a standalone script.

public void Morph(int type)

        {

            bridge.Morph(type);

            ticksAnim = Timer();

        }

InjectionScript.Runtime.InjectionApiUO.MoveItemChecked

Performs the displayed calls and state updates.

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

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

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

Result: bool.

Conditions:

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

Calls:

  • bridge.GetX
  • bridge.GetY
  • Math.Max
  • Math.Abs
  • SystemMessage
  • bridge.MoveItem

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

Performs the displayed calls and state updates.

Parameters: string name

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

private static string NormalizeApiName(string name)

Result: string.

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: int x, int y

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

public void RDblClick(int x, int y)

Result: void.

Calls:

  • bridge.RDblClick

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

Performs the displayed calls and state updates.

Parameters: InjectionValue value

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

private int ResolveCompactDistance(InjectionValue value)

Result: int.

Calls:

  • NumberConversions.ToInt
  • bridge.GetFindDistance
  • Math.Max

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: string name

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

public void SetArm(string name)

Result: void.

Calls:

  • SetEquip

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: InjectionValue name, InjectionValue stateValue, InjectionValue repeatOrHandler

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

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

Result: void.

Conditions:

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

Calls:

  • repeatOrHandler.ToString
  • string.IsNullOrWhiteSpace
  • NumberConversions.TryStr2Int
  • SetEvent

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: int index

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

public void SetJournalLine(int index)

Result: void.

Calls:

  • bridge.SetJournalLine

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

public void Terminate()

Result: void.

Calls:

  • bridge.Terminate

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: string subrutineName

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

public void Terminate(string subrutineName)

Result: void.

Calls:

  • bridge.Terminate

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

public void TextOpen()

Result: void.

Calls:

  • bridge.TextOpen

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: InjectionValue flag

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

public void Track(InjectionValue flag)

Result: void.

Calls:

  • Track
  • NumberConversions.ToInt
  • GetX
  • GetY

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.TradeCheck

Performs the displayed calls and state updates.

Parameters: InjectionValue windowIndex, InjectionValue checkbox, InjectionValue stateValue

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

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

Result: int.

Calls:

  • bridge.TradeCheck
  • NumberConversions.ToInt

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

Performs the displayed calls and state updates.

Parameters: int[] supportedLayers, string successMessage

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

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

Result: int.

Conditions:

  • bridge.ObjAtLayer(layer) != 0
  • state.DressSpeed > 0

Calls:

  • bridge.ObjAtLayer
  • bridge.Unequip
  • injectionApi.Wait
  • SystemMessage

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

public void UnsetReceivingContainer()

Result: void.

Calls:

  • bridge.UnsetReceivingContainer

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: string id

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

public void UseObject(string id)

Result: void.

Calls:

  • UseObject
  • GetObject

Internal implementation code; this is not a standalone script.

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

InjectionScript.Runtime.InjectionApiUO.UseType

Performs the displayed calls and state updates.

Parameters: int type, int color

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

public int UseType(int type, int color)

Result: int.

Calls:

  • CompactUseType

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: int startTime, int maxDelay, string text

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

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

Result: void.

Calls:

  • WaitingForJournalText

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

Performs the displayed calls and state updates.

Parameters: InjectionValue delayValue, InjectionValue menuCountValue, InjectionValue blockMenuValue, InjectionValue menuNameValue, InjectionValue skillOrSerial

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

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

Result: int.

Conditions:

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

Calls:

  • Math.Max
  • NumberConversions.ToInt
  • menuNameValue.ToString
  • timeSource.Now.AddMilliseconds
  • TriggerWaitAction
  • bridge.GetLastMenuIdentity
  • identity.Equals
  • bridge.GetLastMenuCaption
  • caption.Equals
  • bridge.CloseMenu
  • bridge.Wait
  • Math.Min

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

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public int WaitingMenu()

Result: int.

Calls:

  • bridge.WaitingMenu

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: string name, params InjectionValue[] args

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

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

Result: void.

Conditions:

  • !Metadata.TryGetNativeSubrutine("UO." + name, args, out var nativeSubrutine)
  • result.Kind != InjectionValueKind.Unit && name.IndexOf("Info", StringComparison.OrdinalIgnoreCase) < 0

Calls:

  • Checkpoint
  • Metadata.TryGetNativeSubrutine
  • nativeSubrutine.Call
  • name.IndexOf
  • bridge.Print
  • result.ToString

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.");

            InjectionValue result = nativeSubrutine.Call(args);

            if (result.Kind != InjectionValueKind.Unit && name.IndexOf("Info", StringComparison.OrdinalIgnoreCase) < 0)

                bridge.Print(result.ToString());

            Checkpoint();

        }

InjectionScript.Runtime.InjectionRuntime.Exec

Performs the displayed calls and state updates.

Parameters: string parameters

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

public void Exec(string parameters)

Result: void.

Conditions:

  • parts.Length == 0
  • command.StartsWith("UO.", StringComparison.OrdinalIgnoreCase)
  • command.Equals("exec", StringComparison.OrdinalIgnoreCase)
  • parts.Length != 2 || string.IsNullOrWhiteSpace(parts[1].Text)

Calls:

  • Tokenize(parameters).ToArray

  • Tokenize

  • command.StartsWith

  • command.Substring

  • command.Equals

  • string.IsNullOrWhiteSpace

  • bridge.Exec

  • parts.Skip(1).ToArray

  • parts.Skip

  • NormalizeCompoundConsoleAlias

  • arguments.Select(token => token.Text).ToArray

  • arguments.Select

  • TryHandleLegacyConsoleCommand

  • NormalizeConsoleAlias

  • IsRemainderTextCommand

  • string.Join

  • rawArguments.Skip

  • `arguments.Select(token => token.Quoted

              ? new InjectionValue(token.Text) : ToConsoleValue(token.Text)).ToArray`
    
  • ToConsoleValue

  • CallNativeSubrutine

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.StartsWith("UO.", StringComparison.OrdinalIgnoreCase)) command = command.Substring(3);

            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();

            (command, arguments) = NormalizeCompoundConsoleAlias(command, arguments);

            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) };

            else if (command.Equals("SetGlobal", StringComparison.OrdinalIgnoreCase) && rawArguments.Length > 2)

                // Chat parameters are space-separated.  Preserve a human-readable

                // global value after its key without forcing the player to quote it.

                arguments = new[] { arguments[0], new ConsoleToken(string.Join(" ", rawArguments.Skip(1)), true) };



            InjectionValue[] args = arguments.Select(token => token.Quoted

                ? new InjectionValue(token.Text) : ToConsoleValue(token.Text)).ToArray();

            CallNativeSubrutine(command, args);

        }

InjectionScript.Runtime.InjectionValue.ToString

Performs the displayed calls and state updates.

Parameters: No parameters.

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

public override string ToString()

Result: string.

Calls:

  • Integer.ToString
  • Decimal.ToString
  • FormatArray

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

Performs the displayed calls and state updates.

Parameters: short id

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

public static string ToHex(short id)

Result: string.

Calls:

—

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: byte[] bytes

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

internal void ReplaceBytes(byte[] bytes)

Result: void.

Conditions:

  • bytes == null

Calls:

  • stream.SetLength
  • Array.Empty<byte>
  • stream.Write

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

Performs the displayed calls and state updates.

Parameters: string name

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

public string GetGlobal(string name)

Result: string.

Calls:

  • GetGlobalShared

Internal implementation code; this is not a standalone script.

public string GetGlobal(string name) => GetGlobalShared(name);

InjectionScript.Runtime.State.NamedIgnoreLists.RequireName

Performs the displayed calls and state updates.

Parameters: string name

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

private static string RequireName(string name)

Result: string.

Conditions:

  • string.IsNullOrWhiteSpace(name)

Calls:

  • string.IsNullOrWhiteSpace
  • nameof
  • name.Trim

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();
        }

ClassicUO.Game.Managers.NativeMountController.Request

Performs the displayed calls and state updates.

Parameters: World world, uint target, bool mount, Action<uint> sendUse, long now

Source: Project_Full/src/ClassicUO.Client/Game/Managers/NativeMountController.cs:25.

internal bool Request(World world, uint target, bool mount, Action<uint> sendUse, long now)

Result: bool.

Conditions:

  • player == null || player.IsDestroyed || player.IsDead || !world.InGame
  • _pendingPlayer != null
  • !ReferenceEquals(_pendingPlayer, player) || layerSerial != _pendingLayer || now >= _pendingUntil
  • mount

Calls:

  • Clear
  • player.FindItemByLayer
  • ReferenceEquals
  • world.Get
  • Math.Max
  • Math.Abs
  • IsCarriedBy
  • sendUse

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

Internal implementation code; this is not a standalone script.

internal bool Request(World world, uint target, bool mount, Action<uint> sendUse, long now)
        {
            PlayerMobile player = world?.Player;
            if (player == null || player.IsDestroyed || player.IsDead || !world.InGame)
            {
                Clear();
                return false;
            }
// …
            if (_pendingPlayer != null)
// …
                if (!ReferenceEquals(_pendingPlayer, player) || layerSerial != _pendingLayer
// …
                    return false;
// …
            if (mount)
// …
                if (layerSerial != 0 || target == 0 || target == player.Serial)
                    return false;
// …
                if (entity == null || entity.IsDestroyed)
                    return false;
                if (entity is Mobile mobile)
// …
                    if (mobile.IsDead || Math.Max(Math.Abs((int)mobile.X - player.X),
// …
                        return false;
// …
                else if (entity is Item item)
// …
                    if (!IsCarriedBy(world, item, player.Serial))
                        return false;
// …
                    return false;
// …
                if (layerSerial == 0 || layer.Graphic == 0x3E96)
                    return false;
// …
            }

            sendUse(target);
            _pendingPlayer = player;
            _pendingLayer = layerSerial;
            _pendingUntil = now + ConfirmationTimeoutMilliseconds;
            return true;
        }
⚠️ **GitHub.com Fallback** ⚠️