Macro to cast when specific item is equipped?

I was trying to make a macro that would take into account when I have a specific weapon equipped, but, so far, it’s not working out for me…

The item in question is the Pillar of the Drowned Cabal. So, I was trying to make a macro that’d do the following:

  1. When the weapon is equipped → /use the weapon’s ability, while no modifiers are pressed
  2. When the weapon is not equipped, or when a modifier key is used, cast a secondary spell.

So, I tried:

/use [nomod,equipped:Pillar of the Drowned Cabal]Pillar of the Drowned Cabal;Heal

But that didn’t work.
I also tried:

/use [nomod,equipset:Pillar]Pillar of the Drowned Cabal;Heal
after making an equipment set to test this out with, but that didn’t work either.

Am I doing something wrong, or is there no way to have a macro recognize when a specific item is equipped?

Cheers,

D.

You can’t test against specific items using [equipped] only item types.
https://wow.gamepedia.com/Macro_conditionals#equipped:.3Citem_type.3E_or_worn:.3Citem_type.3E

So you could potentially do a workaround hack where your equipment set that has pillar also includes a tabard while the rest don’t then test against a tabard being equipped.

Thanks, Elven. I guess I’ll see if I it’s worth working with something like that or if I’ll just move some stuff around and give the Pillar it’s own dedicated macro instead :slight_smile:

D.

There is a way to do what you want, but you can’t set it up while in combat, so if you change what you’re using for a weapon mid-fight, you’ll be kinda out of luck for a bit.

#show
/run if not InCombatLockdown() then local m,b,p,s=GetRunningMacro()b=strsub(GetMacroBody(m),1,219).."\n"p=GetItemInfo(167863)s=GetSpellInfo(134003)EditMacro(m,nil,nil,b.."/use "..((IsEquippedItem(p)and p)or s))end
/use Pillar of the Drowned Cabal

I assumed the “Heal” you’re using is SpellID 134003.

If that assumption is wrong or if you want a different spell to fire, replace 134003 with whatever the correct (or different) spell ID is.

If you want to use an ITEM as a secondary ability, replace “GetSpellInfo(####)” with “GetItemInfo(####)” and use the correct item ID there.

I had to test this using a lot of cutouts - I don’t have a “usable, equippable” item in my inventory, but I’m relatively certain it will work.

Thank you, Ehiztari, I’ll give it a try and see how it works… I wouldn’t be switching weapons mid-fight so that should be no problem.

:slight_smile:

I know this is old but I want to help. This method wont work.

/use [mod] this; that

typically doesn’t work very well, or predictably. It would help if you broke it down.

What I would do is something like this:

/use [nomod,equipped:Pillar of the Drowned Cabal] Pillar of the Drowned Cabal
/cast [mod,noequipped:Pillar of the Drowned Cabal] EnterYourSpellNameHere

I do something similar in classic on my hunter for weapon swapping:

/use [equipped:Held In Off-hand] Ancient Cornerstone Grimoire
/equipslot [equipped:Held In Off-hand] 17 Doom’s Edge
/equipslot [equipped:One-Hand] 17 Ancient Cornerstone Grimoire

Hope this helps

Please tell me you didn’t just necro a two-year-dead thread to start with a falsehood and work into twaddle and nonsense.

/use [mod]this;that

That basic structure is in a dozen macros on four of my toons right now and it works perfectly. If it doesn’t work for you it’s likely because a) you made a mistake in the syntax or b) you failed to move the macro to your action bar.

The only difference between /use and /cast is that /use favors items over spells and /cast favors spells over items.

The difference between this
/use [nomod,equipped: Pillar of the Drowned Cabal ] Pillar of the Drowned Cabal

And this:
/use [equipped: Held In Off-hand ] Ancient Cornerstone Grimoire

Is the first thing, “Pillar of the Drowned Cabal”, is the name of a specific item and the second thing, “held in off-hand”, is a generic type/category name that encompasses many items.

As was previously mentioned the “equipped:SpecificItemName” does not work, it’s not supported. “equipped:ItemType” is supported. The first example won’t work, the second one does.

2 Likes

I know this is YEARS old at this point but ive been using this macro for a while but its now broken with the new API changes, been trying to fix it but ive never understood coding, HELP! i know GetSpellInfo and GetItemInfo are now C_Spell.GetSpellInfo and C_Item.GetItemInfo but i still cant get it going.

Plus, they return a structured list now, not just an array of data.

If you only need the name of the spell or item, there are more specific query hooks in the C_SPELL and C_ITEM family that do that now. e.g. C_Spell.GetSpellName(x), C_Item.GetItemNameByID(x)