Hello all. I heard about AutoHotkey and picked up this script on a message board I frequent. I read the FAQ and the Tutorial, but I don't know ANYTHING about coding, so I didn't understand anything I was reading.
I have to bind a couple of things to a key in a game I play and I figured this would really make my life a lot easier. As it is now, I have to try to remember to push the key every 5 seconds... all while doing everything else in the game. Needless to say, it's a big pain in the butt, not to mention my wrist.
So, here's the deal:
I was told to bind my functions to the F6 key and use AutoHotkey to loop the keypresses for me. This script he wrote is supposed to turn on the script, press F6 repeatedly until you hit F5 once or twice to stop it running, Here's the script:
Code:
F4 UP::
Send, {F6 DOWN}{F6 UP}
Sleep, 1000
Loop
{
Sleep, 200
GetKeyState, state, F5, P
if state = D ; The key has been pressed, so break out of the loop.
break
Send, {F6 DOWN}{F6 UP}
}
So, I bound the functions needed to a hotbar key, then bound that key to activate on pressing F6. Before I start my game, I double-click the .ahk file I made on my desktop and then hit F4 to start the script. When I log in to the game, F6 should be being pressed every couple of seconds by the script. What is happening though, is nothing. If I hit F6 manually, it activates just as it is supposed to, but will not register a press from AutoHotkey.
Also, I play the game in windowed mode, fullscreen so, when I click on my second monitor (web browser) and then click back into the game, it activates. I didn't hit F6 this time, though, AHK did and the game recognizes it. I tried running the game in fullscreen mode and it didn't work either.
Any ideas on why this may be? Could it be something within Vista 64? Could there be an error in this code?
Ghazkhull
[Title edited. Please write descriptive titles for your topics. ~jaco0646]