i can give my 50 cents about it
The reason why the most send commands dont work is that the game is catching keystrokes in 2 different ways. The first is the software generated keystroke which will in the most cases written to the the chat window (These commands are controlsend in autoiit and the most send commands in other languages). further these commands sends only to one specified window its message -> this will lead to the chat window.
The second are commands that involves the hardware etc. more directly like in dx, with these u can write/send message to the game and not to the chat.
But how u can send messages/keys etc to a game?
1. write u own hook/wrapper for dinput from directx (not so easy)
2. reverse the function u want use of the game and write a hook (like the heavenfire bot)
3. Use a send command like Autoit-Send which sends his message to the global windows (aim is the activated one), but than u game must be on top
4. write u own send command which controls the hardware directly
5. Find the sourcecode of the autoit-send command and adapted to u favourite programming language
I think there much more ways to do it, but none of them will be easy.