示例#1
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        public static void Main()
        {
            RadicalHeights.Initialize();
            RadicalHeights.Attach();
            RadicalHeights.EnableEvents();

            Console.WriteLine("[*] Loading ESP.");
            Console.WriteLine("[*] Waiting for you to start the game..");

            RadicalHeights.WaitGameStart().Wait();

            if (RadicalHeights.IsAttached)
            {
                Program.Inject();
            }
            else
            {
                Console.WriteLine("[*] Error, tried to attach to the process and failed 2 times.");
                Console.WriteLine("[*] Error code 0x01.");
            }

            Console.ReadKey(false);
        }
        /// <summary>
        /// Runs this instance.
        /// </summary>
        internal static async Task Run()
        {
            while (true)
            {
                if (RadicalHeights.IsAttached)
                {
                    if (EventHandlers.IsAttached == false)
                    {
                        EventHandlers.IsAttached = true;
                        EventHandlers.IsDetached = false;

                        var Event = new RadicalAttachedEvent();

                        if (EventHandlers.OnRadicalAttached != null)
                        {
                            EventHandlers.OnRadicalAttached.Invoke(null, Event);
                        }
                    }
                }
                else if (RadicalHeights.IsDetached)
                {
                    if (EventHandlers.IsDetached == false)
                    {
                        EventHandlers.IsAttached = false;
                        EventHandlers.IsDetached = true;

                        var Event = new RadicalDetachedEvent();

                        if (EventHandlers.OnRadicalDetached != null)
                        {
                            EventHandlers.OnRadicalDetached.Invoke(null, Event);
                        }
                    }
                    else
                    {
                        RadicalHeights.Attach();
                    }
                }

                if (RadicalHeights.IsAttached)
                {
                    if (RadicalHeights.IsMaximized)
                    {
                        if (EventHandlers.IsMaximized == false)
                        {
                            EventHandlers.IsMaximized = true;
                            EventHandlers.IsMinimized = false;

                            var Event = new WindowsMaximizedEvent();

                            if (EventHandlers.OnWindowsMaximized != null)
                            {
                                EventHandlers.OnWindowsMaximized.Invoke(null, Event);
                            }
                        }
                    }

                    if (RadicalHeights.IsMinimized)
                    {
                        if (EventHandlers.IsMinimized == false)
                        {
                            EventHandlers.IsMaximized = false;
                            EventHandlers.IsMinimized = true;

                            var Event = new WindowsMinimizedEvent();

                            if (EventHandlers.OnWindowsMinimized != null)
                            {
                                EventHandlers.OnWindowsMinimized.Invoke(null, Event);
                            }
                        }
                    }

                    if (RadicalHeights.IsOnScreen)
                    {
                        if (EventHandlers.IsOnScreen == false)
                        {
                            EventHandlers.IsOnScreen = true;

                            var Event = new WindowsOnScreenEvent();

                            if (EventHandlers.OnWindowsShowed != null)
                            {
                                EventHandlers.OnWindowsShowed.Invoke(null, Event);
                            }
                        }
                    }
                    else
                    {
                        if (EventHandlers.IsOnScreen)
                        {
                            EventHandlers.IsOnScreen = false;

                            var Event = new WindowsNotOnScreenEvent();

                            if (EventHandlers.OnWindowsNotShowed != null)
                            {
                                EventHandlers.OnWindowsNotShowed.Invoke(null, Event);
                            }
                        }
                    }
                }

                await Task.Delay(250);
            }
        }