Trigger Bot [C++]

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
If u want to make a trigger bot, here is a c++ code for the ones who face problem in memory reading and writing etc..

if you are here to c&p go away.
if u are creating a .asi or .dll (your luck is here c&p guys :D)
Code:
int rem[5]; // Create a array
 rem[0] = *(int *)0xB6F3B8; // read 0xB6F3B8 (size 4)
rem[1] = rem[0]; // set rem[1] value to rem[0]'s
rem[1] += 0x79C; // add 0x79C in rem[1]'s value
if(*(int *)rem[1] > 0) // check if rem[1] reading is more than 0 (this address is for the ped which has green triangle above the head(aim one))
{
INPUT    Input={0};  // if there was a ped, create a input
Input.type        = INPUT_MOUSE;  // set the input type to input mouse
Input.mi.dwFlags  = MOUSEEVENTF_LEFTDOWN; // set the flag to mouse event, left button key hold
SendInput( 1, &Input, sizeof(INPUT) );  // send the input
Sleep(100); // sleep for 100 ms or change to 150 if you want
ZeroMemory(&Input,sizeof(INPUT));  
Input.type        = INPUT_MOUSE;  // do that all above again but this time, event is to release the left button key
Input.mi.dwFlags  = MOUSEEVENTF_LEFTUP; 
SendInput( 1, &Input, sizeof(INPUT) );  // send it
} // hooray your trigger bot is done
if you want to add into s0biet or your project (do not use the above for s0b because ur game will hang if you use sleep() or loops in game threads)
Create variables:
bool triggerbot - Toggle
bool tBot_Release = false; - explained in code
DWORD tBot_LastTick = -1; - explained in code
Code:
if(set.triggerbot) // change the variable to your trigger bot one
 {
if(tBot_Release == true && tBot_LastTick != -1 && tBot_LastTick < (GetTickCount() - 50))  // check if release variable is true and the last tick is not -1 and 50 ms has passed
{
INPUT Input={0}; // create a input
ZeroMemory(&Input,sizeof(INPUT)); // set it to zero       
Input.type        = INPUT_MOUSE;  // input type to mouse
Input.mi.dwFlags  = MOUSEEVENTF_LEFTUP;  // event to release a.k.a up
SendInput( 1, &Input, sizeof(INPUT) );  // send it
tBot_Release = false; // reset our vars
tBot_LastTick = -1;
}
int rem[5]; // create a array
rem[0] = *(int *)0xB6F3B8; // read 0xB6F3B8
rem[1] = rem[0]; // assign rem[0] value to rem[1]
rem[1] += 0x79C; // add 0x79C to rem[1]
if(*(int *)rem[1] > 0) // read rem1 and check if it is more than 0 (ped with triangle)
{
INPUT    Input={0};  // create input
Input.type        = INPUT_MOUSE;  // input type is mouse as always
Input.mi.dwFlags  = MOUSEEVENTF_LEFTDOWN;  // hold the key a.k.a down
SendInput( 1, &Input, sizeof(INPUT) );  // send it
tBot_LastTick = GetTickCount(); // get current tick count and set it at tBot_LastTick
tBot_Release = true; // set the state to release key
}
}
Credits:
opcode.exe's cleo trigger bot for memory addresses

We really need to revive this section asf, this is dying.
no matter what you have to make or add, just post IT!
:fuck_yea:
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
Well done! Helpful for novice that can't find right memory addreses (like me xD)
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
supahdupahnubah said:
Well done! Helpful for novice that can't find right memory addreses (like me xD)

the same I found but I just got to understand how to edit addresses in dll project..
btw 
size 4 = int
size 6 = long
size 2 = short
I'm not actually sure but a guy told me this ^
You can make a rapid fire easily.
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
0x32789 said:
supahdupahnubah said:
Well done! Helpful for novice that can't find right memory addreses (like me xD)

the same I found but I just got to understand how to edit addresses in dll project..
btw 
size 4 = int
size 6 = long
size 2 = short
I'm not actually sure but a guy told me this ^
You can make a rapid fire easily.

Nah, I know you can edit Dll's bytes to do some changes (if you talk about compiled dlls, right?)
Btw I can't understand how do I get bytes from this memory address (i'm trying to do it on C#), I always get 0 even if I aim at someone, so rapid fire is another story for me xD
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
supahdupahnubah said:
0x32789 said:
supahdupahnubah said:
Well done! Helpful for novice that can't find right memory addreses (like me xD)

the same I found but I just got to understand how to edit addresses in dll project..
btw 
size 4 = int
size 6 = long
size 2 = short
I'm not actually sure but a guy told me this ^
You can make a rapid fire easily.

Nah, I know you can edit Dll's bytes to do some changes (if you talk about compiled dlls, right?)
Btw I can't understand how do I get bytes from this memory address (i'm trying to do it on C#), I always get 0 even if I aim at someone, so rapid fire is another story for me xD

cool, I just started c# yesterday and started learning it.
IDK how I should do it in c# try using google..
c# is different from c++, no dwords and easy peasy things :'  :sadpepe:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
The green marker has a lifetime like 3 seconds or so, you could find the memory value for it and lower it so it will be more accurate.

You can use [ shcode=cpp] <code> [ /shcode] so your snippet will be easier to read.
A shorter way would be;
[shcode=cpp]
if (*(void **)(*(int *)0xB6F3B8 + 0x79C))
{
    INPUT Input = { INPUT_MOUSE, 0, 0, 0, MOUSEEVENTF_LEFTDOWN, 0, 0 };
    SendInput(1, &Input, sizeof(INPUT));
    Sleep(100);
    Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
    SendInput(1, &Input, sizeof(INPUT));
}
[/shcode]
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
The green marker has a lifetime like 3 seconds or so, you could find the memory value for it and lower it so it will be more accurate.

You can use [ shcode=cpp] <code> [ /shcode] so your snippet will be easier to read.
A shorter way would be;
[shcode=cpp]
if (*(void **)(*(int *)0xB6F3B8 + 0x79C))
{
    INPUT Input = { INPUT_MOUSE, 0, 0, 0, MOUSEEVENTF_LEFTDOWN, 0, 0 };
    SendInput(1, &Input, sizeof(INPUT));
    Sleep(100);
    Input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
    SendInput(1, &Input, sizeof(INPUT));
}
[/shcode]
Yea I just took a look into 0pcode.exe's cleo triggerbot and figured out that you can set the value of 0xB6F3B8 + 0x79C to 0 after you shoot, so it should not draw the triangle anymore
I didn't test it, but will it draw triangle again if the crosshair is on player? 
In some cases you can get busted on video if you will use this triggerbot because triangle will disappear after you shot

Btw is there any memory addresses for targeted player color? Didn' find it tho
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
If it's on the player it should, yes.
There's some info here; http://ugbase.eu/Thread-Memory-Addresses?pid=50300#pid50300
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
If it's on the player it should, yes.
There's some info here; http://ugbase.eu/Thread-Memory-Addresses?pid=50300#pid50300

Thanks for the reply, do you know what address contains player colornickname? Or offset etc
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
I assume sa-mp players? Look in mod_sa project
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L30
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.cpp#L231
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
springfield said:
I assume sa-mp players? Look in mod_sa project
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.h#L30
https://github.com/BlastHackNet/mod_s0beit_sa/blob/master/src/samp.cpp#L231
Big thanks!
 
Top