Alright so I've basically read through all the threads on here that have anything to do with CInputControl and I have yet to find a remedy for the problem I'm experiencing.
Here's a quick breakdown of what I'm doing. This is all in C++ btw. I have a dll that has essentially the code that Cypher had posted in his thread about using CInputControl (link). Of course I made a couple additions of some helper functions and changed a couple things here and there to get my dll working correctly. So then I have a standalone program that injects the dll into WoW successfully and all that. Here comes the problem. I nudge my character up by the allowed amount and my injected dll's exported turn_left function is called. To simplify it for debugging purposes I simply set the function to do:
So the turn_left flag got set to "1" and I switch over to the game only to see that nothing is happening. BUT! Once some sort of player action/next movement packet/who knows what happens, my guy starts turning left and doesn't stop signifying that the call was successful and everything is working fine in terms of the CInputControl code. But that's where the issue lies. If I hadn't pressed jump/press left click on mouse/whatever other player action, my character would have only been nudged upwards and his position would not have been updated due to no turning (that would otherwise be taken care of by that whole sendkeys crap which I'm trying to improve upon by using CInputControl).Code:gpInputControl->SetMovementFlag(MOVEMENT_FLAG_TURN_LEFT, 1, 0);
I've had no luck with solving this yet and I'm hoping somebody will have some insight. Some way for me to send the next movement packet or force an update on the player position (which is automatically done by the turning but I don't understand why it doesn't happen as soon as the asm code is processed and the call to SetFlags (0x00581230) occurs).
Here's my definition for the SetMovementFlag function as well since I am calling it and I mentioned it in my post:
The things I have tried so far:Code:__declspec (dllexport) void CInputControl::SetMovementFlag( int iFlag, int Enable, DWORD dwTime ) { DWORD SetFlags = SETFLAGS_ADDRESS; DWORD GetTickCount = GETTICKCOUNT_ADDRESS; _asm { mov eax,GetTickCount mov ecx, this push dwTime push eax push Enable push iFlag call SetFlags } }
1) forego the whole GetTickCount stuff since I think Cypher or somebody indicated in one thread or another that it was only necessary for some specific reason, but when I try it and inject the dll that way and use my exported functions WoW just crashes saying it couldn't read 0x0000000 or something along those lines
2) stick a "retn" at the end of the asm code...also makes WoW crash
3) try to use
to simulate a left click since that's an accepted player action that my movement flags are read after but alas as the other movement flags it doesn't get processed until the next player action so basically the flag was turned on then turned off, finally to be read as being off on the next player action so consequently nothing happensCode:gpInputControl->SetMovementFlag(MOVEMENT_FLAG_LEFT_MOUSE, 1, 0); gpInputControl->SetMovementFlag(MOVEMENT_FLAG_LEFT_MOUSE, 0, 0);
4) Load up the ObjectManager and update it in the TIB using the TLS offset and all that in the asm code to replicate what happens in WoW's main thread but to no avail, still only processes the movement flags on the next player action/event