While the answer is generally yes, it depends on what you mean by "commands".
a) If you just want different spells/abilities, use:
(replace Spell1 and Spell2 with the actual spells you want to use)#showtooltip
/cast [mod:ctrl] Spell1; Spell2
Spell1 is cast when you're pressing Ctrl while clicking the button or pressing the keybind, and Spell2 in all other cases. Instead of "ctrl" you can also use "shift" or "alt".
The options in the brackets are called macro conditionals.
b) If you mean slash commands, like emotes or e.g. /startattack, it's similar, those can also have conditionals:
When pressing Ctrl, attack your target, without, just wave at them./startattack [mod:ctrl]
/wave [nomod:ctrl]
Separate lines since these are different commands, and so each has its own bracket. If you omitted the bracket of /wave, you would wave even as you start attacking
For more on macro conditionals, see this Wowpedia page
c) If you mean actual script commands, you can use the function SecureCmdOptionParse to emulate the conditionals, but there are also specific functions to query the state of modifier keys.
Sure:Also, is there a macro to open the alchemy profession window?
This is a toggle, however, using it while the profession window is already open, closes it.#showtooltip
/cast Alchemy
Last edited by Nathanyel; 2021-03-09 at 01:45 PM.
But your duty to Azeroth is not yet complete. More is demanded of you... a price the living cannot pay.
hey guys
im trying to cast Power Infusion on a certain player and with an alt modifier on myself. i tried a lot with different macros but nothing seems to work really
/cast [@PlayerName][mod:alt,@player] Power Infusion; Power Infusion
/target PlayerName
/cast Power Infusion
/targetlasttarget
/cast [mod:alt,@player] Power Infusion
any way to rewrite one of these macros to make it work?
Macro lines are executed in sequence, left-to-right then top-to-bottom, stopping and running with the first valid part it finds. In a single line, macros actually stop. In multiple lines, the first action that causes a global cooldown is what stops the rest. Modifiers have to be listed first, otherwise the macro won't reach them.
You also need to include the server name if the intended target is not on your exact server. Let's say you're on US Gundrak and you're in a guild with this intended target, but they're on US Dreadmaul. These two servers are part of a connected group of five, allowing you two to be in the same guild, but you're still on different servers. You need to use Playername-Dreadmaul to target them specifically in macros.
#showtooltip
/cast [mod:alt,@player][@PlayerName][] Power Infusion
#showtooltip
/cast [mod:alt,@player] Power Infusion
/stopmacro [mod:alt]
/target PlayerName
/cast Power Infusion
/targetlasttarget
thank you so much!
Looking to combine two macros into one and adding a shift modifier to the focus portion. (Had to remove the adress sign from my macros due to mmo champion thinking it is a link...)
Code:/cast [mouseover,exists,harm,nodead] [] Death GripCode:/cast [focus] Death Grip
Note: the exists can be dropped, it is implied by harm and nodead.
But your duty to Azeroth is not yet complete. More is demanded of you... a price the living cannot pay.
Bit of an odd request but is it possible to make a macro that targets party2 but if party2 doesn't exist it targets partypet1? (For arena. I play with a hunter in 2s and with non pet classers in 3s)
/cast [@party2,exists][@party1pet] spell_name
Should work
I just want to target them though not cast a spell on them. Thanks for your help. Appreciate it.
/target [@party2,exists][@party1pet]
You could try this. I'm not sure I don't use /target very often.
Hey all!
I used to have a macro that would clear focus if a modifier key was held for a set amount of time. Simple press of a mod wouldnt clear it. I cannot find this conditional anywhere to recreate it. Anyone out there happen to know what it would be?
Science the shit out of it!
Last edited by Nathanyel; 2021-08-01 at 08:38 PM.
But your duty to Azeroth is not yet complete. More is demanded of you... a price the living cannot pay.
The druid talent Mighty Bash has some very annoying targeting behavior. Basically if you click it, let's say from the spell book it auto targets / auto attacks the nearest mob. This royally screws up my stealth/charge/bash macro. (Attacking a random nearby mob when I'm trying to re stealth).
Is there a way to macro or turn off the auto attack /auto target behavior of Mighty Bash?
Edit: Can't post my macro since it somehow counts as link.
The @ symbols in the macro trigger the new member link protection for some reason, possibly some poorly coded email recognition. Replace them with some other character with a note that they're supposed to be @ symbols.
As for the autotarget part, every class has one or two spells that work like that. These are remnants from Blizzard's QoL changes over the years because players used to macro everything with /startattack in the past, which has this functionality. I'm assuming you can force ignore this with [@target] and making sure there's no [] at the end like most macros (shortcut for "always true" that casts the spell as if it wasn't a macro).