Well this post is to inform you guys about the current way CA is working with PushToConsole, Which ever version you use. I spent alot of time testing and debugging and I am posting here to save other new people to the game hacking scene from wasting time..
First of I can say that PushToConsole doesn't seem to work unless its called from a d3d9 function, Atleast the commands I tried... Anyway this means you will be needing to hook one of the functions and call your PushToConsole from there, Dont bother with hooking EndScene as in my test it was detected and after a few minutes it crashed, I suggest Hooking "Present" function.
If you have a lot of PushToConsole commands that need to be sent, I suggest only sedning them Once with the on/off switch, This can be done a number of ways but the easiest is to create globle boolean and set it to true when a key is pressed, then in present if the boolean is true it will process your hacks, after processing it will set the boolean back to false, which means next time the PResent is updated it wont send any PushToConsole commands, Which also means your game wont lag.. Example of this can be seen below, Note this is written in Delphi so copy and paste wont work here, Instead its to give you an idea how you might want to do it....
I personally have an extra thread running just to monitor keystrokes so I dont miss anything and in that thread I have something like...
Code:
//NX Chams
if (GetAsyncKeyState(VK_NUMPAD5) <> 0) then
begin
bChams:= NOT bChams;
Sleep(10);
bProcess:= True;
end;
Then in your hooked Present Callback...
Code:
if bProcess = True then
begin
@SetConsoleVariable:= pointer($********);
case bChams of
False: SetConsoleVariable($********,'SkelModelStencil 0');
True : SetConsoleVariable($********,'SkelModelStencil -1');
end;
bProcess:= False;
end;
So ONLY if bProcess = true will it do something, otherwise it will just pass on to the original Present, This will kept the game running as normal without any lag.
Like I said before this is just one way of stopping lag, There are many other ways. But please don't believe everyone as believing one of the forum members about Running PushToConsole in your own thread lead me on a wild goose chase for 1 and half weeks trying to get it working, Luckily for me I had the valuable information from Mr.Magic, Freedompeace and Apoc91 which helped me and tested different things to eliminate possibilities.
Now it could be very well true that your PushToConsole is working in EndScene or by its self in your own created thread(very unlikely) So please don't take this as a fact, instead use this information in your research and testing....
//Good Luck