public static void BAlternate() { IntPtr moduleAddr = module; IntPtr Offset = module + Statics.signatures.dwLocalPlayer; int player = m.DeployRope <int>(Offset); int current = 0x420; Offset = (IntPtr)player + Statics.netvars.m_vecOrigin; float[] pos = m.DeployRopes <float>(Offset, 3); pos[2] += m.DeployRope <float>((IntPtr)player + Statics.netvars.m_vecViewOffset + 0x8); Offset = (IntPtr)player + Statics.netvars.m_aimPunchAngle; float[] punch = m.DeployRopes <float>(Offset, 3); float[] angles = new float[3]; int cId = m.DeployRope <int>((IntPtr)player + Statics.netvars.m_iCrosshairId); int team = 0; int h = 0; int myTeam = m.DeployRope <int>((IntPtr)player + Statics.netvars.m_iTeamNum); while (GetAsyncKeyState(Keys.LButton) != 0) { if (cId >= 0 && cId >= 65) { double dist = 999999.0f; current = m.DeployRope <int>(moduleAddr + Statics.signatures.dwEntityList + (cId - 1) * 0x10); // current = Closest(GetMyPosition(player, m), 32, (int)moduleAddr, myTeam, ref dist); team = m.DeployRope <int>((IntPtr)current + Statics.netvars.m_iTeamNum); h = m.DeployRope <int>((IntPtr)current + Statics.netvars.m_iHealth); if (h > 0 && team != myTeam) { float[] bonePos = GetBonePos(current, 8); SimpleMath.CalcAngles(pos, bonePos, angles); angles[0] -= punch[0] * 2.0f; angles[1] -= punch[1] * 2.0f; SimpleMath.ClampAngles(angles); int fAttack = (int)moduleAddr + Statics.signatures.dwForceAttack; IntPtr engineState = m.GetInsufficentMaterials("engine.dll"); int clientState = m.DeployRope <int>((IntPtr)engineState + Statics.signatures.dwClientState); m.CraftRope <float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles, angles, 0); // m.CraftRope<int>((IntPtr)fAttack, 1); //Thread.Sleep(1); //m.CraftRope<int>((IntPtr)fAttack, 2); } } } }
public static void AimAt(int entity, int boneId, int pEntity, int moduleAddr) { int addrTemp = pEntity + Statics.netvars.m_aimPunchAngle; int engineState = (int)m.GetInsufficentMaterials("engine.dll"); float[] punch = SimpleMath.Multiply(m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>()), 2); addrTemp = pEntity + Statics.netvars.m_vecOrigin; float[] eyePos = m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>()); eyePos[2] += m.DeployRope <float>((IntPtr)(pEntity + Statics.netvars.m_vecViewOffset + 0x8)); int clientState = m.DeployRope <int>((IntPtr)engineState + Statics.signatures.dwClientState); /* float oAng1 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles); * float oAng2 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x4); * float oAng3 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x8); * Vector3D oAng = new Vector3D(); * oAng.X = oAng1; * oAng.Y = oAng2; * oAng.Z = oAng3;*/ float[] oAng = m.DeployRopes <float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles, 0); Console.WriteLine("" + string.Join("; ", oAng)); float[] newAngles = SimpleMath.Normalized( SimpleMath.SmoothnNormalize(oAng, SimpleMath.DifferenceBetween(punch, SimpleMath.Normalized(SimpleMath.CalculateAngles(eyePos, GetBonePos(entity, boneId)) )), 20)); Console.WriteLine("" + string.Join("; ", newAngles)); float[] nAng = newAngles; m.CraftRope <float>((IntPtr)(clientState + Statics.signatures.dwClientState_ViewAngles), nAng, 0); }
public static void BCircle(IntPtr moduleAddr) { int currentTarget = 0x420; int entity = 0; entity = m.DeployRope <int>((moduleAddr + Statics.signatures.dwLocalPlayer)); int addr = (int)moduleAddr + Statics.signatures.dwEntityList; int team = 0; int ourTeam = m.DeployRope <int>((IntPtr)(entity + Statics.netvars.m_iTeamNum)); int closest = 0; float cDist = 0.0f; int cId = 0; int addrTemp = entity + 0x302C; int engineState = (int)m.GetInsufficentMaterials("engine.dll"); float[] punch = SimpleMath.Multiply(m.DeployRopes <float>((IntPtr)addrTemp, 3), 2); Console.WriteLine("Punch: " + string.Join("; ", punch)); addrTemp = entity + Statics.netvars.m_vecOrigin; float[] eyePos = m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>()); eyePos[2] += m.DeployRope <float>((IntPtr)(entity + Statics.netvars.m_vecViewOffset + 0x8)); //Console.WriteLine("Position: " + string.Join("; ", eyePos)); int clientState = m.DeployRope <int>((IntPtr)engineState + Statics.signatures.dwClientState); /* DWriteText newD = new DWriteText($"Searching for Target!" + * $"\nClosest Entity Address: {currentTarget}" + * $"\nClosest Entity Team: {team}" + * $"\nOur Position: {string.Join(','.ToString(), eyePos)}" + * $"\nPunch Angle: {string.Join(','.ToString(), punch)}" * ); * newD.Draw(Screen.PrimaryScreen.Bounds.Top, Screen.PrimaryScreen.Bounds.Left);*/ if (GetAsyncKeyState(Keys.LButton) != 0) { int health = 0; if (currentTarget == 0x420) { cId = m.DeployRope <int>((IntPtr)(entity + Statics.netvars.m_iCrosshairId)); currentTarget = m.DeployRope <int>((IntPtr)(addr + (cId - 1) * 0x10)); team = m.DeployRope <int>((IntPtr)(currentTarget + Statics.netvars.m_iTeamNum)); } health = m.DeployRope <int>((IntPtr)(currentTarget + Statics.netvars.m_iHealth)); if (ourTeam != team && health > 0 && cId >= 0 && cId < 65 && currentTarget != 0x420) //ako celta ima validni parametri za igrach { // Console.WriteLine("Client State: " + clientState); /* float oAng1 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles); * float oAng2 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x4); * float oAng3 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x8); * Vector3D oAng = new Vector3D(); * oAng.X = oAng1; * oAng.Y = oAng2; * oAng.Z = oAng3;*/ // float[] oAng = m.DeployRopes<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles, 3); //Console.WriteLine("" + string.Join("; ", oAng)); // float[] newAngles = SimpleMath.Normalized( // SimpleMath.SmoothnNormalize(oAng, // SimpleMath.DifferenceBetween(punch, // SimpleMath.Normalized(SimpleMath.CalculateAngles(eyePos, GetBonePos(entity, new Random().Next(0, 48))) // )), 20)); // float[] calcAng = SimpleMath.CalculateAngles(eyePos, GetBonePos(currentTarget, new Random().Next(0, 38))); // float[] normalized = SimpleMath.Normalized(calcAng); // float[] diff = SimpleMath.DifferenceBetween(punch, normalized); // float[] smth = SimpleMath.SmoothnNormalize(oAng, diff, 20); // float[] norm2 = SimpleMath.Normalized(smth); // float[] nAng = norm2; // m.CraftRope<float>((IntPtr)(clientState + Statics.signatures.dwClientState_ViewAngles), nAng, 0); //Console.WriteLine("" + string.Join("; ", nAng)); AimAt(currentTarget, 6, entity, (int)module); } else if ((cId < 1 || cId >= 65)) { currentTarget = 0x00; } } else { currentTarget = 0x00; } }