Jump to content

Key press not registered by AutoIT script while in a game


forhotc
 Share

Recommended Posts

Hi guys, I've made a "stop watch", trying to find out how long a sword swing action takes in a game. (The game is called "Mount & Blade").

In the script, I use the "m" key to toggle the stop watch.

It works fine in windows, but inside the game, the "m" key doesn't work. (Please note: the "m" key is not used by the game).

Is it because of the DirectX blocking the keystroke being passed to any other program besides the game? Or is it because the script is not "attached" to the game process?

How do I fix this problem?

Thanks in advance.

Here's my stop watch code:

Global $StopWatchStarted=False
Global $begin = TimerInit()

HotKeySet("m", "StopWatch")


While True
    Sleep(100)
WEnd


Func StopWatch()
    $StopWatchStarted = NOT $StopWatchStarted
    If $StopWatchStarted Then
        $begin = TimerInit()
        ToolTip("Stop Watch Started")
    Else
        $dif = TimerDiff($begin)
        ToolTip("Time Difference " & $dif & "ms. Stop watch now off.")
    EndIf   
EndFunc
Link to comment
Share on other sites

  • 2 weeks later...

Hi, I am having the same problem but with a slight difference.

The game is Cabal and I am already bypassing the X-Trap game control. I am able to use QMacro with hotkeys assigned to start macros but unable to start execution of AutoIt. Outside of Cabal game, it is ok.

Is there anyway to force AutoIt to catch the keystrokes first?

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...