Cloak of Coordination Macro

So I am trying to create a macro that will equip the Cloak of Coordination and use it (with 2 clicks of the macro) and then equip the previous cloak I had on. I have been trying to adapt a fishing macro I found here (https ://owlmoth. net/ matt/ 330/ world-of-warcraft-nat-pagles-ultimate-fishing-macro/) that works beautifully. Essentially, the fishing macro will equip my fishing pole and start fishing with button 1 and then when I hit button 2 will re-equip what ever weapons/off-hand items I had equipped previously. It also includes some fun emote use. The fishing macro is:

/run m={‘yawn’,‘bored’}f=‘Fishing’e=C_EquipmentSet g=e.GetEquipmentSetID if IsEquippedItemType(f…’ Poles’)then DoEmote(m[random(9)])else e.CreateEquipmentSet(‘x’)e.SaveEquipmentSet(g(‘x’))e.UseEquipmentSet(g(f))end
/equipset [btn:2] x
/use [btn:1]Fishing

Now, the macro I am trying to get to work so far it:

/run m={‘yawn’,‘bored’}f=‘Capital’e=C_EquipmentSet g=e.GetEquipmentSetID if IsEquippedItem(f…’ 65360’)then DoEmote(m[random(9)])else e.CreateEquipmentSet(‘y’)e.SaveEquipmentSet(g(‘y’))e.UseEquipmentSet(g(f))end
/equipset [btn:2] y
/use [btn:1]15

The issue I am running into is that my macro is not assigning the currently equipped cloak to the temporary equipment set. Instead, it assigns the Cloak of Coordination to both equipment sets. Does anyone have any input on how I could make any changes to the macro to do what the fishing macro does so well? Thanks!

Capital 65360 is not an item.

Just use the item id here.

The fishing macro is saving a bit of space by only storing “Fishing” once and combining it with " Poles" when it needs “Fishing Poles”.

1 Like

Oh my goodness, that was it! Thank you so much! Now it works perfectly :slight_smile:!

It may not be well known but castsequence takes into account equipping and using items with spells on them.

For instance:

#showtooltip
/castsequence reset=30 Cloak of Coordination, Dread Sentinel's Ebony Cloak

First click will equip the Cloak of Coordination, second click will use it, and third click will equip the Dread Sentinel’s Ebony Cloak.

(In practice it seems to stay on the last item–though it may just be a visual bug–so the reset is in there to make it switch back.)

1 Like

So this is working beautifully like this:

/run m={‘yawn’,‘bored’}f='Capital’e=C_EquipmentSet g=e.GetEquipmentSetID if IsEquippedItem(65360)then DoEmote(m[random(9)])else e.CreateEquipmentSet(‘y’)e.SaveEquipmentSet(g(‘y’))e.UseEquipmentSet(g(f))end
/equipset [btn:2] y
/use [btn:1]15

Essentially first left click equips my Cloak of Coordination, second left click does the “Use” effect (i.e. teleports to SW), and then by right clicking the macro it re-equips whatever cloak I had on initially.

My next question is, for my Horde toons, the Cloak of Coordination uses item # 65274. Would I have to create a new macro for my Horde toons, or can IsEquippedItem check for multiple items? Meaning could I have the macro look like this:

/run m={‘yawn’,‘bored’}f='Capital’e=C_EquipmentSet g=e.GetEquipmentSetID if IsEquippedItem(65360,65274)then DoEmote(m[random(9)])else e.CreateEquipmentSet(‘y’)e.SaveEquipmentSet(g(‘y’))e.UseEquipmentSet(g(f))end
/equipset [btn:2] y
/use [btn:1]15

I am still a novice with macros, so I don’t really know how I can structure them too well. Does there need to be an “or” between the numbers of IsEquippedItem?

You need to call the function twice
if IsEquippedItem(65274) or IsEquippedItem(65360) then

/run m={'yawn','bored'}f='Capital'e=C_EquipmentSet g=e.GetEquipmentSetID h=IsEquippedItem if h(65274)or h(65360)then DoEmote(m[random(9)])else e.CreateEquipmentSet('y')e.SaveEquipmentSet(g('y'))e.UseEquipmentSet(g(f))end
/equipset [btn:2] y
/use [btn:1]15

That’s just a bit too long though.
I think this will work but I haven’t tested it

/run e=C_EquipmentSet g=e.GetEquipmentSetID h=IsEquippedItem if h(65274)or h(65360)then DoEmote({'yawn','bored'}[random(9)])else e.CreateEquipmentSet('y')e.SaveEquipmentSet(g('y'))e.UseEquipmentSet(g('Capital'))end
/equipset [btn:2] y
/use [btn:1]15

edit: removed smart quotes

So I tried you macro and it didn’t work, but then when I used my original macro again it also wasn’t working for some reason. The fishing one still works, but I can’t get the initial part (where it equips the “Capital” equipment set) to work anymore for some reason. Did anything change in the coding? Thanks.

I guess Lua doesn’t let you have an unnamed table like that.

/run e=C_EquipmentSet f={'yawn','bored'} g=e.GetEquipmentSetID h=IsEquippedItem if h(65274)or h(65360)then DoEmote(f[random(9)])else e.CreateEquipmentSet('y')e.SaveEquipmentSet(g('y'))e.UseEquipmentSet(g('Capital'))end
/equipset [btn:2] y
/use [btn:1]15
1 Like

You can use ()s around tables like that:

print( ({'this','that','etc'})[2] )

With strings too:

print( ("Hello, world"):len() )
1 Like

Yess! This works! Thank you so much! I appreciate it :slight_smile:

I hate to ask, but did anyone post the final working script for the cloak swap? Or does this script up top still need the table edits?

Original script was a bit complicated and you had to setup an equipment set just for the hearth/cloak, which would end up with outdated/deleted equipment in it. Also, I didn’t want the emotes. This is what I ended up doing, should work with no setup besides the macro:

  • First Left Click will equip the Cloak of Coordination and save current equipment as a set.
  • Second Left Click will use the cloak/hearth
  • Right Click will equip original equipment or interrupt the hearth

/equip [btn:1]Cloak of Coordination
/run e=C_EquipmentSet g=e.GetEquipmentSetID h=IsEquippedItem if (not (h(65274)or h(65360)))then e.CreateEquipmentSet(‘y’)e.SaveEquipmentSet(g(‘y’))end
/equipset [btn:2]y
/use [btn:1]15

Maybe Elvenbane or Gello can optimize further.

I’d just use Gello’s castsequence version from earlier in the thread.

Thank you so much!!

1 Like

You’re welcome!

@Elvenbane:
The only downside with that is that you’ll have to update the macro every time you get a new cloak. With the macro I posted, it should keep working. :slight_smile:

1 Like

Please see my reply two posts down for a much better set of macros.

is it possible to add other cloak too tho cause sometimes 1 is on cd. beside the 255 macro cap how would u go adding them? thx!

There’s no way for a macro to know if something is on a cooldown, so you’ll have to do separate macros. I actually found a much better one a bit ago that doesn’t require equipment sets.

Here are the macros for the three different cloaks:

Cloak of Coordination

/run local c,e,t=65360,GetInventoryItemID("player",15)t=GetItemCooldown(c)>0 if c==e then if COC_PREVEQ and t then EquipItemByName(COC_PREVEQ)COC_PREVEQ=nil end elseif not t then COC_PREVEQ=e and GetItemInfo(e)EquipItemByName(c)end
/use 15

Wrap of Unity

/run local c,e,t=63206,GetInventoryItemID("player",15)t=GetItemCooldown(c)>0 if c==e then if COC_PREVEQ and t then EquipItemByName(COC_PREVEQ)COC_PREVEQ=nil end elseif not t then COC_PREVEQ=e and GetItemInfo(e)EquipItemByName(c)end
/use 15

Shroud of Cooperation

/run local c,e,t=63352,GetInventoryItemID("player",15)t=GetItemCooldown(c)>0 if c==e then if COC_PREVEQ and t then EquipItemByName(COC_PREVEQ)COC_PREVEQ=nil end elseif not t then COC_PREVEQ=e and GetItemInfo(e)EquipItemByName(c)end
/use 15

I highly recommend the addon “Opie” for stuff like this, I put all my travel stuff in one ring, like hearthstones, teleports, items, wormholes.

Another good addon for items that transport you elsewhere is Tome of Teleportation – swaps out cloaks after use.