Equipment switching

Hi I have a macro here which i was using to teleport with cloak of coordination which equips the cloak and teleports me and then re-equips the previous cloak (the one with the higher level)

/run local c,e,t=65274,GetInventoryItemID(“player”,15)t=GetItemCooldown©>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©end
/use 15

FYI I have no idea about how to write macro codes in wow and I am not the one who wrote the code above but I have read about the macros and tried to make a macro with the same idea but in a different way and for a different purpose, what i am trying to do is to make a macro that equips a defined item like (deepdive helmet) then when I click it again it will re-equip the previous item.

Does anyone have any idea if its possible and how, and thanks in forward. :grin:

Well, you basically have the macro already.

There are 2 numbers used in that macro that you may want to change, if you want to re-use it for something else, 65274 and 15.

The number 65274 is the itemid for the relevant item. If you look up any item on wowhead for example, you’d see the itemid for that item in the URL.

So when looking up your current [Cloak of Coordination], we see that same number appear:

https://www.wowhead.com/item=65274/cloak-of-coordination
see here_____________________^^^^^

The number 15 (used twice), refers to the slot where the item goes.
15 implies the Back / Cloak slot, if you want to use the macro for (for example) a neck then you’d use number 2 instead (in both places).

INVSLOT_HEAD 		= 1;
INVSLOT_NECK		= 2;
INVSLOT_SHOULDER	= 3;
INVSLOT_BODY		= 4;
INVSLOT_CHEST		= 5;
INVSLOT_WAIST		= 6;
INVSLOT_LEGS		= 7;
INVSLOT_FEET		= 8;
INVSLOT_WRIST		= 9;
INVSLOT_HAND		= 10;
INVSLOT_FINGER1		= 11;
INVSLOT_FINGER2		= 12;
INVSLOT_TRINKET1	= 13;
INVSLOT_TRINKET2	= 14;
INVSLOT_BACK		= 15;
INVSLOT_MAINHAND	= 16;
INVSLOT_OFFHAND		= 17;
INVSLOT_RANGED		= 18;
INVSLOT_TABARD		= 19;

ps: don’t try to copy-paste your old macro back from the forums here. Since you didn’t wrap it in a code-block, the forum has trashed it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.