What are the key points that you need to know about when creating an aimbot for crossfire (I already know a great deal of Java and C++) ?

Also, do you always have to utilize DirectX when making an aimbot? I've looked around, but all I see is leached/incompetent coding.

One thing I don't understand is how the program, not only knows what the color of a player's head is, but knows `where` to look for that specific color.

For example: My screen has 1600x900 pixels on it with varying colors and a 75hz refresh rate. In a 3D game like crossfire the pixel locations change every time you move the screen. An enemy player could be moving around to different pixel locations as well. Does the program constantly update itself in a loop to account for this?