Esempio n. 1
0
        /// <summary>
        /// Main trigger 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));

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

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

                    if (Coordinates.X != 0 || Coordinates.Y != 0)
                    {
                        MouseHelper.Click();
                    }

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

                Thread.Sleep(1);
            }
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Moves the mouse.
        /// </summary>
        /// <param name="MyFov"></param>
        /// <param name="Coordinates"></param>
        public static void Move(ref Fov MyFov, Point Coordinates, bool ForceHeadshot = false)
        {
            // Get the crosshair position.
            Point Crosshair = new Point(0, 0);

            Crosshair.X = MyFov.Resolution.X / 2;
            Crosshair.Y = MyFov.Resolution.Y / 2;

            // Determine the stepcounts.
            Point StepCount = new Point(0, 0);
            Point Step      = new Point(0, 0);

            // Calculate the destination.
            Point Destination = new Point(0, 0);

            Destination.X = Coordinates.X + MyFov.RangeValues.X;
            Destination.Y = Coordinates.Y + MyFov.RangeValues.Y;

            // Calculate the difference from the crosshair.
            Point Difference = new Point(0, 0);

            Difference.X = Math.Abs(Crosshair.X - Destination.X);
            Difference.Y = Math.Abs(Crosshair.Y - Destination.Y);

            StepCount.X = 5;
            StepCount.Y = 3;

            // X-axis.
            if (Difference.X < 10)
            {
                StepCount.X = 1;

                if (Settings.Aimbot.AntiShake)
                {
                    Thread.Sleep(1);
                }
            }
            else if (Difference.X < 40)
            {
                StepCount.X = 5;
                Thread.Sleep(1);
            }

            Step.X = StepCount.X;

            if (Crosshair.X > Destination.X)
            {
                Step.X = -StepCount.X;
            }

            // Y-axis.
            if (Difference.Y < 10)
            {
                StepCount.Y = 1;
            }

            Step.Y = StepCount.Y;

            if (Crosshair.Y > Destination.Y)
            {
                Step.Y = -StepCount.Y;
            }

            if (Crosshair.X > Destination.X + MyFov.Tolerance.X || Crosshair.X < Destination.X - MyFov.Tolerance.X)
            {
                ExecuteMove(Step.X, 0);

                if (ForceHeadshot)
                {
                    if (Crosshair.Y > Destination.Y + MyFov.Tolerance.Y || Crosshair.Y < Destination.Y - MyFov.Tolerance.Y)
                    {
                        ExecuteMove(0, Step.Y);
                    }
                }
            }
        }