Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: AHK fun!  (Read 8507 times)

0 Members and 1 Guest are viewing this topic.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
AHK fun!
« on: November 04, 2005, 02:46:56 am »
I used AutoHotKey a lot on my main window machine when it used to be called AutoIT but I had kind of forgotten about it until Howard mentionned it as part of the johnny5 project.

AutoHotKey (AHK for short) is becoming my cab's best friend. I found lots of uses for it and I figured I'd share a few, maybe some of you that have good scripts could also share them in this thread.

Basically it allows to make "wrappers" around games (especially PC games, but other emulators too)

I'll make a post per script to make them easier to read.
« Last Edit: November 04, 2005, 03:16:01 am by papaschtroumpf »

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re: AHK fun!
« Reply #1 on: November 04, 2005, 02:55:17 am »
I have a few PC games that do not have volume control. Everything in my cab is calibrated to have about the same level of output, so those games can be either too soft or too loud.
There are other solutions to this problem (see http://glorysoft.omsk.ru/vlt_download.html for example) but I wanted a solution that would save the existing volume and restore it later.

The following script takes an argument in the form of a percentage (0-100) or a relative percentage (+10 or -50 for example) that tells it what to set the new sound level to (for wave output). The current level is saved to a file in the current directory that the next script can use to retore the sound volume.

Code: [Select]
;AHKVolume.ahk
; Get the current volume write it to a file

SoundGetWaveVolume, CurrentVolume
FileRecycle, AHKVolFile
FileAppend, %CurrentVolume%, AHKVolFile


; Now set to the new specified volume passed as an argument to the script.
;Can be an absolute (0-100) or relative value such as +10

SoundSetWaveVolume, %1%


This script retrieves the saved volume and set its back to that value:
Code: [Select]
;AHK REstoreVolume.ahk
; Companion script to AHKVolume.ahk - restores the volume to the value
; saved by AHKVolume.ahk

FileRead, SavedVolume, AHKVolFile
SoundSetWaveVolume, %SavedVolume%


All you now have to do is call the first script before you launch the game that is (for example too loud) and call the second script after the game returns, all of it in a batch file for example.

Code: [Select]
AHKVolume.ahk -50
RunMyGame.exe
AHKRestoreVolume.ahk

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re: AHK fun!
« Reply #2 on: November 04, 2005, 03:00:49 am »
I have several PC games from Reflexive Arcade (www.reflexive.com).
One bad thing about those games is that after you exit the game, it displays a window for about 20s with button to play the game again or play other games from reflexive (I think it brigs you to their web site, not sure I ever tried clicking the button).
This is obviously a pain, I could see that for demo version, but the game does it even if you register.

The following script will launch the game specified as an argument, then dismiss the window htat is displayed after the game exit, allowing you to get right back to your front end:

Code: [Select]
;Reflexive.ahk
; This AHK script dismisses the "Wrapper" that appears after exiciting a Reflexive
; Arcade game (the window that offers "Play Game" or "Other Games", even on a fully
; licensed game).
; Usage: reflexive.ahk <shortcut to the reflexive game>
;
;How it works:
; Sleep at the start of the script to make sure that we don't catch the window
; when the game is just starting.
; we then wait for the Reflexive wrapper window to appear and automatically
; close it
Run, %1%
Sleep, 8000
WinWaitActive, ahk_class ReflexiveGameWrapper
Winclose, ahk_class ReflexiveGameWrapper

You can then setup your front end to call the game using the following command line (you may have to set up a batch file):

Reflexive.ahk <path to the game>

for example:

"D:\PC Games List\reflexive\reflexive.ahk"  "D:\Program Files\Wik And The Fable Of Souls\Wik.exe"

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re: AHK fun!
« Reply #3 on: November 04, 2005, 03:07:31 am »
This one is a variation on the previous script: Reflexive has a game called GutterBall2
In addition to leaving an annoying window behind as explained in the previous post, GutterBall2 will go to window mode if you press the ESC key. If you want to exit the key, you need to click on a red X in the corner of the screen.
People are pretty much used to pressing the exit keyy on my cab that is mapped to the ESC key, so they keep making the game go into windowed mode, which doesn't look good.
So in addition to eliminate the undesirable window, this script also captures the ESC key and prevents it from reaching the game: the ESC key now has no effect.
Note that if I wanted to be really fancy, I could have made it so that the script would "click" the red X on the screen when the ESC key is pressed to make the exit key work as an "exit" key.

Code: [Select]
; This AHK script dismisses the "Wrapper" that appears after exiciting a Reflexive
; Arcade game (the window that offers "Play Game" or "Other Games", even on a fully
; licensed game).
; Usage: reflexive.ahk <shortcut to the reflexive game>
; In addition this special version prevents the use of the ESC key because it caused the game to go to windowed mode. Click on the red X in the game to exit
;

HotKey, ESC, ignoreESC

Run, %1%
Sleep, 8000
WinWaitActive, ahk_class ReflexiveGameWrapper
Winclose, ahk_class ReflexiveGameWrapper
ExitApp


IgnoreESC:
return

By the way, I don't like GutterBall2, my one of my kids loves it and talked grandma into paying for the license, so I guess now it's part of the cab.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re: AHK fun!
« Reply #4 on: November 04, 2005, 03:12:59 am »
I have several PC games that are played with the mouse exclusively.
While I do have a PC trackball embedded into my CP, it's often awkward to use the trackball (sometimes fantically) and click on the buttons mounted on it.

The following script maps the left CTRL and left ALT keys (P1B1 and P1B2 by default in MAME) to left and right click.

[code]
; Button2Mouse.ahk
; maps P1B1 and P1B2 to left and right mouse click respectively

#SingleInstance force
#MaxHotkeysPerInterval 500

; Using the keyboard hook to implement the Numpad hotkeys prevents
; them from interfering with the generation of ANSI characters such
; as
« Last Edit: November 04, 2005, 04:23:27 pm by papaschtroumpf »

SpamMe

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 538
  • Last login:July 01, 2006, 03:19:58 am
  • .creature of bad habit.
    • Mame cabinet blog
Re: AHK fun!
« Reply #5 on: November 04, 2005, 06:00:32 am »
I've been having a lot of fun with autohotkey also (though, admittedly, I'm not great with it).
Script below causes the escape key to work only if it's held for 2 seconds or more (or you can hit it rapidly to toggle this function back off) to prevent accidental exiting in mame and so forth.


Code: [Select]
;HoldEscape:

toggletimer = 0
esckill = 1
SetKeyDelay, 10, 20

$esc::
if toggletimer = 0
SetTimer, resettimer, 1000
toggletimer++
if toggletimer > 3
goto, toggleesckill
if esckill = 1
{
tt=0 ; set time to 0
loop,100
{
GetKeyState, s , esc, p
  if s=U
  Break
   tt+=25
   sleep 25
}
if tt>=2000  ; if key pressed for 2 or more sec
{
   send, {esc}
   toggletimer = 0
   sleep 1200
}
}
else
{
send, {esc}
}
return

resettimer:
toggletimer = 0
return

toggleesckill:
soundplay, *48
toggletimer = 0
esckill *= -1
sleep 500
return

I also wrote one to act as a coin counter (pops up a translucent panel over mamewah showing a total dollar amount taken at bootup or when coming back up from standby for a few seconds and then fades out), but, as I used Veinman's lil coin counter as a gui template for it (and because it waits for mamewah, specifically, to start), I don't think I can release it.

Oh. Here's a wrapper for EveryExtend (remaps keys and dismisses the first opening dialog).
Code: [Select]
;change this line to suit your folder paths
Run, C:\EveryExtend\SGX2.exe, C:\EveryExtend,
SetTitleMatchMode, 3
WinWait, Project-SGX2, Fullscreen mode?,5
if ErrorLevel = 1
goto, Kill
ControlSend,, y, Project-SGX2, Fullscreen mode?
WinWait, Project-SGX2,,8,Fullscreen mode?
if ErrorLevel = 1
goto, Kill
SetTimer, close, 1000

*q::
*w::
*e::
*r::
*t::
*y::
*Enter::
Send {z down}
Return

*q up::
*w up::
*e up::
*r up::
*t up::
*y up::
*Enter up::
Send {z up}
Return

Close:
  IfWinNotExist, Project-SGX2
    exitapp
Return

kill:
winkill, Project-SGX2
exitapp
Return
« Last Edit: November 04, 2005, 06:09:06 am by SpamMe »

MisterB

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 60
  • Last login:November 27, 2023, 02:22:02 pm
Re: AHK fun!
« Reply #6 on: November 04, 2005, 07:01:09 am »
This one isn't pretty, but I use it as a wrapper for the Sega Saturn emulator Cassini.  I couldn't find a way to launch it cleanly from the command line - it wants to launch a GUI where you can tweak a bunch of settings before running the game in your (real or virtual) CD-ROM drive.  The wrapper automatically navigates through the GUI, forcing the system BIOS to US (default is always Japan), then starts the game.  On XP systems, a DirectSound error always pops up when the game starts.  This script also bypasses that error message (btw - sounds seems to work fine regardless of the error).

By default, Cassini exits the game when you press ESC, but brings you back to the GUI again.  The script also detects the game exit, and closes the GUI for you.

No problems running this script using MameWah, if you compile it into an .exe.  I configured MameWah to auto-mount my CD image before running the AHK script, but the script could be modified to do that as well...

Run, "G:\emulators\cassini\Sega_Saturn_Emulator.exe"
WinWait, Cassini
WinActivate
Send, {tab}{tab}{tab}{tab}{tab}{down}{down}{tab}{tab}{tab}{tab}{tab}{tab}{tab}{enter}
WinWait, Error
WinActivate
Send, {enter}
WinWait, Cassini
WinActivate
WinClose

SpamMe

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 538
  • Last login:July 01, 2006, 03:19:58 am
  • .creature of bad habit.
    • Mame cabinet blog
Re: AHK fun!
« Reply #7 on: November 04, 2005, 02:18:34 pm »
I was using mamewah as a shell, but needed to run a few other apps at startup (without making them services).
Here's the shell I'm using now:
Code: [Select]
/*
AHK Shell
  This script is basically a batch file
  for launching programs based on entries
  in an ini file (named AHKShell.ini) placed
  in the same folder as the script. It will
  need to be compiled with AHK2EXE
  for use as a shell.
*/

SetWorkingDir, %A_ScriptDir%
IniRead, AppNum, AHKShell.ini, Settings, NumberOfApps, 0
Loop, %AppNum%
{
IniRead, App%A_Index%, AHKShell.ini, Applications, App%A_Index%
}
Loop, %AppNum%
{
CurrentCommandLine := App%A_Index%
StringSplit, NameArray, CurrentCommandLine, `,,%A_Space%
SplitPath, NameArray1,,ApplicationDirectory
Run, "%NameArray1%" %NameArray2%, %ApplicationDirectory%, UseErrorLevel
}
And ini file
Code: [Select]
[Settings]
NumberOfApps=2

[Applications]
App1=C:\Program Files\VolumeTray\Volumetray.exe
App2=C:\program\someprogram.exe, -someparameter
App3
App4
App5
App6
App7
App8
App9
App10

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:May 09, 2024, 06:39:39 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: AHK fun!
« Reply #8 on: November 04, 2005, 10:16:24 pm »
since we are sharing.....

I enjoy the american laser games, but they aren't exactly cab friendly..  this is the script I use with them:

--------------------------------------------------------------------------------

; The asterisk prefix makes the remapping more complete on XP/2k/NT. For 9x systems you can remove it.
IfWinNotExist,The Last Bounty Hunter
{
   
   winwait,The Last Bounty Hunter,,100
   WinActivate,The Last Bounty Hunter
   Send {LAlt down}
   Send {C down}
   Send {LAlt up}
   Send {C up}
   Send {F up}
   Send {F down}
   return
}
else
{
   
   WinActivate,The Last Bounty Hunter
   Send {LAlt down}
   Send {C down}
   Send {LAlt up}
   Send {C up}
   Send {F up}
   Send {F down}
   return
}


*1::Send {LControl down}
*1 up::Send {LControl up}

Escape::
Send {LAlt down}
Send {F4 down}
Send {LAlt up}
Send {F4 up}
ExitApp ; Assign a hotkey to terminate this script.
return

----------------------------------
Bascally what this does is check to see if the game is running... if it is, go through the menus to set it to fullscreen.  If not, wait for the game and then set fullscreen mode. 

It also translates escape, to press alt-f4, which closes any standard windows app, not just the alg games. 

On top of that I translated the 1 key to left control, so when the "press start" screen appears, I can start the game by actually pressing start, instead of firing at the screen or pressing any "standard" key. 

This script will work with just about any digital leisure game, you just have to change the caption in the script to reflect the caption of that app's window.  Also note that if your folder name matches the caption name of the window, it will screw things up when testing through explorer... so use the command line only. 

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re: AHK fun!
« Reply #9 on: November 05, 2005, 02:00:36 pm »
Cool stuff, and I didn't realize AHK grew out of AutoIt.  Have actually used both programs!!!
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

ZeroPoint

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:June 19, 2014, 08:07:07 pm
Re: AHK fun!
« Reply #10 on: November 05, 2005, 03:02:39 pm »
Just wondering if anyone knows how to emulate an analog joystick with the mouse (using the mouse for steering etc.) ?

Can AHK do this or does anyone know of a solution for this ?

mumbles

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 89
  • Last login:January 25, 2024, 09:20:01 pm
  • I'm a llama!
Re: AHK fun!
« Reply #11 on: April 03, 2006, 05:19:32 am »
Hi,

i have the follwing sega light gun games Virtua Squad (Pause key + f3, exit + alt f4), Virtua Cop 2 (Pause = f3, exit = alt+f4), House of The Dead (pause = p, exit = alt+f4), House Of The Dead 2 (Pause = enter, exit = escape), House of the dead 3 (pause = enter, exit = alt+f4). Now i run all thse games under mamewah andon my control panel puase=p and exit = escape so i want to be able to remap the keys to reflect that and then after i exit each individual games p stills eguals pand esc still equls escape. Now i think autohotkey can do this but waht script do i need and where in my batch files do i enter it. to run the above games i do the follwing

*** Virtua Cop batch ***
@ECHO OFF
D:
CD BATCH
Virtua Cop.BRS

**** Virtua Cop.brs ***
d:\prorgam files\vc.exe


So where do i enter a autohotkeyscript to do what iwant and what should it say??

thanks in advance

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:May 09, 2024, 06:39:39 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: AHK fun!
« Reply #12 on: April 03, 2006, 07:17:19 am »
Your solution is much easier than you think. 

In your function that translates the escape key to alt+f4 you want to also put an "exitapp" call in there so that it kills the script as well. 

Actually I shouldn't even have to be telling you this, if you'll look at my example in this very thread it has the escape sequence setup that way. 

mumbles

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 89
  • Last login:January 25, 2024, 09:20:01 pm
  • I'm a llama!
Re: AHK fun!
« Reply #13 on: April 04, 2006, 06:49:28 am »
thanks very much 4 yr help. i now have the escape problem solved. I have also done a script to make pause (which is f3 in Virtua Cop 2) to be "p" which is the key configured on my cab. Now the only problem is if I put endapp in it you can only press p once to pause it and then can't unpause it. if you don't put endapp in there the script is still running when I exit the game. Does this mean that "p" would still be remapped to f3?? if so hwo can I get the script to terminate when the game exits??

here is the script I have made

P::
Send {F3 down}
Send {F3 up}


Thanks in advance

chemame

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 107
  • Last login:January 26, 2007, 01:54:05 pm
  • I want to build my own arcade controls!
Re: AHK fun!
« Reply #14 on: April 04, 2006, 08:05:11 am »
Cool, I've been looking for something like this.

question: wouldn't this work for electricd and his Tiger Woods 2006 problem? If I remember correctly, TW would run on his system, but he couldn't see the menu due to a resolution problem. Could he possibly script the menu navigation? I know it might get messy, but is it possible?

Chemame

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:May 09, 2024, 06:39:39 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: AHK fun!
« Reply #15 on: April 04, 2006, 08:21:02 am »
thanks very much 4 yr help. i now have the escape problem solved. I have also done a script to make pause (which is f3 in Virtua Cop 2) to be "p" which is the key configured on my cab. Now the only problem is if I put endapp in it you can only press p once to pause it and then can't unpause it. if you don't put endapp in there the script is still running when I exit the game. Does this mean that "p" would still be remapped to f3?? if so hwo can I get the script to terminate when the game exits??

here is the script I have made

P::
Send {F3 down}
Send {F3 up}


Thanks in advance

I mean no disrespect but perhaps you need to look at the ahk help file and go over the syntax again.

Pressing p has nothing to do with the exitapp (unless p is a key used to exit the game or the esc key is used to pause or something crazy like that) , however because your syntax is wrong I'm guessing both functions get ran. 

After a line of instructions you must always put a return in there or else it'll keep reading and go on to the next line. 

So it needs to be:

P::
Send {F3 down}
Send {F3 up}
return


ErikRuud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1709
  • Last login:March 05, 2021, 10:20:27 am
  • I'll build a cab for only 99.99.99!!!
    • Erik's humble video game page
Re: AHK fun!
« Reply #16 on: April 05, 2006, 11:56:45 am »
AHK did sort of grow out of AutoIt.  AHK is based on the source code for AutoIt2, but with added features.

AutoIt is now on Version 3, which I think is much better than AutoIt2 or AHK, mainly because the syntax is much more "BASIC" like.

I have put together an AutoIt3 executable that is a generic launcher for the Digital Leisure/American Laser Games.  You can download it from my site.

Here is what the script looks like:
Code: [Select]
$numParms=$CmdLine[0]
HotKeySet("{ESC}","_GetOut")
if $numParms > 0 Then
$game = $CmdLine[1]
Else
msgBox(4096,"Error","You must provide a game parameter")
exit(1)
EndIf
$var = IniReadSection("ALGLaunch.ini",$game)
If @error Then
    MsgBox(4096, "", "Error occured, Invalid parameter or the ini file is missing.")
exit(1)
Else
$executable = IniRead("ALGLaunch.ini",$game,"executable","")
$directory = IniRead("ALGLaunch.ini",$game,"directory","")
$window = IniRead("ALGLaunch.ini",$game,"window","")
$reload = IniRead("ALGLaunch.ini",$game,"reload","no")
$msg = ">>" & $directory & $executable & "--" & $reload & "<<"
;msgBox(4096,"Testing",$msg,15)
run($executable,$directory)
winwait($window)
WinActivate($window)
send("f")
send("r")
While 1
if $reload <> "no" then
If _isPressed("02") then
_MouseOnclick()
EndIf
Endif
if not WinExists($window) Then
_GetOut()
endif
Wend

EndIf
Func _GetOut()
if winexists($window) Then
winkill($window)
endif
Exit(0)
EndFunc

Func _MouseOnclick()
SoundPlay($reload)
EndFunc
;===============================================================================
;
; Description:    _IsPressed
; Parameter(s): $s_hexKey - key to check for
; $v_dll = Handle to dll or default to user32.dll
;               
; User CallTip:   _IsPressed($s_hexKey[, $v_dll = 'user32.dll']) Check if key has been pressed. (required: <Misc.au3>)
; Return Value(s):  1 if true
; 0 if false
; Author(s):      ezzetabi and Jon
;
;===============================================================================
Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
; $hexKey must be the value of one of the keys.
; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is.
Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
Return 0
EndFunc   ;==>_Is_Key_Pressed

« Last Edit: April 05, 2006, 12:03:54 pm by ErikRuud »
Real Life.  Still a poor substitute for video games!       
American Laser Games Wrapper
O2em Rom Utility

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:May 09, 2024, 06:39:39 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: AHK fun!
« Reply #17 on: April 05, 2006, 04:20:01 pm »
Better than autoit 2 yes.  Better than ahk no.

Autoit's biggest problem has always been the handling of inputs.  I've found ahk to remap/send keys/ect on 99% of the apps I've tried, including ones that use directinput in exclusive mode.  Autoit, on the other hand, even autoit 3 only works about 60% of the time.
And since mostly what we need to do is move the mouse or press/remap keys it seems kinda pointless to use autoit scripts unless you just happen to need one of the features that autoit 3 only has.   

With that being said, in the case of the dl games autoit will work great as input is gdi based. 


Very nice script btw. 

ErikRuud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1709
  • Last login:March 05, 2021, 10:20:27 am
  • I'll build a cab for only 99.99.99!!!
    • Erik's humble video game page
Re: AHK fun!
« Reply #18 on: April 06, 2006, 08:43:43 am »
Better than autoit 2 yes.  Better than ahk no.

Autoit's biggest problem has always been the handling of inputs.  I've found ahk to remap/send keys/ect on 99% of the apps I've tried, including ones that use directinput in exclusive mode.  Autoit, on the other hand, even autoit 3 only works about 60% of the time.
And since mostly what we need to do is move the mouse or press/remap keys it seems kinda pointless to use autoit scripts unless you just happen to need one of the features that autoit 3 only has.   

With that being said, in the case of the dl games autoit will work great as input is gdi based. 
Interesting, so far AutoIt has worked with everything I have tried.

As I said, I like it for the syntax.  So far the only thing I have wanted to do, but couldn't in AI3, was to use a mouse button as a hot key.  That's why you see the "While 1" loop and the "_IsPressed" fuction in this script.

Quote
Very nice script btw. 

Than You!
Real Life.  Still a poor substitute for video games!       
American Laser Games Wrapper
O2em Rom Utility