Solved CSGO TriggerBot slow response

  • CSGO recently moved logic from 'client_panorama.dll' to 'client.dll', you must update all code that uses 'client_panorama.dll' and replace it with 'client.dll' or the code will not work.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

TriggerHappyHog

Newbie
Full Member
Feb 3, 2015
10
114
0
So i made my first triggerbot for csgo and it seems really slow 60% of the time to a point where there is no real point in using it I heard that this could happen because

your delay can be caused if your loops aren't updating at the time / just before you call void trger
but I don't really know what this means or how to fix it, any help?

my trigger function currently looks like this.

C++:
//TRGR FUNCTION
void trger()
{
	DWORD ClientDLL;
	DWORD LocalPlayer = Z.Read<DWORD>(ClientDLL + playerBase);
	int LocalTeam = Z.Read<int>(LocalPlayer + tOffset);
	int CrossHairID = Z.Read<int>(LocalPlayer + crosshairOffset);
	DWORD EnemyVisable = Z.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist));
	int EHealth = Z.Read<int>(EnemyVisable + hOffset);
	int ETeam = Z.Read<int>(EnemyVisable + tOffset);
	int trgerDelay = 1; //Response Time

	if (LocalTeam = ETeam && EHealth > 0)
		mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
		Sleep(trgerDelay); //Response Time
		mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
	}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Basically you need a bigger delay before releasing the key press so that, when the game function that detects key presses executes it detects the mouse button as down not up.

I use a different thread to do the shooting so that I don't wait for my other code to finish before shooting. This is more information than you need and is for internal hack but thought it would be helpful

Here's my function that sorts my target list, verifies the target is good and sets a bool bShooting to true when all conditions are satisfied:
C++:
    void sortAimShoot()
    {
        targets.clear();
        for each(PlayerClass p in playerVector)
        {
            if (p.ent == nullptr || p.ent->state != 0 || m_teammode && p.ent->team == localPlayer->team)
            {
                continue;
            }

            if (!p.IsVisible())
            {
                continue;
            }
            targets.push_back(p);
        }

        //sort targets Vector by angle
        for (PlayerClass &p : targets)
        {
            p.vAimbotAngles = CalcAngle(localPlayer->vHead, p.ent->vHead);
            p.fAngleFromCross = DifferenceOfAngles(p.vAimbotAngles, localPlayer->vViewAngle);
        }

        sort(targets.begin(), targets.end(), playerSorter);

        if (!targets.empty())
        {
            target = targets[0];
            localPlayer->vViewAngle = target.vAimbotAngles;

            if (*localPlayer->weapon->gunWait == 0 && localPlayer->weapon->breload == false)
            {
                bShooting = TRUE;
            }
        }
    }
Then my shoot thread is executing concurrently and picks up the millisecond bShooting is true and does the key press:
C++:
    std::thread shootThread(shootThread);
    shootThread.detach();

void shootThread()
{
    INPUT leftMouseShoot = { 0 };
    while (1)
    {
        if (bShooting)
        {
            //press
            leftMouseShoot.type = INPUT_MOUSE;
            leftMouseShoot.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
            SendInput(1, &leftMouseShoot, sizeof(INPUT));

            std::this_thread::sleep_for(std::chrono::milliseconds(5));

            // Release
            leftMouseShoot.mi.dwFlags = MOUSEEVENTF_LEFTUP;
            SendInput(1, &leftMouseShoot, sizeof(INPUT));
            bShooting = false;
        }

        std::this_thread::sleep_for(std::chrono::milliseconds(1));

    }
}
5 Milliseconds was enough to register the keypress in AssaultCube

Also checkout our latest triggerbot tutorial for CSGO:
Cody's C++ CSGO Triggerbot Tutorial External Parts 1-2-3 - Guided Hacking
 
Last edited:

Alex

Sober linux neb
Dank Tier Donator
Nobleman
Nov 26, 2015
150
828
1
You might want to do a bigger delay, like 25ms and call it before and after the first shot, That's because mouse-event can bug out from time to time if you change states too fast.
 

Alex

Sober linux neb
Dank Tier Donator
Nobleman
Nov 26, 2015
150
828
1
And it's a bad idea to define variables in a func that gets called more than couple of times. but this shouldnt be a problem in this case.
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,745
40,528
316
And it's a bad idea to define variables in a func that gets called more than couple of times. but this shouldnt be a problem in this case.
No, it's faster to use local variables which are just stored in the stack (sub esp,SizeOfLocalVars) than passing those vars as arguments. And global variables are the worst un-dynamic slow cancer anyway.
If you have to do stuff with a big array don't allocate that on each call again of course.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods