示例#1
0
        /// <summary>
        /// Main aimbot thread.
        /// </summary>
        public void Run()
        {
            // Retrieve the Fov.
            Fov MyFov = Fovs.First(x => x.Resolution == new Point(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height));

            // Run the main routine.
            while (true)
            {
                if (MouseHelper.GetAsyncKeyState(Settings.Aimbot.AimKey) < 0)
                {
                    // Get the screen capture.
                    Bitmap ScreenCapture = ScreenHelper.GetScreenCapture(MyFov.FieldOfView);

                    // Search for a target.
                    Point Coordinates = SearchHelper.SearchColor(ref ScreenCapture, Settings.Aimbot.TargetColor);

                    // Only continue if a healthbar was found.
                    if (Coordinates.X != 0 || Coordinates.Y != 0)
                    {
                        Coordinates = ScreenHelper.GetAbsoluteCoordinates(Coordinates, MyFov.FieldOfView);

                        MouseHelper.Move(ref MyFov, Coordinates, Settings.Aimbot.ForceHeadshot);
                    }

                    // Destroy the bitmap.
                    ScreenCapture.Dispose();
                    ScreenCapture = null;
                }

                Thread.Sleep(1);
            }
        }