示例#1
0
        internal static void Run()
        {
            Structure.Entity Entity = new Structure.Entity();

            for (; ;)
            {
                if (Utils.ClientState.GameState != 6 || !Settings.SwitchTrigger || !Utils.IsWindowFocused)
                {
                    Thread.Sleep(2000);
                    continue;
                }

                Thread.Sleep(2);

                if (Utils.LocalPlayer.CrosshairID > 0 && Utils.LocalPlayer.CrosshairID <= 32)
                {
                    Entity.Base = Memory.Read <int>(Structure.Base.Client + Offset.dwEntityList + (Utils.LocalPlayer.CrosshairID - 1) * 0x10);
                    Entity.Team = Utils.GetTeam(Entity.Base);

                    if (Entity.Team != Utils.LocalPlayer.Team && WinAPI.GetAsyncKeyState(Settings.TriggerKey) == -32768 && WinAPI.GetAsyncKeyState(1) == 0)
                    {
                        Thread.Sleep(Settings.TriggerDelay);
                        WinAPI.mouse_event(Utils.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                        Thread.Sleep(1);
                        WinAPI.mouse_event(Utils.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                    }
                }
            }
        }
示例#2
0
        internal static void Run()
        {
            Structure.Entity Enemy = new Structure.Entity();
            int Kills = 0;
            var Aim   = (FOV : 0f, Smooth : 0f, AimBone : 0, YawRecoil : 0f, PitchRecoil : 0f);

            void SetConfig(float Fov, float Smooth, int Bone, float yRec, float pRec)
            {
                Aim.FOV         = Fov;
                Aim.Smooth      = Smooth;
                Aim.AimBone     = Bone;
                Aim.YawRecoil   = yRec;
                Aim.PitchRecoil = pRec;
            }

            for (; ;)
            {
                if (Utils.ClientState.GameState != 6 || !Settings.SwitchAim || !Utils.IsWindowFocused)
                {
                    Thread.Sleep(2000);
                    continue;
                }

                if (Utils.LocalPlayer.Kills != Kills)
                {
                    Thread.Sleep(Settings.KillDelay);
                    Kills = Utils.LocalPlayer.Kills;
                }

                Thread.Sleep(8);

                if (WinAPI.GetAsyncKeyState(Settings.AimKey) == -32768)
                {
                    byte[] Entities = Memory.ReadMemory((Structure.Base.Client + Offset.dwEntityList), 32 * 0x10);
                    Dictionary <float, Vector3> PossibleTargets = new Dictionary <float, Vector3> {
                    };

                    if (Utils.WeaponRifle.Contains(Utils.CurrentWeapon))
                    {
                        SetConfig(Settings.Rifles_FOV, Settings.Rifles_Smooth,
                                  Settings.Rifles_Bone,
                                  Settings.Rifles_YawRecoil, Settings.Rifles_PitchRecoil);
                    }
                    else if (Utils.WeaponPistols.Contains(Utils.CurrentWeapon))
                    {
                        SetConfig(Settings.Pistols_FOV, Settings.Pistols_Smooth,
                                  Settings.Pistols_Bone,
                                  Settings.Pistols_YawRecoil, Settings.Pistols_PitchRecoil);
                    }
                    else if (Utils.WeaponSMGs.Contains(Utils.CurrentWeapon))
                    {
                        SetConfig(Settings.SMGs_FOV, Settings.SMGs_Smooth,
                                  Settings.SMGs_Bone,
                                  Settings.SMGs_YawRecoil, Settings.SMGs_PitchRecoil);
                    }
                    else
                    {
                        continue;
                    }

                    for (int EntityCounter = 1; EntityCounter < 32; EntityCounter++)
                    {
                        Enemy.Base   = Utils.GetInt(Entities, EntityCounter * 0x10);
                        Enemy.Health = Utils.GetHP(Enemy.Base);
                        Enemy.Flags  = Utils.GetFlags(Enemy.Base);

                        if (Enemy.Flags == 774 || Enemy.Health <= 0 || !EntIsVisible(Enemy.Base, Utils.LocalPlayer.Base))
                        {
                            continue;
                        }

                        Vector3 bonePosition = Calculations.GetBonePos(Enemy.Base, Aim.AimBone);
                        if (bonePosition == Vector3.Zero)
                        {
                            continue;
                        }

                        Utils.LocalPlayer.Position = Utils.GetPosition(Utils.LocalPlayer.Base);
                        Utils.LocalPlayer.AimPunch = Utils.GetAimPunch(Utils.LocalPlayer.Base);
                        Utils.LocalPlayer.VecView  = Utils.GetVecView(Utils.LocalPlayer.Base);

                        Vector3 destination = Settings.AimRecoilHelper
                            ? Calculations.CalcAngle(Utils.LocalPlayer.Position, bonePosition, Utils.LocalPlayer.AimPunch, Utils.LocalPlayer.VecView, Aim.YawRecoil, Aim.PitchRecoil)
                            : Calculations.CalcAngle(Utils.LocalPlayer.Position, bonePosition, Utils.LocalPlayer.AimPunch, Utils.LocalPlayer.VecView, 0f, 0f);

                        if (destination == Vector3.Zero)
                        {
                            continue;
                        }

                        Utils.ClientState.Base       = Memory.Read <int>(Structure.Base.Engine + Offset.dwClientState);
                        Utils.ClientState.ViewAngles = Memory.Read <Vector3>(Utils.ClientState.Base + Offset.dwClientState_ViewAngles);

                        float distance = Calculations.GetDistance3D(destination, Utils.ClientState.ViewAngles);

                        if (!(distance <= Aim.FOV))
                        {
                            continue;
                        }
                        PossibleTargets.Add(distance, destination);
                    }

                    if (!PossibleTargets.Any())
                    {
                        continue;
                    }

                    Vector3 aimAngle = PossibleTargets.OrderByDescending(x => x.Key).LastOrDefault().Value;

                    aimAngle = Calculations.NormalizeAngle(aimAngle);
                    aimAngle = Calculations.ClampAngle(aimAngle);

                    Memory.Write <Vector3>(Utils.ClientState.Base + Offset.dwClientState_ViewAngles, Aim.Smooth == 0f ? aimAngle : Calculations.SmoothAim(Utils.ClientState.ViewAngles, aimAngle, Aim.Smooth));
                }
            }
        }
示例#3
0
        internal static void Run()
        {
            Structure.Entity Enemy = new Structure.Entity();

            for (; ;)
            {
                if (Utils.ClientState.GameState != 6 || !Settings.SwitchGlow || !Utils.IsWindowFocused)
                {
                    Thread.Sleep(2000);
                    continue;
                }

                Thread.Sleep(8);

                byte[] Entities = Memory.ReadMemory(Utils.GlowObj, Utils.GlowObjCount * 0x38);

                for (int EntityCounter = 0; EntityCounter < Utils.GlowObjCount; EntityCounter++)
                {
                    int CurrentEntity = Utils.GetInt(Entities, EntityCounter * 0x38);
                    if (CurrentEntity == 0)
                    {
                        continue;
                    }

                    int classID = Utils.GetClassID(CurrentEntity);
                    if (classID < 0)
                    {
                        continue;
                    }

                    switch (classID)
                    {
                    case 40:     //ppl
                        Enemy.Team   = Utils.GetTeam(CurrentEntity);
                        Enemy.Health = Utils.GetHP(CurrentEntity);

                        if (Enemy.Team != Utils.LocalPlayer.Team)
                        {
                            Write(Utils.GlowObj, EntityCounter, 255.0f - Enemy.Health * 2.55f, Enemy.Health * 2.55f, 0f, 65f);
                        }
                        break;

                    case 1:     //ak
                        Write(Utils.GlowObj, EntityCounter, 0f, 255f, 0f, 65f);
                        break;

                    case 248:     //m4
                        Write(Utils.GlowObj, EntityCounter, 200f, 200f, 110f, 65f);
                        break;

                    case 231:     //aug
                        Write(Utils.GlowObj, EntityCounter, 0f, 255f, 255f, 65f);
                        break;

                    case 232:     //awp
                        Write(Utils.GlowObj, EntityCounter, 255f, 0f, 255f, 65f);
                        break;

                    case 264:     //sg553
                        Write(Utils.GlowObj, EntityCounter, 0f, 255f, 155f, 65f);
                        break;

                    case 266:     //ssg08
                        Write(Utils.GlowObj, EntityCounter, 200f, 165f, 155f, 65f);
                        break;

                    case 34:     //c4
                        Write(Utils.GlowObj, EntityCounter, 255f, 255f, 155f, 75f);
                        break;

                    case 128:     //c4planted
                        Write(Utils.GlowObj, EntityCounter, 0f, 55f, 255f, 75f);
                        break;
                    }
                }
            }
        }