Issues with using CInputControl menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Xcron's Avatar Member
    Reputation
    40
    Join Date
    Nov 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Issues with using CInputControl

    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:
    Code:
    gpInputControl->SetMovementFlag(MOVEMENT_FLAG_TURN_LEFT, 1, 0);
    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).

    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:
    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
        }
    }
    The things I have tried so far:

    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
    Code:
    gpInputControl->SetMovementFlag(MOVEMENT_FLAG_LEFT_MOUSE, 1, 0);
    gpInputControl->SetMovementFlag(MOVEMENT_FLAG_LEFT_MOUSE, 0, 0);
    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 happens

    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
    Last edited by Xcron; 11-13-2009 at 06:47 PM.

    Issues with using CInputControl
  2. #2
    zzgw's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    31
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One thing: GetTickCount does not necessarily equal to what WoW uses to time its input. You might be better off reading the "last hardware action" variable (currently at 0x010B7B64, it is referenced in Lua CFunctions such as MoveForwardStart/etc.) or WoW's internal "GetTicks" function, which is also used in some of CInputControl's functions ("WoWGetTicks" currently at 0x00662270, with the prototype "bool GetTicks(int* out)", returns true if out has been set to the current ticks).

    Another thing: I am pretty sure simply calling the CInputControl::SetMovementFlag function does not result in any movement happening. For that you need to call the CInputControl::"UpdateMovement" function. It is also called in MoveForwardStart/etc. (with, uh, 1 and last hardware action as a parameter I believe) and should be easy to find.
    Please don't get set on any function names I used here, I just made them up but it should be obvious what functionality they perform.

    Hope this helped

  3. #3
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by zzgw View Post
    Another thing: I am pretty sure simply calling the CInputControl::SetMovementFlag function does not result in any movement happening. For that you need to call the CInputControl::"UpdateMovement" function. It is also called in MoveForwardStart/etc. (with, uh, 1 and last hardware action as a parameter I believe) and should be easy to find.
    Please don't get set on any function names I used here, I just made them up but it should be obvious what functionality they perform.

    Hope this helped
    Wrong, ToggleControlBit and friends will result in movement if the appropriate flag is set. No other function needs to be called to initiate it.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  4. #4
    audible83's Avatar Member
    Reputation
    4
    Join Date
    Jun 2008
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quick question, is ToggleControlBit related to the HW input check that are on some Lua calls? PlaceActionBid() being one example.

  5. #5
    peterwurst's Avatar Member
    Reputation
    11
    Join Date
    Jul 2006
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got the same behaviour, if I call "CInputControl::SetMovementFlag" I have to nudge my character to get it moving.

    So ToggleControlBit gets it moving without having to nudge the character?

  6. #6
    Xcron's Avatar Member
    Reputation
    40
    Join Date
    Nov 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Changing whether it's GetTickCount, the value at the "last hardware action" address, or using the GetTicks function does not resolve my issue. Looking at the assembly code for the SetMovementFlag/ToggleControlBit function, it looks like the same exact code with the "1" and "last hardware action" is called to "update movement" so that wasn't it either. Mind you, I did indeed actually inject the code to use that "UpdateMovement" call as well and it still didn't help. I still don't know what the problem is.../sigh.

  7. #7
    Flowerew's Avatar Master Sergeant
    Reputation
    72
    Join Date
    Oct 2009
    Posts
    134
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about letting WoW "think" there was a hardware action...

Similar Threads

  1. [Request] Issue with Gnome Male > BE Female
    By Borbei in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 10-13-2007, 05:42 PM
  2. [Question] Camera Issue with Model Editing.
    By Frombehind in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 10-12-2007, 03:57 PM
  3. am having issues with Chrispee's antrix
    By krisfahnz in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 09-09-2007, 01:32 PM
  4. Issue with starting Antrix.exe
    By LampShade in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 08-30-2007, 04:00 AM
  5. Issues with Deeprun Tram exploit
    By shade599 in forum World of Warcraft Exploration
    Replies: 3
    Last Post: 03-25-2007, 08:01 AM
All times are GMT -5. The time now is 06:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search