Quantcast
Channel: D3Scene
Viewing all articles
Browse latest Browse all 21080

Help with Trigger Bot Aim Correction

$
0
0
Hi, I have a few problems with a private aimbot. For one, if the target is crouching they are typically invulnerable because the bot aims for head. The second problem is that sometimes the bot aims too far left or right. Besides some minor adjustments, I did not write the code for the calculations because my understanding of linear algebra is somewhat limited. If you guys have any advice or suggestions I would greatly appreciate it!

Code:

void writeAngle(const player currentPlayer, const player target)
{
        float ang[3] = { 0 };




    double delta[3] = {
                currentPlayer.pos[0] - target.pos[0] + 5,
                currentPlayer.pos[1] - target.pos[1],
                currentPlayer.pos[2]- target.pos[2],
               
        };


    double hyp = sqrt( delta[0]*delta[0] + delta[1]*delta[1] );


    ang[0] = (float) (atan(delta[2]/hyp) * RADPI);
    ang[1] = (float) (atan(delta[1]/delta[0]) * RADPI);


    if( delta[0] >= 0.0f ) 
                ang[1] += 180.0f;


    ang[2] = 0.0f;


    ang[0] = clamp(ang[0], -89, 89);
        if (ang[1] > 180)
                ang[1] = (0 - ang[1]) + (ang[1] - 180) * 2;
        else
                ang[1] = clamp(ang[1], -180, 180);


        WriteProcessMemory( worker.hProcess, (LPVOID)(worker.dwEngine + 0x458D04), ang, sizeof(ang), NULL );
}

Thanks.

Viewing all articles
Browse latest Browse all 21080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>