#HotkeyInterval 0
SetBatchLines, -1
#IfWinActive ahk_class Warcraft III
SetKeyDelay -1,-1
;Add Tray Options
Menu, tray, NoStandard
Menu, tray, add
CommonPath1 = C:Program FilesWarcraft IIICustomKeys.txt;Several Common Paths to your Warcraft Folder.
CommonPath2 = E:Program FilesWarcraft IIICustomKeys.txt;Also serves as examples of how to paste path.
CommonPath3 = C:x86Program FilesWarcraft IIICustomKeys.txt
CommonPath4 = C:x64Program FilesWarcraft IIICustomKeys.txt
CommonPath5 = C:Program FilesGamesWarcraft IIICustomKeys.txt ; <- Mine :P
HotKey1 = Sun Strike
HotKey3 = Forge Spirit
HotKey5 = Ghost Walk
HotKey7 = Alacrity
HotKey9 = EMP
Spell2 = ChaosMeteor
Spell4 = ColdSnap
Spell6 = IceWall
Spell8 = Tornado
Spell10 = DefeaningBlast
Name1 = SunStrike
Name3 = ForgeSpirit
Name5 = GhostWalk
Name7 = Alacrity
Name9 = EMP
Lvl2InvokeEnabled := 0
LastInvSunStrike := 0
LastInvForgeSpirit := 0
LastInvGhostWalk := 0
LastInvAlacrity := 0
LastInvEMP := 0
; If available, read the hotkeys from the .ini file created from the last run. This will
; load all your original hotkeys so that they will not be set every time.
If FileExist('Invoker.ini') {
IniRead, Quas, %A_WorkingDir%Invoker.ini, HotKeys, Quas
IniRead, Wex, %A_WorkingDir%Invoker.ini, HotKeys, Wex
IniRead, Exort, %A_WorkingDir%Invoker.ini, HotKeys, Exort
IniRead, Invoke, %A_WorkingDir%Invoker.ini, HotKeys, Invoke
temp := % Spell%A_Index%
IniRead, temp, %A_WorkingDir%Invoker.ini, HotKeys, %temp%
}
HotKey, %Wex%, WexPress
HotKey, %Invoke%, InvokePress
} else {
}
Loop 5 {
IfExist,% CommonPath%A_Index%;If found in one of those locations, skip the GUI.
If (Common = 1) {
Goto ButtonOK
}
Gui, Add, Edit, w400 vCustomPath, Please paste the path to your CustomKeys.txt here, then press OK or (Alt+O).
Gui, -Theme;Asks user for the path to their CustomKeys.txt
return;Prevents the Auto-execute of the rest of the script.
GuiEscape:
GuiClose:;If the users closes the window, prevents duplicate controls being created.
Gui, Submit
Gui, Destroy;Checks the specified Location, if false, returns to the GUI.
CheckExist = 1
MsgBox, %CustomPath%CustomKeys.txt does not exist.`nPlease try again and input the proper path.
Gui, Add, Edit, w400 vCustomPath, Please paste the path to your CustomKeys.txt here, then press OK or (Alt+O).
Gui, -Theme
} else {;If True, Imports the entire file into a string, then parses the string to find the values
FileRead, CustomInfo, %CustomPath%CustomKeys.txt;relating to Quas, Wex, and Exort.
StringGetPos, StartNumber, CustomInfo, Invoker (Kael)
MsgBox, Your CustomKeys.txt file does not contain Invoker HotKeys.`nGo to www.dotakey.com and download Customkeys.txt or generate your own.
}
StringGetPos, EndNumber, CustomInfo, Necro'lic (Visage)
InvokerInfo := SubStr(CustomInfo, StartNumber, Length)
StringGetPos, StartWex, InvokerInfo, HotKey=, L5
StringGetPos, StartExort, InvokerInfo, Hotkey=, L8
StringGetPos, StartInvoke, InvokerInfo, Hotkey=, L11
val := 2 * A_Index + 15
Start%A_Index% := temp
StartQuas += 8
StartExort += 8
Loop 10 {
temp += 8
}
Wex := SubStr(InvokerInfo, StartWex, 1)
Invoke := Substr(InvokerInfo, StartInvoke, 1)
temp := % Start%A_Index%
temp := % Spell%A_Index%
StringLower, Quas, Quas
StringLower, Exort, Exort
Loop 10 {
StringLower, temp, temp
}
Hotkey, %Quas%, QuasPress, On;Turns the HotKeys On
Hotkey, %Exort%, ExortPress, On
HotKeysEnabled = 1;Tells the user what their HotKeys are.
IniWrite, %Quas%, %A_WorkingDir%Invoker.ini, HotKeys, Quas;Writes their HotKey configuration into an .ini file for easier access.
IniWrite, %Wex%, %A_WorkingDir%Invoker.ini, HotKeys, Wex
IniWrite, %Exort%, %A_WorkingDir%Invoker.ini, HotKeys, Exort
IniWrite, %Invoke%, %A_WorkingDir%Invoker.ini, HotKeys, Invoke
temp := % Spell%A_Index%
IniWrite, %temp%, %A_WorkingDir%Invoker.ini, HotKeys, %name%
}
MsgBox, Your Hotkeys are as Follows.`nQuas = %Quas%`nWex = %Wex%`nExort = %Exort%`nPress Shift+Capslock once you learn Invoke lvl 2.
return
;;#################### Assign HotKeys to each of Invoker's Spells ###################################
HotKeys:
#ctrls = 10 ;How many Hotkey controls to add (1 for each spell = 10).
Gui, Add, Text, x30,% HotKey%A_Index%
IniRead, savedHK%A_Index%, Invoker.ini, HotKeys, %A_Index%, %A_Space%
If savedHK%A_Index% ;Check for saved hotkeys in INI file.
Hotkey,% savedHK%A_Index%, Label%A_Index% ;Activate saved hotkeys if found.
StringReplace, noMods, savedHK%A_Index%, ~ ;Remove tilde (~) and Win (#) modifiers...
StringReplace, noMods, noMods, #,UseErrorLevel ;They are incompatible with hotkey controls (cannot be shown).
Gui, Add, Hotkey, x10 vHK%A_Index% gLabel, %noMods% ;Add hotkey controls and show saved hotkeys.
Gui, Add, CheckBox, x+10 vCB%A_Index% Checked%ErrorLevel%, Use Win;Add checkboxes to allow the Windows key (#) as a modifier...
Gui, Show,Invoker HotKeys
Label:
If %A_GuiControl% in +,^,!,+^,+!,^!,+^! ;If the hotkey contains only modifiers, return to wait for a key.
num := SubStr(A_GuiControl,3) ;Get the index number of the hotkey control.
If (HK%num% != ') { ;If the hotkey is not blank...
If CB%num% ;If the 'Win' box is checked, then add its modifier (#).
If !RegExMatch(HK%num%,'[#!^+]') ;If the new hotkey has no modifiers, add the (~) modifier.
HK%num% := '~' HK%num% ;This prevents any key from being blocked.
If (HK%num% = savedHK%A_Index%) { ;Check for duplicate hotkey...
Loop,4 {
GuiControl,% 'Disable' b:=!b, HK%dup% ;Flash the original hotkey to alert the user.
}
GuiControl,HK%num%,% HK%num% :=' ;Delete the hotkey and clear the control.
ControlFocus, msctls_hotkey%temp%, Invoker HotKeys
}
If (savedHK%num% || HK%num%)
return
setHK(num,INI,GUI) {
Hotkey, %INI%, Label%num%, Off
Hotkey, %GUI%, Label%num%, On
IniWrite,% GUI ? GUI:null, Invoker.ini, Hotkeys, %num%
TrayTip, Label%num%,% !INI ? GUI ' ON':!GUI ? INI ' OFF':GUI ' ON`n' INI ' OFF'
;;########################### Quas Wex and Exort Script ################################33
;; The First Part to my Invoker Script. Whenever the user presses any of their three spells (Quas, Wex and Exort),
;; instead it is pressed 3 times, thus maximizing the potential. It becomes very easy to switch to increased regen,
;; damaged or MS/AS. To prevent accidental usage, Capslock will turn this functionality ON/OFF (when you need to buy
;; items at the shop you only want one of them :P ).
Loop 3 {
}
Loop 3 {
}
Loop 3 {
}
InvokePress:;Basically this is to tell the script that Invoke has been pressed by the user or by me.
InvokePressed := InvokePressed + 1
;; Press Shift + Capslock to tell the script that Level 2 of Invoke has been leveled up.
If (Lvl2InvokeEnabled = 0) {
SendPlay {Enter}Lvl 2 Invoke Enabled {Tab}{Enter}
Lvl2InvokeEnabled := 0
SendPlay {Enter}Lvl 2 Invoke Disabled {Tab}{Enter}
return
;;####################### Each of Invoker's Spells ###############################
;################## SUN STRIKE ################
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Exort%%Exort%%Exort%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvSunStrike := InvokePressed
Sleep, 100
Sleep, 200
}
return
;################## CHAOS METEOR ##############
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Wex%%Exort%%Exort%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvChaosMeteor := InvokePressed
Sleep, 100
Sleep, 200
}
return
;################## FORGE SPIRIT ##############
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Quas%%Exort%%Exort%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvForgeSpirit := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label4:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Quas%%Quas%%Quas%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvColdSnap := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label5:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Quas%%Quas%%Wex%
SendPlay, %Invoke%
}
If (Invoked >= 1){
LastInvGhostWalk := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label6:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Quas%%Exort%%Quas%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvIceWall := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label7:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Wex%%Wex%%Exort%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvAlacrity := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label8:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
SendPlay, %Quas%%Wex%%Wex%
SendPlay, %Invoke%
}
If (Invoked >= 1) {
LastInvTornado := InvokePressed
Sleep, 100
Sleep, 200
}
return
Label9:
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
Sleep, 100
Sleep, 200
} else {
InvokePressed := InvokePressed + 1
Sleep, 100
Sleep, 200
}
LastInvEMP := InvokePressed
;################## DEFEANING BLAST ###########
SendPlay, {LAlt Up}{LWin Up}{LShift Up}{LCntrl Up}
If (Lvl2InvokeEnabled = 1) {
InvokePressed := InvokePressed + 1
Sleep, 100
Sleep, 200
} else {
InvokePressed := InvokePressed + 1
Sleep, 100
Sleep, 200
}
LastInvDefeaningBlast := InvokePressed
;################### Quit #############################
ExitAPP
; Enabled even when Warcraft isn't running or the main screen.
;; Turns HotKeys ON/OFF for a better user experience.
If (HotKeysEnabled = 1) {
Hotkey, %Wex%, WexPress, Off
Traytip, Invoker, Hotkeys Off
HotKeysEnabled = 0;Basic Boolean value to tell the script when HotKeys are enabled/disabled.
Hotkey, %Quas%, QuasPress, On
Hotkey, %Exort%, ExortPress, On
HotKeysEnabled = 1
return
Pause::Pause