EUREKA
Many thanks....AGAIN (seems like I say that a lot to you!) swag*
Code: Select all
sleep, 100
Run, "D:\Games\DiRT\DiRT 3\dirt3_game.exe" ;legend #2
sleep, 500
GoSub, Label1
F11:: ;legend #3
{
Run "D:\Games\DiRT\DiRT 3\Launch DiRT 3 & Keymapping_RESTART.bat"
sleep, 1000
Process, Close, dirt3_game.exe
sleep, 250
ExitApp
}
Label1:
sleep, 11000 ;legend #4
Run, "D:\Games\DiRT\DiRT 3\Launch Keymapping_DiRT_3_GAMEPLAY.bat" ;legend #5
sleep, 500
ExitApp ;legend #6
#IfWinActive ahk_exe dirt3_game.exe
WinWaitNotActive, ahk_exe dirt3_game.exe
WinWaitClose, ahk_exe dirt3_game.exe
return
There are 2 AHK.exe files needed to play this game. One just to launch and restart if crashes, the other scripted for gameplay
Legend:
#1: short-cut to game launches a batch file, that in turn, launches "Keymapping_DiRT_3.exe" (the script you see above)
#2: Script launches the games executable
#3: "F11" is ONLY used if the game crashes during the launch process (crash is seen within about 5~8 seconds)
#4: Gives me 11 seconds to key a restart, if appears the game has crashed
#5: Batch file with a SLEEP 1 command prior to launching script that will be used during gameplay
#6: the launch script is exited and the gameplay script starts 500ms later
NOTE: "Launch Keymapping_DiRT_3_GAMEPLAY.bat" file is written with a SLEEP 3 command to allow the script to
terminate the games executable and then ExitApp
NOTE 2: Two batch files cannot be run simultaneously (at least not on Windows XP) so care had to be taken, so that
CMD commands would not "overlap" and be executed by a single AHK script that would ultimately self-terminate
If all of this looks totally insane just to play a computer game... well, it is! But since the game is really cool and is
well known to crash during launch (just google "DiRT 3 crashing" and you will see what I mean), this is far and away
the most efficient way to overcome the issues posed when the game crashes. It locks up the computer and the usual
CTRL+ALT+DELETE or ALT+TAB do nothing at all. Hard-crashing the computer and rebooting is the only sure alternative.
Sometimes, ALT+ENTER will enable windowed-mode and allow access to Task Bar to enable Task Manager and crash the
game that way. This script allows the press of a single key (2 or 3 times is usually enough, but 10 times can happen)
Regardless, I can be in the games menu within 30 seconds at the absolute worst case scenario, where it might have taken
as many reboots of computer to accomplish the same thing. Lemmetellya..... frustration sets in and I would play something
else, long before I rebooted even 5 times.
Fortunately, the AHK script will accept keyboard input, so how this all came about. Now, if I could just get the last 10 hours
back it took to get to this moment..... well, what would be the fun in that
Peace, swag
*just can't bring myself to call you Mr. Fag.... lol