Log in

View Full Version : [WoW] Alternating Keys in HotKeyNet



Khatovar
11-29-2010, 08:43 AM
Seeing as alternating spam keys (http://www.dual-boxing.com/showthread.php?t=32633) seems to be the way to go for dealing with all our new spells in Cataclysm, I figured I'd post a quick guide on how to set this up in HotKeyNet. It's really rather simple using toggles.

Step 1
Create a Hotkey

This will be the key you normally spam.


<Hotkey 2>
<Cancel>
<SendLabel w1, w2, w3, w4>
<DoHotkey Hotkey F9>

All this does is tell HotKeyNet that when you press 2, you want to trigger your toggled hotkey, which in this case I have set up as F9. The <Cancel> command is in place to clear queued keypresses. You may find you don't need it, personally, I found it to help a lot.

Step 2
Create your alternating keys. This will be the keys that are actually sent to your WoWs on a rotating basis.


<Hotkey F9>
<Toggle>
<SendLabel w1, w2, w3, w4>
<Key 2>
<Cancel>
<Toggle>
<SendLabel w1, w2, w3, w4>
<Key Numpad1>
<Cancel>
<Toggle>
<SendLabel w1, w2, w3, w4>
<Key 2>
<Cancel>
<Toggle>
<SendLabel w1, w3>
<Key Numpad1>
<Cancel>
<SendLabel w2, w4>
<Key Numpad2>
<Cancel>

Mostly people seem to use only 2 alternating keys it seems. I use 3 on a few of my guys, specifically my healer as it allows her to spam a shock macro, Riptides on random party members and finally Riptide on herself since /targetparty excludes the player casting the spell.

You'll notice I put a <Cancel> command after all the sent keys. It's not because I'm totally infatuated with typing Cancel. The way Toggles are set up with HotKeyNet, calling them with another hotkey {in this case, 2} tells it to cycle through all the commands in the toggle from start to finish until the toggle is complete. We don't want to do that, obviously. Adding a <Cancel> tells HKN to execute 1 key in the toggle and cancel any remaining action. HKN will keep track of what toggle was last sent and proceed to the next one in line the next time you hit the button.

You can also write the hotkey directly as a toggle instead of calling it from another hotkey. In that case, you wouldn't need all the cancels.


<Hotkey 2>
<Toggle>
<SendLabel w1, w2, w3, w4>
<Key 2>
<Toggle>
<SendLabel w1, w2, w3, w4>
<Key Numpad1>
etc etc etc

But, this will only work if you don't use any If statements in your hotkey. My 2 and 3 hotkeys have If commands in place for mouseover actions, therefore I can't call toggles directly.

Step 3
Make your macros. I'm sure you don't need any help with that from me, but I'll post my current ingame macros.

Prot Paladin

Macro 1 - Single-target tanking {key 2}

/castsequence reset=combat Crusader Strike, Judgement, Crusader Strike, Crusader Strike, Shield of the Righteous
/startattack

Macro 2 - "Proc" key for both single and AOE tanking {numpad2}

/castsequence Holy Wrath, Avenger's Shield

Macro 3 - AoE Tanking {key 3}

/castsequence reset=combat Hammer of the Righteous, Judgement, Hammer of the Righteous, Crusader Strike, Shield of the Righteous
/startattack

Resto Shaman

Macro 1 - Shock Spam {key 2 and 3}

/castsequence [@focustarget] reset=3 Flame Shock, Earth Shock, Earth Shock

Macro 2 - Party Riptides {numpad2}

/targetparty
/cast Riptide

Macro 3 - Self Riptide {numpad3}

/cast [@player] Riptide

Enhancement Shammy

Macro 1 - Single-target DPS {key 2}

/assist focus
/castsequence [@focustarget] reset=combat Stormstrike, Lava Lash
/startattack
/petattack

Macro 2 - Shocks for Single and AoE {numpad1}

/castsequence [@focustarget] reset=combat Flame Shock, Earth Shock, Earth Shock

Macro 3 - AoE DPS {key 3}

/assist focus
/castsequence [@focustarget] reset=combat Magma Totem, Stormstrike, Lava Lash, Stormstrike, Lava Lash
/cast Fire Nova
/startattack
/petattack

Ret Pally*

Macro 1 - Single Target DPS {key 2}

/assist focus
/castsequence reset=5 Seal of Truth, null
/castsequence [@focustarget] reset=5 Judgement, Crusader Strike, Crusader Strike
/startattack

Macro 2 - Single Target and AoE "Procs" {numpad1}

/castsequence Templar's Verdict, Holy Wrath

Macro 3 - More ST and AoE "procs" {numpad2}

/cast Templar's Verdict
/cast Holy Wrath

Macro 4 - AoE DPS {key 3}

/assist focus
/castsequence reset=combat Seal Of Righteousness, null
/castsequence [@focustarget] reset=5 Judgement, Divine Storm, Crusader Strike
/startattack

Unholy DK **

Macro 1 - Single Target "Setup"

/castsequence reset=target/3 Icy Touch, Plague Strike, Festering Strike, Pestilence, Scourge Strike, null
/cast Dark Transformation
/petattack

Macro 2 - ST Spam

/castsequence Scourge Strike, Festering Strike, Death Coil

Macro 3 - AoE "Setup"

/castsequence reset=target/3 Plague Strike, Icy Touch, Blood Boil, Pestilence, Scourge Strike, null
/cast Dark Transformation
/petattack

Macro 4 - AoE Spam

/castsequence Blood Boil, Icy Touch, Scourge Strike
/cast Death Coil

* Yeah, I have essentially the same thing going on twice on my Ret. The reason for this was I was either casting TV all the time with 1 HP, or it was hanging all the time on Holy Wrath. Using the cast sequence + the additional button with 2 /casts gave me the best balance of 2+HP TVs without too much time sitting on 3HP.

** My husband liked my setup so much that he wanted to use the same thing for his DK, so I set him up with a solo HotKeyNet code that lets him go back to the days of 1-button spam. ;)

Freddie
11-29-2010, 01:09 PM
Khat, excellent tutorial, but Step 1 probably doesn't do what you think it does. It asks HotkeyNet to send "DoHotkey" to labels (to windows) but this is a meaningless request for HotkeyNet because windows can't execute hotkeys.

What does your Step 1 really do? It creates a loop, and inside that loop, it executes hotkey F9 four times. (SendLabel creates a loop if its called with multiple labels.)

I'm guessing that this is not what you're trying to do.

Like I always tell people -- this is the single most important piece of advice I can give HotkeyNet users -- load that hotkey and then examine it with "Show hotkey definition," which shows how HotkeyNet interprets the hotkey.

Also, I'm not sure why you think you need the extra hotkey. You say it's needed for If's but you can nest If's inside toggles.

Khatovar
11-30-2010, 02:24 AM
I've found the third example is the best way to do it if you don't have tons of if/else if in the hotkey, so I can definitely understand what you're saying. However, I use a slew of mouseovers in my standard spam keys.

If I add the toggles on the top or bottom of my hotkey, the toggles seem to interfere with the mouseovers, turning it into a crapshoot on whether I get the toggle or the mouseover.

If I add DoHotkey on the tail end of my hotkey, the mouseover interferes with the toggles and any window not responding to the mouseover doesn't do anything. If I add it to the top, mouseovers never work.

If I add the toggles within the mouseover, it throws errors at the next mouseover command, stating "Else If" can only follow "If".

Using SendLabel > DoHotkey allows me to get everyone to do what I want them to do. Cancel kills any loops. Here's a snippet of my code with the information from HKN. 4 keypresses total, 1 for each mouseover region and 1 not over a mouseover region.


<Hotkey 2>
<Cancel>
//* PARTY HEALS
<If MouseIsOverWindowRect WoW1 28 55 54 370>
<SendLabel w2>
<SaveMousePos>
<Clickmouse Noclick Norestore>
<Key LCtrl 1>
<RestoreMousePos>
<SendLabel w1, w3, w4>
<DoHotkey Hotkey F9>
<Else If MouseIsOverWindowRect WoW 83 55 154 370>
<SendLabel w2>
<SaveMousePos>
<Clickmouse Noclick Norestore>
<Key LCtrl 2>
<RestoreMousePos>
<SendLabel w1, w3, w4>
<DoHotkey Hotkey F9>
<Else If MouseIsOverWindowRect WoW 238 55 49 370>
<SendLabel w2>
<SaveMousePos>
<Clickmouse Noclick Norestore>
<Key LCtrl 3>
<RestoreMousePos>
<SendLabel w1, w3, w4>
<DoHotkey Hotkey F9>
<Else>
<SendLabel w1, w2, w3, w4>
<DoHotkey Hotkey F9>

<Hotkey 2>
<Hotkey F9> [Toggle 3]
<Hotkey 2>
<Hotkey F9> [Toggle 4]
<Hotkey 2>
<Hotkey F9> [Toggle 1]
<Hotkey 2>
<Hotkey F9> [Toggle 2]


From this pc: <Cancel>

From this pc: <CursorInfo 46 79 1680 1022 46 79 1680 1050 930 295><SendWinM WoW2><SaveMousePos><Clickmouse Noclick Norestore><Key LCtrl 1><RestoreMousePos><SendWinM WoW1><DoHotkey Hotkey F9><SendWinM WoW3><DoHotkey Hotkey F9><SendWinM WoW4><DoHotkey Hotkey F9>
<Cancel> completed
<CursorInfo 46 79 1680 1022 46 79 1680 1050 930 295> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<SaveMousePos> completed: position 46, 79 has been saved.
<Clickmouse Noclick Norestore> completed
<Key LCtrl 1> completed
<RestoreMousePos> completed: mouse cursor restored to 46, 79.
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<DoHotkey Hotkey F9> completed

From this pc: <SendWinM WoW1><Key 2><Cancel><SendWinM WoW2><Key 2><Cancel><SendWinM WoW3><Key 2><Cancel><SendWinM WoW4><Key 2><Cancel>
<SendWinM WoW3> completed: Window found. Target set to 0x20290 "WoW3"
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<Key 2> completed
<Cancel> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<Key 2> completed
<Cancel> completed
<SendWinM WoW3> completed: Window found. Target set to 0x20290 "WoW3"
<Key 2> completed
<Cancel> completed
<SendWinM WoW4> completed: Window found. Target set to 0x20298 "WoW4"
<Key 2> completed
<Cancel> completed

From this pc: <Cancel>

From this pc: <CursorInfo 147 79 1680 1022 147 79 1680 1050 930 295><SendWinM WoW2><SaveMousePos><Clickmouse Noclick Norestore><Key LCtrl 2><RestoreMousePos><SendWinM WoW1><DoHotkey Hotkey F9><SendWinM WoW3><DoHotkey Hotkey F9><SendWinM WoW4><DoHotkey Hotkey F9>
<Cancel> completed
<CursorInfo 147 79 1680 1022 147 79 1680 1050 930 295> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<SaveMousePos> completed: position 147, 79 has been saved.
<Clickmouse Noclick Norestore> completed
<Key LCtrl 2> completed
<RestoreMousePos> completed: mouse cursor restored to 147, 79.
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"

From this pc: <SendWinM WoW1><Key Numpad1><Cancel><SendWinM WoW3><Key Numpad1><Cancel><SendWinM WoW2><Key Numpad2><Cancel><SendWinM WoW4><Key Numpad2><Cancel>
<DoHotkey Hotkey F9> completed
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<Key Numpad1> completed
<Cancel> completed
<SendWinM WoW3> completed: Window found. Target set to 0x20290 "WoW3"
<Key Numpad1> completed
<Cancel> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<Key Numpad2> completed
<Cancel> completed
<SendWinM WoW4> completed: Window found. Target set to 0x20298 "WoW4"
<Key Numpad2> completed
<Cancel> completed

From this pc: <Cancel>

From this pc: <CursorInfo 270 81 1680 1022 270 81 1680 1050 930 295><SendWinM WoW2><SaveMousePos><Clickmouse Noclick Norestore><Key LCtrl 3><RestoreMousePos><SendWinM WoW1><DoHotkey Hotkey F9><SendWinM WoW3><DoHotkey Hotkey F9><SendWinM WoW4><DoHotkey Hotkey F9>
<Cancel> completed
<CursorInfo 270 81 1680 1022 270 81 1680 1050 930 295> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<SaveMousePos> completed: position 270, 81 has been saved.
<Clickmouse Noclick Norestore> completed
<Key LCtrl 3> completed
<RestoreMousePos> completed: mouse cursor restored to 270, 81.
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"

From this pc: <SendWinM WoW1><Key 2><Cancel><SendWinM WoW2><Key 2><Cancel><SendWinM WoW3><Key 2><Cancel><SendWinM WoW4><Key 2><Cancel>
<DoHotkey Hotkey F9> completed
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<Key 2> completed
<Cancel> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<Key 2> completed
<Cancel> completed
<SendWinM WoW3> completed: Window found. Target set to 0x20290 "WoW3"
<Key 2> completed
<Cancel> completed
<SendWinM WoW4> completed: Window found. Target set to 0x20298 "WoW4"
<Key 2> completed
<Cancel> completed

From this pc: <Cancel>
<Cancel> completed

From this pc: <SendWinM WoW1><DoHotkey Hotkey F9><SendWinM WoW2><DoHotkey Hotkey F9><SendWinM WoW3><DoHotkey Hotkey F9><SendWinM WoW4><DoHotkey Hotkey F9>
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<DoHotkey Hotkey F9> completed

From this pc: <SendWinM WoW1><Key Numpad1><Cancel><SendWinM WoW2><Key Numpad1><Cancel><SendWinM WoW3><Key Numpad1><Cancel><SendWinM WoW4><Key Numpad1><Cancel>
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<SendWinM WoW1> completed: Window found. Target set to 0x202AC "WoW1"
<Key Numpad1> completed
<Cancel> completed
<SendWinM WoW2> completed: Window found. Target set to 0x20286 "WoW2"
<Key Numpad1> completed
<Cancel> completed
<SendWinM WoW3> completed: Window found. Target set to 0x20290 "WoW3"
<Key Numpad1> completed
<Cancel> completed
<SendWinM WoW4> completed: Window found. Target set to 0x20298 "WoW4"
<Key Numpad1> completed
<Cancel> completed

The only issue I come across is because Hotkey F9 has sends to w2, it still processes those, but since the mouseover is already taking place, it doesn't matter.

Bloodcloud
12-02-2010, 08:17 AM
Never needed the cancel and I have nested stiff with dohotkey

I created two variables: BOSS and DPSON. (which I visualize with screen buttons, example below)
(I also set the variables initially in autoexec, so they are always defined)

basically when I spam 1 the tank will always do something and the DPS will only start when I switch DPSON with "3"

The BOSS variable goes to single target rotation for my tank and to a different proc macro (e.g. lock does curses...)

enjoy:)




<Hotkey 1>
<If BOSS is 0 >
//tank AOE
<dohotkey Hotkey OemPa1 4>

// LOCK/Mage/shammy DPS
<dohotkey Hotkey OemPa2 7>

<Else if BOSS is 1 >
//tank Single target
<dohotkey Hotkey OemPa1 5>

// LOCK/Mage/shammy Boss
<dohotkey Hotkey OemPa2 8>


//=====================================
// TANK Attack AOE
//
<Hotkey OemPa1 4>
<toggle>
<SendLabel w1>
<Key 1>
<toggle>
<SendLabel w1>
<Key 4>

//=====================================
// TANK Attack Single Target
//
<Hotkey OemPa1 5>
<toggle>
<SendLabel w1>
<Key 3>
<toggle>
<SendLabel w1>
<Key 4>


//=====================================
// Lock/mage Normal DPS
//
<Hotkey OemPa2 7>
<If DPSON is 1 >
<dohotkey Hotkey OemPa1 7>

<Hotkey OemPa1 7>
<toggle>
<SendLabel w2,w3,w4>
<Key 1>
<toggle>
<SendLabel w2,w3,w4>
<Key 2>

//=====================================
// Lock/mage Boss toggle
//
<Hotkey OemPa2 8>
<If DPSON is 1 >
<dohotkey Hotkey OemPa1 8>

<Hotkey OemPa1 8>
<If DPSON is 1 >
<toggle>
<SendLabel w2,w3,w4>
<Key 1>
<toggle>
<SendLabel w2,w3,w4>
<Key 4>

//===BOSS=========================================== =

<Hotkey ScrollLockOn 3>
<If BOSS is 0>
<SetVar BOSS 1>
<SetButtoncolors BUTTON-BOSS 0x0000FF>
<Else If BOSS is 1>
<SetVar BOSS 0>
<SetButtoncolors BUTTON-BOSS 0x000000>
<Else>
<SetVar BOSS 1>
<SetButtoncolors BUTTON-BOSS 0x0000FF>

Mercurio
12-02-2010, 07:18 PM
Nice Khatovar!

Thanks for helping others use the power of the 2 Step :)

dubiox
12-09-2010, 06:42 AM
Good to see people still using HKN. Isboxer is for clickers. :)

Why just 2 keys? For my single target tanking I have 7 and for aoe I have 6. I use ctl-alt-shift-2 to switch between them using what I think is clever use of SetToggle. (Notice the two toggle loops in a single hotkey). When I have 3 holy power I hit alt-2. It is not a perfect 939 of course but it seems to be close enough dps-wise on a dummy and was much better than the stickied 2-step. (if there is a better way to evaluate it let me know)

Every other toon for now is just doing 2 keys but with my script that can be changed individually very quickly.



<Hotkey ScrollLockOff 2>
<DoHotkey Hotkey LAlt Hangul> //toon1
<DoHotkey Hotkey RAlt Hangul> //toon2
<DoHotkey Hotkey LShift Hangul> //and so on
<DoHotkey Hotkey RShift Hangul>
<DoHotkey Hotkey RCtrl Hangul>

<Hotkey lctrl lalt lshift 2>
<Toggle>
<SetToggle 8 Hotkey LAlt Hangul> //aoe rotation
<Toggle>
<SetToggle 1 Hotkey LAlt Hangul> //single target

<Hotkey LAlt Hangul>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift a>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift s>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift d>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift f>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift g>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift h>
<Toggle>
<SendLabel w1>
<Key lctrl lalt lshift j>
<SetToggle 1 Hotkey LAlt Hangul>
// toggles 8-13 are for aoe tank rotation
<Toggle>
<SendLabel w1>
<Key lalt lshift a>
<Toggle>
<SendLabel w1>
<Key lalt lshift s>
<Toggle>
<SendLabel w1>
<Key lalt lshift d>
<Toggle>
<SendLabel w1>
<Key lalt lshift f>
<Toggle>
<SendLabel w1>
<Key lalt lshift g>
<Toggle>
<SendLabel w1>
<Key lalt lshift h>
<SetToggle 8 Hotkey LAlt Hangul>

// rest of the sequences for each toon are after this and are just dual toggles separately for each

Khatovar
12-09-2010, 07:33 AM
Like I said "Mostly people seem to use only 2 alternating keys it seems. I use 3 on a few of my guys". I showed setup for 2 and 4 toggles, but I've not yet found need for any more than 3 toggles used with small cast sequences yet. You could do 80 toggles if you liked, it's up to your own needs.

Flekkie
12-20-2010, 04:35 PM
Looks awesome.

I'm trying to get the following to work for FTL with alternating.
Example below should send alternating 4 & 9 with FTL modifiers, but when I click 'Show Loaded Hotkeys' I get the if statements in unexpected places and in doesn't quite work. Can anyone help?

[EDIT: Removed the script & Loaded Hotkeys since the problem has been solved (next post). No point in leaving code up which didn't work.]

Flekkie
12-21-2010, 06:02 PM
Phew, solved it. For those that need to send alternating keystrokes with FTL modifiers, here is a working adaptation of Olipcs' FTL code.
I won't be testing it in-game until after Christmas, but it was sending the correct keystrokes and modifiers to the login screens according to the actions window.

I've commented in the basics. Those who can wrap their head around the FTL stuff will hopefully have enough to go on there.



//-----------------------------------------------------------
// Example of creating an FTL hotkey which toggles.
// Here, pressing 4 will toggle between sending 4 and 9,
// and still also send the FTL modifiers correctly.
//-----------------------------------------------------------


//-----------------------------------------------------------
// TEMPLATES FOR SETTING UP THE FTL HOTKEYS
// These are only really different from Olipcs' method in that
// the kotkey may be a different key to the keys being sent.
//-----------------------------------------------------------

// %1% : Master key
// %2% : Slave key
// %3% : Modifier
// %4% : List of mail labels for the slave windows
<Template SendMasterAndSlave>
<SendFocusWin>
<Key %1%>
<SendLabel %4%>
<Key %3% %2%>
<EndTemplate>

// %1% : Master key
// %2% : Slave key
// %3% : Modifier
// %4% : Active window
// %5% : List of mail labels for the slave windows
<Template SendLeaderless>
<If ActiveWinIs %4%>
<ApplyTemplate SendMasterAndSlave "%1%" "%2%" "%3%" "%5%">
<EndTemplate>


// %1% : Hotkey (Key to be pressed)
// %2% : master-key (Key to be sent to Focus window)
// %3% : slave-key (Key to be sent to other windows, with the FTL modifier)
<Template FTL>
<Hotkey %1%>
<ApplyTemplate SendLeaderless "%2%" "%3%" "rctrl rshift" WoW1 "w2,w3,w4,w5">
<ApplyTemplate SendLeaderless "%2%" "%3%" "rctrl ralt" WoW2 "w1,w3,w4,w5">
<ApplyTemplate SendLeaderless "%2%" "%3%" "ralt rshift" WoW3 "w1,w2,w4,w5">
<ApplyTemplate SendLeaderless "%2%" "%3%" "rctrl ralt rshift" WoW4 "w1,w2,w3,w5">
<ApplyTemplate SendLeaderless "%2%" "%3%" "rctrl" WoW5 "w1,w2,w3,w4">
<EndTemplate>


//-----------------------------------------------------------
// USE THE TEMPLATES TO CREATE 2 HOTKEYS
// I used 2 Japanese letters which do not appear on my keyboard
// in order to save keys, since these two are only ever going
// to be 'pressed' by HKN.
// So 'pressing' Kana will send 4 to the active window, and 4 with
// FTL modifiers to the other windows, and 'pressing' Junja will
// send 9 in the same way.
//-----------------------------------------------------------

<ApplyTemplate FTL "Kana" "4" "4">
<ApplyTemplate FTL "Junja" "9" "9">


//-----------------------------------------------------------
// CREATE A FINAL HOTKEY TO CALL THE OTHER TWO ALTERNATELY
//-----------------------------------------------------------

<Hotkey 4>
<Toggle>
<DoHotkey Hotkey Kana>
<Toggle>
<DoHotkey Hotkey Junja>


// I haven't tested them, but I believe you can use "Final" and "Hanja" as hotkeys
// as well.