Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Can AHK be used in LoL somehow?


  • Please log in to reply
18 replies to this topic
Ruevil2
  • Members
  • 226 posts
  • Last active: Dec 04 2015 11:05 PM
  • Joined: 27 Mar 2012

Here is an an idea to make that memory a little easier. I combined your healing actions with my Multi-Tap script.

 

This should use one button for healing, one for item3 and one for item4. Tap once for ally 1, twice for ally 2, and so on.

;Instructions:
;Hotkeys are Numpad Subtract, Add and Enter. Tapping multiple times alters the action that will be sent.
 
#SingleInstance, Force
#Persistent
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Operations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$NumpadSub::Action := MultiPress("Heal1, Heal2, Heal3, Heal4")
$NumpadAdd::Action := MultiPress("Item31, Item32, Item33, Item34")
$NumpadEnter::Action := MultiPress("Item41, Item42, Item43, Item44")
 
TakeAction:
SetTimer, TakeAction, Off
if (IsLabel(Action))
Gosub, %Action%
Return
 
;***************
;***NumpadSub***(Heal)
;***************
Heal1:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Heal2:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Heal3:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Heal4:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;***************
;***NumpadAdd***(Item3)
;***************
Item31:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Item32:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Item33:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Item34:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;*****************
;***NumpadEnter***(Item4)
;*****************
Item41:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Item42:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Item43:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Item44:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;**********************************
;***Capture Multiple Key Presses***
;**********************************
MultiPress(actionList = "", delay = 400)
{
Static pressCount := 0
 
pressCount := ( ((A_PriorHotKey = "") || (A_ThisHotKey = A_PriorHotKey)) && (A_TimeSincePriorHotkey < delay) ) ? (pressCount + 1) : (1)
 
if (actionList = "")  ;this option flags to just return count to caller (no list present)
Return pressCount
 
SetTimer, TakeAction, % delay
Loop, Parse, actionList, `,, %A_Space%
 
if (A_Index = pressCount)
Return A_LoopField
 
Return False
}

If I helped you out and you would like to show appreciation, feel free to buy me a beer.  grin.png   btn_donateCC_LG.gif


Arcanist
  • Members
  • 27 posts
  • Last active: Jan 27 2018 08:46 AM
  • Joined: 10 Mar 2014

 

Here is an an idea to make that memory a little easier. I combined your healing actions with my Multi-Tap script.

 

This should use one button for healing, one for item3 and one for item4. Tap once for ally 1, twice for ally 2, and so on.

;Instructions:
;Hotkeys are Numpad Subtract, Add and Enter. Tapping multiple times alters the action that will be sent.
 
#SingleInstance, Force
#Persistent
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Operations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$NumpadSub::Action := MultiPress("Heal1, Heal2, Heal3, Heal4")
$NumpadAdd::Action := MultiPress("Item31, Item32, Item33, Item34")
$NumpadEnter::Action := MultiPress("Item41, Item42, Item43, Item44")
 
TakeAction:
SetTimer, TakeAction, Off
if (IsLabel(Action))
Gosub, %Action%
Return
 
;***************
;***NumpadSub***(Heal)
;***************
Heal1:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Heal2:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Heal3:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Heal4:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;***************
;***NumpadAdd***(Item3)
;***************
Item31:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Item32:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Item33:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Item34:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;*****************
;***NumpadEnter***(Item4)
;*****************
Item41:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F5 down}
sleep 10
Send,{F5 up}
Return
 
Item42:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F6 down}
sleep 10
Send,{F6 up}
Return
 
Item43:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F7 down}
sleep 10
Send,{F7 up}
Return
 
Item44:
Send,{F1 down}
sleep 10
Send,{F1 up}
sleep 10
Send,{F8 down}
sleep 10
Send,{F8 up}
Return
 
;**********************************
;***Capture Multiple Key Presses***
;**********************************
MultiPress(actionList = "", delay = 400)
{
Static pressCount := 0
 
pressCount := ( ((A_PriorHotKey = "") || (A_ThisHotKey = A_PriorHotKey)) && (A_TimeSincePriorHotkey < delay) ) ? (pressCount + 1) : (1)
 
if (actionList = "")  ;this option flags to just return count to caller (no list present)
Return pressCount
 
SetTimer, TakeAction, % delay
Loop, Parse, actionList, `,, %A_Space%
 
if (A_Index = pressCount)
Return A_LoopField
 
Return False
}

Thanks for the help Ruevil but I think in that case, it's more important to memorise the hotkeys than to click more than once to heal someone. It's too slow to heal the 4th person by pressing a button 4 times. I have used your chat script though. I really like that use of multiple buttons and I have added more buttons because I have a numpad on my Razer Naga mouse. Here is the unfinished script if you want to see it. I haven't used all of the buttons yet:

;Instructions:
;Hotkeys are Numpad Subtract, Add and Enter. Tapping multiple times alters the action that will be sent.
 
#SingleInstance, Force
#Persistent
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Operations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Numpad4::Action := MultiPress("11, 12, 13, 14")
$Numpad5::Action := MultiPress("51, 52, 53, 54, 55")
$Numpad7::Action := MultiPress("21, 22, 23")
$Numpad0::Action := MultiPress("31, 32, 33, 34")
$NumpadSub::Action := MultiPress("s1, s2")
 
TakeAction:
SetTimer, TakeAction, Off
if (IsLabel(Action))
Gosub, %Action%
Return

;********************
;** Numpad4 ** MIA **
;********************
11:
Send,{Enter}
sleep 10
Send,MIA top
sleep 10
Send,{Enter}
Return
 
12:
Send,{Enter}
sleep 10
Send,MIA mid
sleep 10
Send,{Enter}
Return
 
13:
Send,{Enter}
sleep 10
Send,MIA bot
sleep 10
Send,{Enter}
Return
 
14:
Send,{Enter}
sleep 10
Send,re
sleep 10
Send,{Enter}
Return

;*******************************
;** Numpad5 ** FLASH COOLDOWN **
;*******************************
51:
Send,{Enter}
sleep 10
Send,TOP flash 5 min
sleep 10
Send,{Enter}
Return
 
52:
Send,{Enter}
sleep 10
Send,MID flash 5 min
sleep 10
Send,{Enter}
Return
 
53:
Send,{Enter}
sleep 10
Send,ADC flash 5 min
sleep 10
Send,{Enter}
Return
 
54:
Send,{Enter}
sleep 10
Send,SUPPORT flash 5 min
sleep 10
Send,{Enter}
Return

55:
Send,{Enter}
sleep 10
Send,JUNGLE flash 5 min
sleep 10
Send,{Enter}
Return

;*****************************
;** Numpad7 ** ENEMY JUNGLE **
;*****************************
21:
Send,{Enter}
sleep 10
Send,Enemy Jungle Top
sleep 10
Send,{Enter}
Return
 
22:
Send,{Enter}
sleep 10
Send,Enemy Jungle Mid
sleep 10
Send,{Enter}
Return
 
23:
Send,{Enter}
sleep 10
Send,Enemy Jungle Bot
sleep 10
Send,{Enter}
Return
 
;***************************
;** Numpad0 ** BUFF TIMES **
;***************************
31:
Send,{Enter}
sleep 10
Send,OB 5 min
sleep 10
Send,{Enter}
Return
 
32:
Send,{Enter}
sleep 10
Send,OR 5 min
sleep 10
Send,{Enter}
Return
 
33:
Send,{Enter}
sleep 10
Send,EB 5 min
sleep 10
Send,{Enter}
Return
 
34:
Send,{Enter}
sleep 10
Send,ER 5 min
sleep 10
Send,{Enter}
Return

;*******************************
;** NumpadSub ** DRAGON/BARON **
;*******************************
s1:
Send,{Enter}
sleep 10
Send,DRAGON 6 min
sleep 10
Send,{Enter}
Return
 
s2:
Send,{Enter}
sleep 10
Send,BARON 7 min
sleep 10
Send,{Enter}
Return

;********************************
;**Capture Multiple Key Presses**
;********************************
MultiPress(actionList = "", delay = 400)
{
Static pressCount := 0
 
pressCount := ( ((A_PriorHotKey = "") || (A_ThisHotKey = A_PriorHotKey)) && (A_TimeSincePriorHotkey < delay) ) ? (pressCount + 1) : (1)
 
if (actionList = "")  ;this option flags to just return count to caller (no list present)
Return pressCount
 
SetTimer, TakeAction, % delay
Loop, Parse, actionList, `,, %A_Space%
 
if (A_Index = pressCount)
Return A_LoopField
 
Return False
}


Ruevil2
  • Members
  • 226 posts
  • Last active: Dec 04 2015 11:05 PM
  • Joined: 27 Mar 2012

No problem. I'm glad someone else has made good use of it. I hadn't considered using it for stacking actions or buff timers, just for chat call out so far. I play a lot of Solo Q and I hate getting jumped while typing.

 

Is the delay still a problem if you adjust down the capture delay? This will shorten the amount of time that the script waits for the next keypress before performing the desired action.

 

Edit the delay time in this line, less time requires faster key presses:

MultiPress(actionList = "", delay = 400)

 

or

 

If you would like to set a different delay based on the set of actions, use MutliPress like this with the delay set in the call:

$Numpad4::Action := MultiPress("11, 12, 13, 14", 300)

 

What server do you play?


If I helped you out and you would like to show appreciation, feel free to buy me a beer.  grin.png   btn_donateCC_LG.gif


Arcanist
  • Members
  • 27 posts
  • Last active: Jan 27 2018 08:46 AM
  • Joined: 10 Mar 2014

I'd rather click once for a heal. I saw that I could change the delay.

 

I play on Oceania. Arcanist is my user. I'm from Australia