WoW:Item equipping: Difference between revisions

m
Move page script moved page Item equipping to WoW:Item equipping without leaving a redirect
m (Move page script moved page Item equipping to WoW:Item equipping without leaving a redirect)
 
(15 intermediate revisions by 15 users not shown)
Line 1: Line 1:
== Without macros ==
Note that the need for macro juggling to switch equipment is all but gone with the advent of AddOns such as
ItemRack or Outfitter. These addons can themselves be controlled with macros if you like :-)<!--[http://www.curse-gaming.com/en/wow/addons-2045-1-itemrack.html ItemRack] or [http://wow.curse-gaming.com/en/files/details/4784/outfitter/ Outfitter]. These addons can themselves be controlled with macros if you like :-)-->
== Basics ==
== Basics ==


Line 10: Line 15:
</code>
</code>


To access the first slot on the rightmost bag, the script would be <code>/script PickUpContainerItem (4, 1);</code>
To access the first slot on the leftmost bag, the script would be <code>/script PickUpContainerItem (4, 1);</code>


The basic command works like this:
The basic command works like this:
Line 38: Line 43:




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.  I 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.




Line 98: Line 103:


<code>
<code>
/script if ( not CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); PickupContainerItem(offhandBag, offhandBagSlot); PickupInventoryItem(17); if ( CursorHasItem() ) then PickupContainerItem(offhandBag, offhandBagSlot); end end
/script if ( not CursorHasItem() ) then PickupContainerItem(4, 2); PickupInventoryItem(16); PickupContainerItem(4, 1); PickupContainerItem(4, 2); PickupInventoryItem(17); if ( CursorHasItem() ) then PickupContainerItem(4, 2); end
</code>
</code>


=== From mainhand/offhand to mainhand ===
Switch from a 2h to 1h+shield
 
Script to switch from items in both hands to one item in the main hand.
offhandBag, offhandBagSlot and mainhandBag, mainhandBagSlot need to be specified (duh).
Weapons will end up on the slots specified.


<code>
<code>
/script if ( not CursorHasItem() ) then PickupInventoryItem(17); if ( CursorHasItem() ) then PickupContainerItem(offhandBag, offhandBagSlot); end PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end
/script if ( not CursorHasItem() ) then PickupInventoryItem(16); if ( CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); end PickupContainerItem(offhandBag, offhandBagSlot); PickupInventoryItem(17); PickupContainerItem(offhandBag, offhandBagSlot); end
</code>
</code>
=== Any to Any ===
Script to swap from one set of weapons to another, in any combination.  I've included an expanded version of the somewhat obfuscated code, although it's a too long to be usable itself.  The CloseMerchant() call is included for safety reasons.
The shorter version uses bag 3, slot 5 for the main weapon and bag 4, slot 6 for the offhand item, whereas the expanded version uses more descriptive terms for those locations.
Note that the held weapons will end up in those inventory slots after the swap, so if you're swapping between a two-handed weapon and a one-handed + offhand configuration, you'll need to leave the offhand bag slot empty while you're wielding it, or swapping it out won't work properly.
''/script local a,b,c=CursorHasItem,PickupInventoryItem,PickupContainerItem;if(not a())then CloseMerchant();b(17);if(a())then c(4,6);c(4,5);b(16)else c(4,5);b(16);c(4,6);b(17)end end
/script
  if ( not CursorHasItem() )then
  CloseMerchant();
  PickupInventoryItem(17);
  if ( CursorHasItem() ) then
    PickupContainerItem(offhandBag, offhandBagSlot);
    PickupContainerItem(mainhandBag, mainhandBagSlot);
    PickupInventoryItem(16);
  else
    PickupContainerItem(mainhandBag, mainhandBagSlot);
    PickupInventoryItem(16);
    PickupContainerItem(offhandBag, offhandBagSlot);
    PickupInventoryItem(17);
  end
  end


=== From mainhand to mainhand ===
=== From mainhand to mainhand ===
Line 120: Line 147:
/script if ( not CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end
/script if ( not CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end
</code>
</code>
=== Swap Mainhand and Offhand Weapons ===
This script is pretty simple.  On my rogue I wanted to switch my offhand to my mainhand, and vice-versa (use dagger for ambush, then swap so I can SS with the sword).  You can accomplish this with a very simple macro that will swap back and forth each time you use it.  -- [[User:Loganis|Loganis]]
<code>
/script if ( not CursorHasItem() ) then PickupInventoryItem(17); PickupInventoryItem(16); end
</code>
== Simple Macro with item slots ==
<code> /equipslot <inventory number> <bag number> <bag slot number> </code>
Basically this equips the item specified in your bag to the inventory slot indicated by the first number in your macro. An example would be:
<code> /equipslot 16 4 1 </code>
This equips a weapon to your main hand found in your last bag in the first slot. Essentially this accomplishes the same as the scripts from above but with much less characters, leaving your macros free to do other things.


== With Cosmos ==
== With Cosmos ==
Line 126: Line 170:
  /saveset <Number>
  /saveset <Number>
  /loadset <Number>
  /loadset <Number>
== Simple Swap Without Itemslots==
Halow's Item Switch (1h+Shield to 2h)
I don't know about you guys but I cant stand item slot specific macros, to complicated for me and a waste of macro space. So I made this little gem...
<code>
/equip [nomodifier] <1H Item Name>
/equip [nomodifier] <OH Item Name>
/equip [modifier:shift] <2H Item Name>
</code>
Note** make sure you don't put the <> around your weapons.
This macro will equip your 1handed weapon and your shield/offhand weapon when you click it, and when you click it while holding down shift it will equip your 2handed weapon. This should also work for dual wield to 2hander though I haven't tested it.
== Weapon Swap Using Equipment Manager==
NOTE: You'll have to activate your the Equipment Manager first (Options > Interface > Features > [X] Use Equipment Manger), it will appear at the top right corner of your character frame.
The next step is to create a set for each weapon you want to use in your macros. It's important to deactivate all the other item slots, you simply click the yellow arrow at each slot and choose "Ignore this slot", this will prevent Error messages in combat.
After you've created the weapon sets, you can include them in your macros using this command:
<code>
/equipset SetName
</code>
Replace SetName with the exact name of your own weapon set. The advantage of this method is, in comparison to the /equip and /equipslot commands, that it works better when lags appear. Of course it's possible to include multiple sets in one macro using modifiers as shown above.
[[Category:Macros]]
Anonymous user