Skip to content

Instantly share code, notes, and snippets.

@aviaryan
Created June 10, 2013 05:19
Show Gist options
  • Save aviaryan/5746697 to your computer and use it in GitHub Desktop.
Save aviaryan/5746697 to your computer and use it in GitHub Desktop.
Hotstrings with expiry time support
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