Help - Search - Members - Calendar
Full Version: Could a newb have but a minute of your time?
AC Tools Everything Macro > AC Tool > AC Tool Discussion
mdude1186
Hello everyone. I'm rather new at this and i've been wondering how to do something. I couldn't find it anywhere so i figured i'd make this post. I'm trying to create an if statement so that every time i hit a key it will do something for me. what i had so far was this:

If keydown = s
MousePos 732, 691
leftclick
end
Else
end
End

Sadly this does not work...the only problem with it is the if part. Any suggestions?
Ahk
//Globalkeys example by Ahk

//Output what key is pressed to the test log (Ordinal value)
//Clear the {GlobalKeys} variable

ClearGlobalKeys

//Loop forever
While 1 = 1
//Always keep some delay on uncontrolled infinite loops
Delay 500

//Log to the Test Log tab what keys have been pressed since the last pass
TimeStamp GK {GlobalKeys}

//Clear so each timestamp is readable
ClearGlobalKeys
End

Using If with {globalkeys} will work. You have to issue the ClearGlobalKeys command though to be sure it doesn't infinitely process a key you hit before if you expect it to work as a multiple use hotkey.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.