Created
June 10, 2013 05:19
-
-
Save aviaryan/5746697 to your computer and use it in GitHub Desktop.
Hotstrings with expiry time support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gosub, iniths | |
;######### YOUR HOTSTRING AREA ################################### | |
::btw:: | |
SendLimit("btw", "by the way", 1500) ;type btw within 1.5 secs | |
return | |
::wth:: | |
SendLimit("wth", "what the hell", 1000) | |
return | |
::aeroplane:: | |
Sendlimit("aeroplane", "Aeroplane is awesome for travelling long distances", 5000) ;type aeroplane within 5 secs | |
return | |
;############# FORGET IT ######################################## | |
alphasub: | |
if !(alphastart) | |
alphastart := A_TickCount | |
loop, parse, alphalist | |
Hotkey,~%A_loopfield%,alphasub,Off | |
return | |
~Enter:: | |
~Lbutton:: | |
~Tab:: | |
~Space:: | |
loop, parse, alphalist | |
Hotkey,~%A_loopfield%,alphasub,On | |
return | |
iniths: | |
alphastart := 0 , alphalist := "abcdefghijklmnopqrstuvwxyz" | |
loop, parse, alphalist | |
Hotkey,~%A_loopfield%,alphasub,On | |
return | |
;Function | |
SendLimit(Hotstring, SendItem, Timeinms){ | |
global | |
if ( (A_tickcount - alphastart) < Timeinms ) | |
Send, %Senditem% | |
else | |
Send, %Hotstring% | |
alphastart := 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment