Aimbot, smooth math [C++]

Bugman

Active member
Joined
Aug 14, 2014
Messages
68
Reaction score
0
Hello Friends

i used this snippet here for a long time.
did anyone know, how to add a smooth to this aimbot here?

needed to remove the lock/ugly  reaction when using aimbot



Code:
#include "stdafx.h"
#include <windows.h>
#include <math.h>
 
void main() 
{
   DWORD* pTarget = (DWORD*)0xB6F3B8;//pointer of target object.
   DWORD* pActor = (DWORD*)0xB6F5F0;//pointer of player actor 
   DWORD* pCamera = (DWORD*)0xB6F99C;//camera pointer
   float* camXpos = (float*)0xB6F258;//writeable camera Z angle 
 
   while(1)
  {
    
    if(*pActor > 0) 
        {
         char* pVehicle = (char*)((*pActor) + 0x46C);
         if(*pVehicle != 1) 
         {
             DWORD* pMtrx1 = (DWORD*)((*pActor) + 0x14);//matrix of player actor 
             float* xPos1 = (float*)((*pMtrx1) + 0x30);//player actor X position 
             float* yPos1 = (float*)((*pMtrx1) + 0x34);//player actor Y position 
    
             float* CxPos1 = (float*)(0xB6F9CC);//camera X position  
             float* CyPos1 = (float*)(0xB6F9D0);//camera Y position 
        
             float xPoint = *CxPos1;
             float yPoint = *CyPos1;
        
             int* keyt = (int*)0xB7347A;//Left mouse key
             DWORD* pPed = (DWORD*) ((*pTarget) + 0x79C);//pointer to target player  
          
            if(*pPed > 0) {
                  
                  DWORD* pMtrx2 = (DWORD*)((*pPed) + 0x14);//matrix of target player 
                  float* xPos2 = (float*)((*pMtrx2) + 0x30);//X position 
                  float* yPos2 = (float*)((*pMtrx2) + 0x34);//Y position
          
                   float xPos2a;
                   float yPos2a;
        
                   float* playerHP = (float*)((*pPed) + 0x540);//health of target player
                   if(*playerHP > 0){
                
                      xPos2a = *xPos2;
                      yPos2a = *yPos2;
             
                      float Aa = fabs(xPoint-xPos2a);
                      float Ab = fabs(yPoint-yPos2a);
                      float Ac = sqrt(Aa*Aa+Ab*Ab);
                      float alpha = asin(Aa/Ac);
                      float beta = acos(Aa/Ac);
  
                     if((*xPos1 > *xPos2)&&(*yPos1 < *yPos2)){beta = -beta;}//1 part
                     if((*xPos1 > *xPos2)&&(*yPos1 > *yPos2)){beta = beta;}//2 part
                     if((*xPos1 < *xPos2)&&(*yPos1 > *yPos2)){beta = (alpha + (1.5707));}//3 part
                     if((*xPos1 < *xPos2)&&(*yPos1 < *yPos2)){beta = (-alpha - (1.5707));}//4 part
               
                     if(*keyt > 0){
                         *camXpos = beta+0.0389;//for deagle.
                     }
                }
             }
        }
    }
    Sleep(10);
  }
ExitThread(0);
}
 
 
BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved) 
{
if(callReason == DLL_PROCESS_ATTACH) 
{
 CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&main, 0, 0, 0);
}
return 1;
}


thanks in advance guys ;)
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,488
Reaction score
231
Location
( ͡° ͜ʖ ͡°)
_asm push opi

Instread of copypasta you just create your own calculation which gets the new angle with step towards the target
 

Dev_Grab

Member
Joined
Jun 17, 2016
Messages
6
Reaction score
0
Code:
void CESP::Aimbot(void)
{
	if (GetAsyncKeyState(0x02))
	{
		for (int i = 1; i < 130; i++)
		{
			if (Functions.Distance(Matrix[0].Position, Matrix[i].Position) < 1000)
			{
				D3DXVECTOR3 footPosition, footScreen, headPosition, headScreen;

				footPosition.x = Matrix[i].Position.x;
				footPosition.y = Matrix[i].Position.y;
				footPosition.z = Matrix[i].Position.z - 1.0;

				headPosition.x = Matrix[i].Position.x;
				headPosition.y = Matrix[i].Position.y;
				headPosition.z = Matrix[i].Position.z + 0.9;

				if (Functions.WorldToScreen(&footPosition, &footScreen) && Functions.WorldToScreen(&headPosition, &headScreen))
				{
					int Height = footScreen.y - headScreen.y;
					int Width = Height / 2.5;

					int CrosshairX, CrosshairY;

					CrosshairX = DirectX.Width / 1.885;
					CrosshairY = DirectX.Height / 2.50;

					if (Functions.WeaponSlot[0] == 6)
					{
						CrosshairX = DirectX.Center.x;
						CrosshairY = DirectX.Center.y;
					}

					float Difference, Smooth;

					if ((CrosshairX > headScreen.x - (Width * 2) && CrosshairX < headScreen.x + (Width * 2)) && (CrosshairY > headScreen.y && CrosshairY < headScreen.y + Height))
					{
						if (Menu.Items[CHEAT_AIMBOT].Value)
						{
							if (Menu.Items[CHEAT_AUTOSHOT].Value)
								CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Shot, 0, 0, 0);

							DWORD KameraX = 0xB6F9CC;
							DWORD KameraY = 0xB6F9D0;

							float * ViewX = (float*)0xB6F258;

							D3DXVECTOR3 Position, Camera;

							Camera.x = *(float*)KameraX;
							Camera.y = *(float*)KameraY;

							Position.x = Camera.x - headPosition.x;
							Position.y = Camera.y - headPosition.y;

							if (Functions.WeaponSlot[0] == 6)
							{
								Position.x = Matrix[0].Position.x - headPosition.x;
								Position.y = Matrix[0].Position.y - headPosition.y;
							}

							float Dist = sqrt((Position.x * Position.x) + (Position.y * Position.y));
							float One = acosf(Position.x / Dist);

							if (Position.x <= 0.0 && Position.y >= 0.0 || Position.x >= 0.0 && Position.y >= 0.0)
							{
								if (Functions.WeaponSlot[0] == 6)
									Difference = (One)-*ViewX;
								else
									Difference = (One + 0.0390) - *ViewX;

							}

							if (Position.x >= 0.0 && Position.y <= 0.0 || Position.x <= 0.0 && Position.y <= 0.0)
							{
								if (Functions.WeaponSlot[0] == 6)
									Difference = (-One) - *ViewX;
								else
									Difference = (-One + 0.0390) - *ViewX;
							}

							Smooth = Difference / Menu.Items[CHEAT_SMOOTH].Value;

							if (Smooth > -1.0 && Smooth < 0.5 && Difference > -2.0 && Difference < 2.0)
								*ViewX += Smooth;
						}
					}
				}
			}
		}
	}
}
Simply copy paste the sauce into notepad and save as executable.  :pPFFH:
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Take your current aim position and your target aim position and subtract one from the other, then divide the result by 10 put the result in a variable then loop 10 times each time while aiming at your position + the value you calculated earlier.


ps: increase the number you divided it with for more smoothness.
 
Top