示例#1
0
        public void AimAtPos(float x, float y)
        {
            float x1   = Aimbot.ScreenCenter.X;
            float y1   = Aimbot.ScreenCenter.Y;
            float num1 = 0.0f;
            float num2 = 0.0f;

            if ((double)x != 0.0)
            {
                if ((double)x > (double)x1 + 2.0)
                {
                    num1 = (float)-((double)x1 - (double)x) / Aimbot.AimSpeed;
                    if ((double)num1 + (double)x1 > (double)x1 * 2.0)
                    {
                        num1 = 0.0f;
                    }
                }
                if ((double)x < (double)x1 - 2.0)
                {
                    num1 = (x - x1) / Aimbot.AimSpeed;
                    if ((double)num1 + (double)x1 < 0.0)
                    {
                        num1 = 0.0f;
                    }
                }
            }
            if ((double)y != 0.0)
            {
                if ((double)y > (double)y1 + 2.0)
                {
                    num2 = (float)-((double)y1 - (double)y) / Aimbot.AimSpeed;
                    if ((double)num2 + (double)y1 > (double)y1 * 2.0)
                    {
                        num2 = 0.0f;
                    }
                }
                if ((double)y < (double)y1 - 2.0)
                {
                    num2 = (y - y1) / Aimbot.AimSpeed;
                    if ((double)num2 + (double)y1 < 0.0)
                    {
                        num2 = 0.0f;
                    }
                }
            }
            if (!this.smooth)
            {
                Aimbot.mouse_event(1, (int)num1, (int)num2, 0, 0);
            }
            else
            {
                float num3 = num1 / 10f;
                float num4 = num2 / 10f;
                if ((double)Math.Abs(num3) < 1.0)
                {
                    if ((double)num3 > 0.0)
                    {
                        num3 = 1f;
                    }
                    if ((double)num3 < 0.0)
                    {
                        num3 = -1f;
                    }
                }
                if ((double)Math.Abs(num4) < 1.0)
                {
                    if ((double)num4 > 0.0)
                    {
                        num4 = 1f;
                    }
                    if ((double)num4 < 0.0)
                    {
                        num4 = -1f;
                    }
                }
                Aimbot.mouse_event(1, (int)num3, (int)num4, 0, 0);
            }
        }
示例#2
0
 public static void AimbotLoop()
 {
     while (!Main_Window.Closing)
     {
         if ((Aimbot.GetKeyState(Aimbot.Aim_Key) & 32768) != 0 && Aimbot.bone_transform_addr > 0UL)
         {
             float           num1      = MEMAPI.ReadFloat(Aimbot.Target_addr + (ulong)Main_Window.BasePlayer.health, false);
             MEMAPI.Vector3  vector3_1 = MEMAPI.ReadVector3(MEMAPI.GetPointer(false, (long)Aimbot.Target_Base_addr + 48L, 8L, 56L, 176L), false);
             SharpDX.Vector3 vector3_2;
             vector3_2.X = vector3_1.x;
             vector3_2.Y = vector3_1.y;
             vector3_2.Z = vector3_1.z;
             bool ValidAddress = false;
             int  num2         = (int)MEMAPI.Readbyte(Aimbot.Target_addr + (ulong)Main_Window.BasePlayer.playerFlags, ref ValidAddress, false);
             if ((double)num1 > 0.0 && (double)num1 < 2000.0 && vector3_2 != SharpDX.Vector3.Zero)
             {
                 SharpDX.Vector3 vector3_3 = SharpDX.Vector3.Zero;
                 vector3_3 = Aimbot.Aimbot_Bone != 49 ? OverlayWindow1.GetBonePosition(Aimbot.bone_transform_addr, false) : OverlayWindow1.GetBonePosition(Aimbot.bone_transform_addr, true);
                 if (vector3_3 != SharpDX.Vector3.Zero)
                 {
                     MEMAPI.Matrix  matrix = MEMAPI.ReadMatrix(MEMAPI.GetPointer(false, (long)Main_Window.Camera_Address + 48L, 24L, 740L), false);
                     SharpDX.Matrix y      = new SharpDX.Matrix()
                     {
                         M11 = matrix.M11,
                         M12 = matrix.M12,
                         M13 = matrix.M13,
                         M14 = matrix.M14,
                         M21 = matrix.M21,
                         M22 = matrix.M22,
                         M23 = matrix.M23,
                         M24 = matrix.M24,
                         M31 = matrix.M31,
                         M32 = matrix.M32,
                         M33 = matrix.M33,
                         M34 = matrix.M34,
                         M41 = matrix.M41,
                         M42 = matrix.M42,
                         M43 = matrix.M43,
                         M44 = matrix.M44
                     };
                     MEMAPI.Vector3  vector3_4 = MEMAPI.ReadVector3(MEMAPI.GetPointer(false, (long)Main_Window.Camera_Address + 48L, 24L, 1068L), false);
                     SharpDX.Vector3 m_camera_position;
                     m_camera_position.X = vector3_4.x;
                     m_camera_position.Y = vector3_4.y;
                     m_camera_position.Z = vector3_4.z;
                     MEMAPI.Vector3 vector3_5 = MEMAPI.ReadVector3(MEMAPI.GetPointer(false, (long)Aimbot.Target_addr + (long)Main_Window.BasePlayer.playerModel, (long)Main_Window.PlayerModel.velocity), false);
                     Aimbot.targetVel.X  = vector3_5.x;
                     Aimbot.targetVel.Y  = vector3_5.y;
                     Aimbot.targetVel.Z  = vector3_5.z;
                     Aimbot.targetVel   *= 6f;
                     Aimbot.distToTarget = SharpDX.Vector3.Distance(m_camera_position, vector3_3);
                     Aimbot.timeToTravel = Aimbot.distToTarget / Aimbot.Horizontal_Factor;
                     OverlayWindow1.getBoneScreen2(vector3_3, y);
                     if (Aimbot.Frame_Count == 0)
                     {
                         Aimbot.Target_Last_POS = vector3_2;
                         ++Aimbot.Frame_Count;
                     }
                     else
                     {
                         ++Aimbot.Frame_Count;
                         if (Aimbot.Frame_Count == 20)
                         {
                             Aimbot.PredictX    = Aimbot.Target_Last_POS.X - vector3_2.X;
                             Aimbot.PredictY    = Aimbot.Target_Last_POS.Y - vector3_2.Y;
                             Aimbot.PredictZ    = Aimbot.Target_Last_POS.Z - vector3_2.Z;
                             Aimbot.Frame_Count = 0;
                         }
                     }
                     if (Aimbot.targetVel != SharpDX.Vector3.Zero)
                     {
                         vector3_3.X -= Aimbot.PredictX * Aimbot.timeToTravel;
                         vector3_3.Z -= Aimbot.PredictZ * Aimbot.timeToTravel;
                     }
                     float num3 = Aimbot.distToTarget / Aimbot.DropFactor;
                     float num4 = Aimbot.Clamp(num3 * 30f, 1f, 1000f);
                     vector3_3.Y += (float)(0.0 * (double)num4 + (double)num3 * (double)num3);
                     SharpDX.Vector2 vector2 = Aimbot.CalcAngle3(m_camera_position, vector3_3);
                     MEMAPI.WriteFloat(Aimbot.BodyAngleX, vector2.X, false);
                     MEMAPI.WriteFloat(Aimbot.BodyAngleY, vector2.Y, false);
                 }
             }
             else
             {
                 Aimbot.Target_addr         = 0UL;
                 Aimbot.Target_Base_addr    = 0UL;
                 Aimbot.bone_transform_addr = 0UL;
                 Aimbot.HasTarget           = false;
             }
             if (num2 == 64 || !ValidAddress)
             {
                 Aimbot.Target_addr         = 0UL;
                 Aimbot.Target_Base_addr    = 0UL;
                 Aimbot.bone_transform_addr = 0UL;
                 Aimbot.HasTarget           = false;
             }
         }
         else
         {
             Aimbot.Target_addr         = 0UL;
             Aimbot.Target_Base_addr    = 0UL;
             Aimbot.bone_transform_addr = 0UL;
             Aimbot.HasTarget           = false;
         }
         Thread.Sleep(1);
     }
 }