View Full Version : Pure OpenGL TFC Autodet!!!!
DllMain
03-29-2003, 02:11 PM
Here is a simple and easy way to make an autodet hack PURELY IN OPENGL! No hook crap involved!
Now, we need to store the coordinates of our pipebombs of course, as
well as coordinates for storing players positions. So, make 6 floats, an
X Y Z Coordinate for each.
CODE:
float PipeX;
float PipeY;
float PipeZ;
float PipePlayerX;
float PipePlayerY;
float PipePlayerZ;
Now, we need a boolean flag to toggle the autodet, as well as detecting models.
code:
BOOL autodet=TRUE;
BOOL bModelDrawn;
Have it set to true at start to debug it without having to toggle it through a menu or whatever.
Now, we need a way to identify players and our pipebombs right? How I
did it was counting verticies in glVertex3f, you will see what I mean.
First we need a place to store the amount of verticies we are counting.
Code:
float DetCount;
First thing first, we need to set the model flag to TRUE when the games drawing a model. So, in glPushMatrix, add this:
Code:
bModelDrawn=TRUE;
in glPopMatrix add this:
Code:
bModelDrawn=FALSE;
Now we can get all our coordinates in glVertex3f.
Now in glvertex3f we have to increment detcount by 1. So in glvertex3f add this:
Code:
DetCount++;
Still in glVertex3f, we will grab the coordinates of the players. First
we need to check if a model is being drawn, and then check if its a
player model (Player models usually have over 600ish verticies) and then
place those coords into the floats we made earlier.
Code:
if(bModelDrawn)
{
if(DetCount>500)
{
if(z>-500)
{
if(z<800)
{
PipePlayerX=x;
PipePlayerY=y;
PipePlayerZ=z;
}
}
}
}
We also need to grab the coords of the pipebombs!
Still in glvertex3f:
Code:
if(autodet)
{
if( DetCount>50 && DetCount<60 )
{
PipeX=x;
PipeY=y;
PipeZ=z;
}
}
Note: There are 57 verticies in the pipebomb model, and I gave it some leeway with the >50 and <60 part.
NOTE: This method of grabbing coordinates works great for aimbots!
Now we have all the coords, and all we have to do is detonate pipes when someone gets close enough. In glPopMatrix:
Code:
if(autodet)
{
if(PipePlayerX - PipeX > 75)
{
if(PipePlayerY - PipeY > 75)
{
if(PipePlayerZ - PipeZ > 75)
{
//SEND FAKE RIGHT MOUSE CLICK
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
}
}
}
}
What this does is compares the location of the player and the pipes, and
when they are close enough sends a fake right mouse click which
detonates the pipes! Easy wasnt it? Reply if you need clarification, or
if I missed something, or if you get errors and I will gladly help you.
Or if you like my tutorials you can reply and let me know as well : )
amateur
03-29-2003, 02:31 PM
i
didnt make my own model detection (oc hack source was superior to my
best efforts) so my question is what would i use in ochack source for
player detection?
would it be bot.players.screenpos.x - y - z
or would it be bot.players.targetpos.x - y - z
or something else? still kinda new to this. :D
DllMain
03-29-2003, 02:33 PM
I have never even looked at oc hack so I wouldnt know, sorry : (
amateur
03-29-2003, 04:25 PM
its cool, thnx anyways - ill mess about and see if i can get it working.
did u get proper team detection working in tfc? cuz if u didnt your
teammates would trigger the det wouldnt they, but anyways if you did
manage it i would be interested to know how you did it. :D
DllMain
03-29-2003, 04:44 PM
Havent
got it yet, im working on it. I will probably end up checking the color
of a certain point on each model, and if its blue, the team will be 1,
if its red, team will be 2. : )
Spring
03-30-2003, 02:08 PM
similar
way I got my quake3 aimbot working, but it doesn't work very well there
because walls and models are drawn the same way and the most time my
bot is aiming at walls or items
how can I check if (vertexes) my target is moving ? this way I wanna prevent the aiming at walls bug
I want to do it purely in opengl
a short example would be nice thanks for your help
DllMain
03-30-2003, 02:41 PM
well,
i dont do quake 3, but maybe if you save their X Y Z coordinates from a
previous frame and compare them to the current ones, and if they are
different, then the target is moving.
nofeaR
08-25-2003, 03:31 PM
How about replace the mouse event to
gEngfuncs.pfnClientCmd("detpipe");
? :p
amateur
08-25-2003, 03:39 PM
this is ok if you have access to engfuncs - but if you have engfuncs team detection would also be relativly easy.
i myself am still struggling with the damned things (my brain hurts)
anyways enough about me but good idea for a client hack or gl with
engfuncs. :D
nofeaR
08-25-2003, 05:52 PM
lol
nofeaR
08-26-2003, 11:03 AM
but you need to bind mouse2 to +attack2 or detpipe
:o
No binding is done, just a mouseevent that does exactly what you'd expect it to do.
Terranaut
08-26-2003, 01:24 PM
Yes
it does what the "code" is supposed to do, but if your +attack2 key is
not the default (right mouse button) then this will not be an autodet.
It will perform whatever you have that key bound to. It is simple to
modify though if you just change this code:
//SEND FAKE RIGHT MOUSE CLICK
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
to simulate the pressing of your other key (the one bound to +attack2).
d4sh0rado
10-11-2003, 12:52 PM
hm, im not really sure, but dont u have to reset the vertice-counter variable? correct me if im wrong :>
exrazile
10-20-2003, 01:55 PM
yea, you set it back to 0 in glPushMatrix.
My question is this: How can i check wether or not a pipe is blue or green?
I dont care so much about the player being red or blue,
But if you'd like to help by all means do!
I'd want to set "bool greenpipe" to true,
So i dont waste my time detting my blues.
Distinguishing these colors: red, green, and blue,
Is a task i leave all up to you.
- poem by ExRaZiLe
edit: I just realized that your method to detect the pipes will not
work. Lets say a model has 100 vertices... when it gets to 50 verticies,
your code will classify it as a pipe. So if a player is drawn, your
code will think its a pipe AND a player. To fix this (and i havent tried
it, but it should work) you'd:
Put all your if statements that check wether or not its a player or pipe
in glPopMatrix. The model is done drawing, so the vertice count you
have at THIS point is what you want.
DllMain
10-29-2003, 01:04 PM
This is just a framework, you are supposed to make it work : )
Structure
02-26-2004, 02:19 AM
I've
got a problem, I've done everything you said, but when I join a game,
instead of just simulating the right click when somebody walks near my
green pipes, it simulates the right click constantly, no matter what,
even if im a soldier... any help? :(
exrazile
03-03-2004, 03:03 PM
^^ read what i said... or you can pay me and i'll give you my 100% bug free, fool proof autodet LOL
Terranaut
03-03-2004, 03:31 PM
Yes
read what he typed in his last post. The original method keeps
"clicking mouse2" because it is counting a LOT of things as pipes. It's
easy to see this for instance if you draw a ballhack using his
coordinates. You'll see there are balls everywhere, on boxes, on
floors, on the menu, everywhere. That is why it is clicking all the
time; it thinks everything is a pipe and everybody is walking on it.
BishopDonJuan
05-09-2004, 03:57 PM
I
deleted posts i made earlier with questions which some i later found
out, i now have a working autodet, BUT, it doesnt det the correct
things.. I will post the code i have currently first, then ill explain
what it does, and finally ill tell u what i did to try and tweak it with
some of the ideas posted b4 me.
Globals
float PipeX;
float PipeY;
float PipeZ;
float PipePlayerX;
float PipePlayerY;
float PipePlayerZ;
bool autodet=true;
bool bModelDrawn;
bool highlight;
float DetCount;
PopMatrix
void sys_glPopMatrix (void)
{
if(autodet)
{
if(PipePlayerX - PipeX > 75)
{
if(PipePlayerY - PipeY > 75)
{
if(PipePlayerZ - PipeZ > 75)
{
//SEND FAKE RIGHT MOUSE CLICK
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
}
}
}
}
(*orig_glPopMatrix) ();
}
PushMatrix
void sys_glPushMatrix (void)
{
bModelDrawn=true;
(*orig_glPushMatrix) ();
}
Vertex3f
void sys_glVertex3f (GLfloat x, GLfloat y, GLfloat z)
{
if(bModelDrawn)
{
if(DetCount > 500)
{
if(z > -500)
{
if(z < 800)
{
PipePlayerX=x;
PipePlayerY=y;
PipePlayerZ=z;
}
}
}
}
if(autodet)
{
if(DetCount>50 && DetCount<60)
{
PipeX=x;
PipeY=y;
PipeZ=z;
}
}
DetCount++;
(*orig_glVertex3f) (x, y, z);
}
BishopDonJuan
05-09-2004, 04:04 PM
Now
i went into the server and tested it, instead of binding mouse2 to
detpipe, I bound it to an alias i have which makes my grenade timer go
off. This will simulate like an alarm when i get near the position in
which itll det.
With this, ive found out that the detting code in popmatrix works...
where the model recognition most likely works, and the world brushes are
being detected as models. When i walk into particular areas of the
map, the "alarm" will go off, and when enemies and other models go thru
it within my FOV, itll also go off. Another entity which sets the alarm
off are ricochets and nails. I would be a scout, and shoot thru these
detonations zones and as the nail travels thru the zone, the "alarm"
will go off.
If i knew how to draw some kind of a ballhack or ESP, red being the
Models, and Yellow being the pipes, I could find out what exactly the
code is detected as a pipe, and what its detecting as a model.
Well with this happening, i could say that this code...
if(autodet)
{
if(PipePlayerX - PipeX > 75)
{
if(PipePlayerY - PipeY > 75)
{
if(PipePlayerZ - PipeZ > 75)
{
//SEND FAKE RIGHT MOUSE CLICK
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
is working for me..
BishopDonJuan
05-09-2004, 04:44 PM
Ive
messed with many numbers and variables, to no avail. I learned that
the counter-vertice variable is 'DetCount' and set that to 0 in
pushmatrix by setting it as
'DetCount=0;'
exralize said something earlier about putting all ur if statements that
check if its a model or a pipe in popmatrix, which i can sort of
understand what he means, pushmatrix will draw the model... and by
putting those statements in, they determine which model is which when
the model is done drawing in popmatrix. Im just kind of lost on how to
go about it..
Here is what i tried to do, which u will end up laughing at me..
if(DetCount > 500)
{
bModelDrawn
}
if(DetCount > 50 && DetCount < 60)
{
autodet
}
Is there something u have to do beyond this tutorial?
Anyway ill keep stabbing at it, ill get it eventually, I would love,
and appreciate it, if u can help me out, email me here
dabonass@hotmail.com or just post here, ill check up frequently.
exrazile
05-18-2004, 02:20 PM
if you open your eyes and read, your questions have already been answered.
hotcat
06-04-2004, 12:04 AM
nice tutorial, DllMain. Easy to understand the general concepts. Thanks!
I confess I'm not new to coding in general (it's my job), but I am
pretty new to OpenGL-related projects. As a learning project I went
ahead and implemented this and with a few tweaks it worked rather
predictably.
If this is a newbie question then feel free to respond with "figure it
out yourself!" but as another exercise I wanted to extend the
recognition to multiple pipes (at least 2).
Correct me if I'm wrong, but as each model is drawn on the screen (per
"frame") glPushMatrix is called initially, glVertex3f is called for each
vertex in said model, and glPopMatrix is called upon completion of
preparing this model to be drawn to the screen in that particular frame.
Assuming the above is correct, tracking multiple pipes seems to me a
difficult problem. I've pondered it for a week or so and still haven't
come up with a solution. Simply storing coordinates / dimensions
(gathered at the time glPopMatrix is called) in a fixed array isn't
sufficient, as a fixed array would fill up rather quickly with even a
single pipe's path :p. If I were to make the structure resemble a
circular queue I'd still likely end up with only a set of coordinates of
the last locations of the last pipe i've watched move. If I were to
make the structure dynamically increase its size it would not only
potentially slow things down but I'd be left with the problem of
determining which coordinates I have are the last positions of pipes.
I'd appreciate it if someone could provide some hints or direction here
(maybe I'm approaching the problem totally wrong?). If pm would be more
appropriate then let me know there instead. Thanks in advance!
hotcat
06-16-2004, 04:04 PM
Hate to bump old threads, but I still haven't figured this out. Any ideas/tips/hints?
Powered by vBulletin® Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.