A Note on my hotkeys:
Everyone’s hotkeys are different, so here is a brief explanation of mine. This will help give context to my script
Heroes:
q, w, e, r Passive, AOE, Nuke, Ult
a, s, d, f Hold, Move, Attack, Stop
z, x, c, v Nothing, Nothing, Hide, Learn Skill
Buildings:
q, w, e, r Train units in a building
a, s, d, f Upgrades
z, x, c, v Other Upgrades
My script has this at the top, you can modify as needed. If you know of any modification here that will make the script run better, let me know!
Process, priority, , High ; Have the script set itself to high priority #IfWinActive Warcraft III #InstallMouseHook #SingleInstance force #InstallKeybdHook #UseHook On SetBatchLines 10ms #HotString SP #MaxThreads 20 CoordMode, mouse, Screen SetKeyDelay, 10, 0, Play SetMouseDelay, 10 , Play Healer=3
SCRIPT ONE: Command all control groups at once
Capslock & d::SendPlay, 1d{LButton}2d{LButton}3d{LButton}4d{LButton}5d{LButton}1 Capslock & S::SendPlay, 1s{LButton}2s{LButton}3s{LButton}4s{LButton}5S{LButton}1 Capslock & A::SendPlay, 1a{LButton}2a{LButton}3a{LButton}4a{LButton}5a{LButton}1 Capslock & F::SendPlay, 1f{LButton}2f{LButton}3f{LButton}4f{LButton}5f{LButton}1
Explanation: Simply hold down CAPSLOCK and all of your command groups will do whatever basic unit action you indicate. Control group 1 is automatically reselected after issuing the commands. In my case, Capslock and D makes all of my units move-attack wherever my cursor is, and Capslock and S moves all of my control groups to wherever my mouse is.
Strengths: This makes it very easy to move your whole army. You will never have to worry about leaving a control group behind again.
Weaknesses: The hold and stop commands still need mouse clicks for some reason. I don’t know why, since you don’t have to mouse click anywhere to issue the command, but without it your units won’t obey the command to stop/hold. Also, I have had trouble with the script going haywire if many macrocommands are issued in quick succession. Currently looking into Thread and Batch specs to solve the problem.
SCRIPT TWO: Use all hero abilities
Capslock & e::SendPlay, {F1}e{LButton}{F2}e{LButton}{F3}e{LButton}1 Capslock & q::SendPlay, {F1}q{LButton}{F2}q{LButton}{F3}q{LButton}1 Capslock & w::SendPlay, {F1}w{LButton}{F2}w{LButton}{F3}w{LButton}1 Capslock & r::SendPlay, {F1}r{LButton}{F2}r{LButton}{F3}r{LButton}1
Explanation: Hold down Capslock before using a hero ability, and all heroes will use the ability associated with that key. Control group 1 is automatically reselected after issuing the commands. For example, my DeathKnight has E for Death Coil, my DreadLord has E for Carrion Swarm, and my Lich has E for Frost Nova. My pressing Capslock and e, all three heroes will instantly nuke whatever my cursor is over.
Strengths: Very easy to use, works like a charm, and you don’t have to cycle through your heroes to see who is on cooldown- just capslock and e, and whoever has a nuke ready will let it rip!
Weaknesses: This one seems rock solid. I can’t think of anything else this script should do nor anyway to improve it.
SCRIPT THREE: Paladin/Death Knight InstaHeal
;InstaHeal Script RShift & 1::healer=1 RShift & 2::healer=2 RShift & 3::healer=3 ' & 1:: ' & 2:: ' & 3:: if InStr(A_ThisHotkey, "1") cy=59 else if InStr(A_ThisHotkey, "2") cy=123 else cy=184 MouseGetPos, x, y SendPlay, {F%healer%}e{Click 30, %cy%}{Esc}1 MouseMove, x, y return
Explanation: One of the scripts I am most proud of, yet the one that has the most area for improvement. My pressing Alt and 1 you heal the first hero you got, Alt and 2 the second hero you trained, and Alt and 3 the third hero. Control group 1 is automatically reselected after the heal command is issued.
IMPORTANT NOTE: This will only work if your healer was the third hero trained!
Strengths: Such a lifesaver that it can turn the game around. No more clicking around to heal your ArchMage with 50 hp left- just Alt and 1 and he is back at full!
XXXXXWeaknesses: Wow, where to begin? For starters, I had to resort to using Click instead of MoveMouse because I couldn’t get the command to work. Second, the script doesn’t move your mouse back to where it was when you issued the heal command, but sets it at the middle of your screen. Third, it only works if your healer was the last hero trained. The script is functional to be sure, but it has a long way to go before it is perfect.XXXXXXXX
EDIT: Thanks to JSLOVER, the script now works flawlessly. Press right shift and 1 2 or 3 (to assign your 1st, 2nd, or 3rd hero as healer) and press ' and 1 2 or 3 to heal that hero.I.E. If Paladin is your 2nd hero and you want to heal your 3rd hero, press Rshift 2 after picking the paladin second, and then press ' and 3 to heal the 3rd hero. Note that ' isn't terribly conveninet for most people, so you will want to assign it to somewhere that works for you. Additonaly, the mouse now returns to where you last had it before healing!
SCRIPT FOUR: Use the mouse wheel to go through control groups
group = 1 maxgroup = 2 ;LCtrl+number sets the "max group" LCtrl & 1::maxgroup = 1 LCtrl & 2::maxgroup = 2 LCtrl & 3::maxgroup = 3 LCtrl & 4::maxgroup = 4 LCtrl & 5::maxgroup = 5 ~1::group=1 ~2::group=2 ~3::group=3 ~4::group=4 ~5::group=5 *WheelDown:: group += 1 if(group > maxgroup) group := group - maxgroup if(group < 1) group := group + maxgroup send, %group% return *WheelUp:: group -= 1 if(group > maxgroup) group := group - maxgroup if(group < 1) group := group + maxgroup send, %group% return
Explanation: (I was not the original creator of this script!) Press LCtrl and the number of control groups you want to shuffle through. (Eg. LCtrl and 5 to shuffle through 5.) The mouse wheel will send you one control group up or down, depending on which way you scroll.
Strengths: Makes cycling through your control groups a walk in the park.
Weaknesses: XX AutoHotKey can’t detect when you leave one control group and select another manually. That mean that if you are on control group 4, and then select control group 1 using the “1” on your keyboard, scrolling down will take you to control group 5 rather than 2. XX
Edit 7/16/06:
Using the keyboard to select a control group will no longer cause any problems. If you are on control group 4 and then select control group 1 using the keyboard, scrolling down will now take you to group 2 (as it should) rather than group 5.
Thanks to JSLover, who solved the above problem
LCtrl (and a number) is now used to determine the number of control groups rather than tab. This solves a problem which prevented you from tabbing through different types of units within a control group.
SCRIPT FIVE: InstaTrain/Hero Revive
MOUSE3 & Q::SendPlay, 6Q1 MOUSE3 & W::SendPlay, 6W1 MOUSE3 & E::SendPlay, 6E1 MOUSE3 & R::SendPlay, 6R1 MOUSE3 & A::SendPlay, 7Q1 MOUSE3 & S::SendPlay, 7W1 MOUSE3 & D::SendPlay, 7E1 MOUSE3 & F::SendPlay, 7R1 MOUSE3 & Z::SendPlay, 8Q1 MOUSE3 & X::SendPlay, 8W1 MOUSE3 & C::SendPlay, 8E1 MOUSE3 & v::SendPlay, 8R1
Explanation: The whole reason I started investigating autohotkey. To explain how this work, here is a little “diagram”
BARRACKS (Control Group 6)
q, w, e, r Footman, Rifleman, Knight, Nothing
ARCANE SANCTUARY (Control Group 7)
q, w, e, r Priest, Sorceress, Spellbreaker, Nothing
ALTAR (Control Group 8)
q, w, e, r Archmage, Mountain King, Paladin, Blood Mage
If I press mouse3 and q, I will instantly train a footman and return to control group 1. If I press mouse3 and d, I will instantly train a spellbreaker. If I press mouse3 and v, I will instantly train a blood mage, or revive him if he is dead.
Strengths: Training can’t be easier. You can devote all your energy to creeping or harassing, tap mouse3 and q once and a while, and always have a fresh army of footies.
Weaknesses: None, that I know of. I hope to do the same thing for army upgrades at some point, but because many building have more than four upgrades it isn’t nearly as easy.
SCRIPT SIX: Map manouevering made simple *NEW*
This script was grabbed from the old WarCraft 3 thread and tweaked a bit. This script allows you to use asdw as arrow keys to move the map while holding down spacebar.
w
a s d a=left d=right s=down w=up. Just like in a FPS.
;Screen Manipulation space & w:: Send, {blind}{Up down} space & w up::Send, {blind}{Up up} space & a:: Send, {blind}{Left down} space & a up::Send, {blind}{Left up} space & s:: Send, {blind}{Down down} space & s up::Send, {blind}{Down up} space & d:: Send, {blind}{Right down} space & d up::Send, {blind}{Right up} ;Disable accidental clicks *OPTIONAL* space & q::return space & e::return space & r::return space & f::return space & z::return space & x::return space & c::return space & v::return
The discerning reader may ask, "How am I supposed to press the spacebar to jump to places then?" My answer is to use the key everyone loves to hate.
LWin::SendPlay, {Space}
Make the useless left windows key atone for its sins by doing something useful!
The second part of the code above to disable accidental hotkey usage is optional. Personally, I recommend against using it. By allowing other keys to be pressed, you can still use your nukes (e) while following a hero with the keyboard movements.Otherwise you will have to release pressure from the spacebar, which is one more thing you will have to worry about.
Stengths:Easy to use, can be a life saves in some situations.
Weaknessess: Upon rare ocassion, the game gets stuck moving in one direction. This is usually easy to solve by temporarilly disabling the hotkeys or trying to solve it by pressing the spacebar and asdf again, but potentially it could cost you a game if it occured at the wrong time. I know of no fix to this problem.
SCRIPT SEVEN: Control Group Manipulation Made Easy *NEW*
Control group management is what seperates the pros from the rest of us in many cases- the pros never lever use a unit because they can quickly and effectively remove dying units from control groups and remove them from the fray, and also add new units without losing control of the battle. This script will help you do just that.
;ControlGroupManipulation ' & LButton::SendPlay, 0%Group%{LShift Down}{LButton}{LShift Up}{LControl Down}%Group%{LControl Up}9%Group%
The way the script works is pretty simple. By pressing left click while holding down ', a unit is instantly added (or removed, from that control group. *The unit will be added to the last selected control group!* So if, for example, you see a footman in control group 2 is low, press 2 to select that control group if you haven't already, and then ' & LButton to take him out of the group, (after which, you probably want to send him somewhere safe.) As usual, pick a button that makes sense instead of '.
IMPORTANT NOTE: I have not yet tested this script in WarCraft, so there is a small chance it will not work. I will know with certainity if it works by tomorrow!
Strengths: Normally Getting somone out of a control group can take about 5 seconds of much needed micro, and it is easy to get jumbled trying to do it all at once. This takes care of it for you!
Weaknessess: Untested, and see below.
Areas for Future Development:
Control click selects all units of a given type, and I would like to develop a script that automatically adds all of said units to a control group. If memory serves, pressing shift and then the number of the control adds the units to that control group. If such is the case, I will find and add this feature tomorrow.
Another possible enhancement is the long fabled, but never acheived (that I know) ability to draw a rectangle with your mouse and then instantly add those units to a control group. I need to research the matter more, but once I figure out how to make a script activate after the LButton is released, it should not be too hard.
There might be a more efficicent way to run the script that involves fewer keystrokes, and I will investigate this matter tomorrow as well.
Conclusion: These scripts aren’t perfect, and don’t do anything with autohotkey that hasn’t been done before. However, I am confident that they can help at least a few WarCraft3 players out there. I encourage you to critique (and improve) the scripts I have posted, and post your own as well. I hope you have as much fun using these scripts as I did making them.
-Jaegan
A special thanks to Points for making WarKeys. His work was what prompted me to improve my WarCraft ability and create the scripts you have seen here.
Below is what my current AutoHotKey Program looks like for WarCraft. Use it as a model for your own "crafting!"
Process, priority, , High ; Have the script set itself to high priority #IfWinActive Warcraft III #InstallMouseHook #SingleInstance force #InstallKeybdHook #UseHook On SetBatchLines 10ms #HotString SP #MaxThreads 20 CoordMode, mouse, Screen SetKeyDelay, 10, 0, Play SetMouseDelay, 10 , Play Healer=3 ;InstaTrain Scripts = & Q::SendPlay, 0Q1 = & W::SendPlay, 0W1 = & E::SendPlay, 0D1 = & R::SendPlay, 0F1 = & A::SendPlay, 6Q1 = & S::SendPlay, 6W1 = & D::SendPlay, 6E1 = & F::SendPlay, 6R1 = & Z::SendPlay, 7Q1 = & X::SendPlay, 7W1 = & C::SendPlay, 7E1 = & v::SendPlay, 7R1 - & Q::SendPlay, 8Q1 - & W::SendPlay, 8W1 - & E::SendPlay, 8E1 - & R::SendPlay, 8R1 - & A::SendPlay, 9Q1 - & S::SendPlay, 9W1 - & D::SendPlay, 9E1 - & F::SendPlay, 9R1 - & z::SendPlay, 0{Tab}q1 - & x::SendPlay, 0{Tab}w1 - & c::SendPlay, 0{Tab}e1 - & v::SendPlay, 0{Tab}R1 ;InstaResearch Insert & Q::SendPlay, 6A1 Insert & W::SendPlay, 6S1 Insert & E::SendPlay, 6D1 Insert & R::SendPlay, 6F1 Insert & A::SendPlay, 6{Tab}A1 Insert & S::SendPlay, 6{Tab}S1 Insert & D::SendPlay, 6{Tab}D1 Insert & F::SendPlay, 6{Tab}F1 Insert & Z::SendPlay, 7A1 Insert & X::SendPlay, 7S1 Insert & C::SendPlay, 7D1 Insert & v::SendPlay, 7F1 Home & Q::SendPlay, 8A1 Home & W::SendPlay, 8S1 Home & E::SendPlay, 8D1 Home & R::SendPlay, 8F1 Home & A::SendPlay, 9A1 Home & S::SendPlay, 9S1 Home & D::SendPlay, 9D1 Home & F::SendPlay, 9F1 Home & z::SendPlay, 9{Tab}A1 Home & x::SendPlay, 9{Tab}S1 Home & c::SendPlay, 9{Tab}D1 Home & v::SendPlay, 9{Tab}F1 ;InstaHeal Script RShift & 1::healer=1 RShift & 2::healer=2 RShift & 3::healer=3 ' & 1:: ' & 2:: ' & 3:: if InStr(A_ThisHotkey, "1") cy=59 else if InStr(A_ThisHotkey, "2") cy=123 else cy=184 MouseGetPos, x, y SendPlay, {F%healer%}e{Click 30, %cy%}{Esc}1 MouseMove, x, y return ;MacroControl Capslock & d::SendPlay, 2d{LButton}3d{LButton}4d{LButton}5d{LButton}1d{LButton} Capslock & S::SendPlay, 2s{LButton}3s{LButton}4s{LButton}5S{LButton}1s{LButton} Capslock & A::SendPlay, 2a{LButton}3a{LButton}4a{LButton}5a{LButton}1a{LButton} Capslock & F::SendPlay, 2f{LButton}3f{LButton}4f{LButton}5f{LButton}1f{LButton} Capslock & e::SendPlay, {F1}e{LButton}{F2}e{LButton}{F3}e{LButton}1 Capslock & q::SendPlay, {F1}q{LButton}{F2}q{LButton}{F3}q{LButton}1 Capslock & w::SendPlay, {F1}w{LButton}{F2}w{LButton}{F3}w{LButton}1 Capslock & r::SendPlay, {F1}r{LButton}{F2}r{LButton}{F3}r{LButton}1 group = 1 maxgroup = 2 ;ControlGroupManagement ~Tab & 1::maxgroup = 1 ~Tab & 2::maxgroup = 2 ~Tab & 3::maxgroup = 3 ~Tab & 4::maxgroup = 4 ~Tab & 5::maxgroup = 5 ~1::group=1 ~2::group=2 ~3::group=3 ~4::group=4 ~5::group=5 ~^1::group = 1 ~^2::group = 2 ~^3::group = 3 ~^4::group = 4 ~^5::group = 5 *WheelDown:: group += 1 if(group > maxgroup) group := group - maxgroup if(group < 1) group := group + maxgroup send, %group% return *WheelUp:: group -= 1 if(group > maxgroup) group := group - maxgroup if(group < 1) group := group + maxgroup send, %group% return ;Screen Manipulation space & w:: Send, {blind}{Up down} space & w up::Send, {blind}{Up up} space & a:: Send, {blind}{Left down} space & a up::Send, {blind}{Left up} space & s:: Send, {blind}{Down down} space & s up::Send, {blind}{Down up} space & d:: Send, {blind}{Right down} space & d up::Send, {blind}{Right up} ;ItemUsage ' & W::SendPlay, {NUMPAD7} ; Scroll Left and press the button ' & E::SendPlay, {NUMPAD8} ' & S::SendPlay, {NUMPAD4} ' & D::SendPlay, {NUMPAD5} ' & X::SendPlay, {NUMPAD1} ' & C::SendPlay, {NUMPAD2} ;Quitisbad Alt & Q::SendPlay, Q ;ControlGroupManipulation ' & LButton::SendPlay, 0%Group%{LShift Down}{LButton}{LShift Up}{LControl Down}%Group%{LControl Up}9%Group% LWin::SendPlay, {Space} Numpadenter::Suspend