WoW:Item equipping: Difference between revisions

m
Line 32: Line 32:


Please be very careful when using the UseContainerItem(bag,slot) command.  If you are talking to a vendor and use this macro (assuming no safety measures in the script) then all your macro items will be sold.  Just managed to sell 7 items to a vendor.  Fortunately, I was able to retrieve the last item and blizzard restored the other equipment items for me.
Please be very careful when using the UseContainerItem(bag,slot) command.  If you are talking to a vendor and use this macro (assuming no safety measures in the script) then all your macro items will be sold.  Just managed to sell 7 items to a vendor.  Fortunately, I was able to retrieve the last item and blizzard restored the other equipment items for me.
For those of us that are prone to doing this you can do a check to see if you are interacting with an NPC.  example weaponswap(2H <-> 1H/OH):
<code>
/script TargetUnit("npc");
if ( UnitName("target") == nil or not UnitIsUnit("target","npc") )
then
  if ( not CursorHasItem() ) then
    PickupInventoryItem(offHandInventory);
    PickupContainerItem(offHandBag,offHandSlot);
    UseContainerItem(mainHandBag,mainHandSlot);
    UseContainerItem(offHandBag,offHandSlot);
  end
end
</code>
-- [[User:Trinkit|Trinkit]]


== Multiple commands ==
== Multiple commands ==
Anonymous user