PDA

View Full Version : Help with external Triggerbot



mantarochen
06-27-2011, 02:48 PM
Hey guys, I began learning C++ the last weeks and i want to make a little external Triggerbot for counter strike source.
I have a piece of source code, a bit copy and paste and a bit of my own, but the problem is, i don't know every command of this code.


#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <conio.h>

using namespace std;
BYTE offset[2] = { 0x14, 0x50 };
int main()
{
cout << "Triggerbot" << endl << "by Manta" << endl << endl << endl << "searching Counter-Strike Source";
Sleep(1000);
cout << ".";
Sleep(500);
cout << ".";
Sleep(500);
cout << ".";
HWND cstrike = NULL;
while( cstrike == NULL )
{
cstrike = FindWindow(NULL, L"Counter-Strike Source");
Sleep(100);
}
cout << "Counterstrike Source found" << endl;


DWORD prozessid;
GetWindowThreadProcessId(cstrike, &prozessid);

HANDLE handleprozess;
handleprozess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, prozessid);

DWORD puffer = NULL;
ReadProcessMemory(handleprozess,(void*)(0x1CB5ED50),&offset,sizeof(offset),&puffer);

int x;
cin >> x;

CloseHandle(handleprozess);


}
This code is based on a tutorial of external triggerbot by sMp.
It reeds the enemy team by looking in the radarstruct ( correct me if I'm wrong).
The offsets are outdated and i don't know for which offsets i have to look for and i don't know how to go on after the trigger finds cstrike window and get processid.
Please be patient with me, I'm just learning it and i don't know where to ask :D
Thanks in advance
Manta

_sMp
06-27-2011, 03:11 PM
There are certain ConVars that block this kind of Triggerbots.
I suggest you try another approach.

DrD
06-27-2011, 04:33 PM
Added to the above post, this method isn't very fast for a triggerbot. But if you want to learn, here's how you would go about this type. First you need to find the base of your client.dll when it is loaded by hl2.exe(GetModuleBaseExtern should help you). Then you will need to find the entity index offset which is what you will use to see if the crosshair is over an enemy. Next you need the localplayer base address if you plan on adding any sort of check to see if you should fire, such as if you are alive, ammo count, what gun you are using. It's not a good way to do a triggerbot, so you should look at other methods.

mantarochen
06-28-2011, 08:28 AM
Thanks, i will try an other method. If I have any questions I will post it :D
Manta