MACRO: Help please:Wrap of Unity cloak switch

UI and Macro
I use the Wrap of Unity on several of my toons and I have a macro that will swap out the current cloak (/use 15) for the Wrap but I want to make this a more universal macro so I don't need to copy to each of my toons' individual macro files.
This is the basic one for my druid, it swaps back in the cloak dependent upon spec:
MACRO 105 "Cape2SW" "INV_Misc_QuestionMark"
#show 15
/equip Wrap of Unity
/use 15
/equip [spec:2] Sleek Flamewrath Cloak; [spec:1]Flowing Flamewrath Cape

This does work very well and I don't mind the 3 clicks, but I'd like something that remembers the first cloak.

I was hoping to use the "equipped items ilvl" macro, but I don't know enough about lua to make this work. My thought was to grab just the GetInventoryItemLink of slot 15, store that value, swap for Wrap of Unity and then, after using the Wrap and arriving in SW, to click the button again and swap the stored cloak in. I'd love to give credit to the writer but I don't remember who it was.
MACRO 107 "ilvl" "INV_Misc_QuestionMark"
/run t={}; for i=1,18 do if i~=4 then l=GetInventoryItemLink('player',i); if l then _,_,_,v=GetItemInfo(l); table.insert(t,{l=l,v=v}); end end end sort(t, function(a,b) return a.v>b.v end ) for i,v in pairs(t) do print(v.v..' '..v.l); end

Thanks
#show 15
/use Wrap of Unity
/run local o=GetItemInfo(GetInventoryItemLink("player",15)) if o=="Wrap of Unity" then EquipItemByName(WoUCloak) else WoUCloak=o EquipItemByName("Wrap of Unity") end
That's Fabulous!! Thanks very much.
Normally I hate alliance but I think I'll make an exception this once.
With the macro you gave us above it works but it leaves ugly red errors in the UI.
Add the following to the end:
/run UIErrorsFrame:Clear()
Won't stop your character from saying stuff but at least you don't have to stare at the godawful error list.

Join the Conversation

Return to Forum