Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:Item equipping
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 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 == <code>/script PickupContainerItem(bag, slot)</code> Bags count from 0 to 4 from the right, 0 being your backpack and 4 being your leftmost pack. Slots are numbered starting at the topmost, leftmost slot and counting left to right, top to bottom. For example, a 10-slot pack is numbered like this: <code> X X 1 2<br> 3 4 5 6<br> 7 8 9 10 </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: * If no item in cursor: ** If item in bag:slot - picks up the item and puts it on the cursor. ** If no item in bag:slot - does nothing * If item on cursor ** If item in bag:slot - switches the item in the bag:slot with the one on the cursor. ** If no item in bag:slot - puts down item from cursor into bag:slot /script PickupInventoryItem(inventorySlot) Picks up/puts down/switches item into the specified slot. See [[InventorySlots]] for ids and mappings. Better method: /script UseContainerItem(bag, slot); Will automatically equip the item referenced by bag,slot, placing any existing already equipped item in the bag slot. Yes, this is undoubtedly easier... '''until''' you start dealing with dualwielding. At which point UseContainerItem stops being nice. -- [[User:Sarf|Sarf]] 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. 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]] The best method for ensuring that you do not accidentally sell anything to a vendor is: <code> /script CloseMerchant(); </code> The aforementioned if-then script can still fail if you are in a vendor window and target another entity, whereas the CloseMerchant script will always close any merchant window. It's also much shorter, so you can fit more lines of item swapping into the character-limited macro box. --[[User:TheRayven|TheRayven]] == Multiple commands == There is a problem when executing multiple Pickup commands because they execute instantaneously on your client, which is not always synched with the server. Therefore, follow these simple guidelines: # Check if the cursor has an item on it and execute all your pickup commands on the same line.<br>Example:<br>if ( not CursorHasItem() ) then PickupContainerItem(...); ... end # Pickup items once, and drop them once for one macro. Good luck! == Weapon swapping scripts == NOTE: When copying the scripts, '''make sure they end up on ONE line.''' Also, you will NEED to change the offhandBag, offhandBagSlot and mainhandBag, mainhandBagSlot names to actual numbers, as the scripts will NOT fit in a macro as it is. === From mainhand/offhand to mainhand/offhand === Script to swap items in both hands to other items in both hands. offhandBag, offhandBagSlot and mainhandBag, mainhandBagSlot need to be specified (duh). <code> /script if ( not CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); PickupContainerItem(offhandBag, offhandBagSlot); PickupInventoryItem(17); PickupContainerItem(offhandBag, offhandBagSlot); end </code> === From mainhand to mainhand/offhand === Script to switch from item in main hand to other items in both hands. offhandBag, offhandBagSlot and mainhandBag, mainhandBagSlot need to be specified (duh). Weapon in main hand will end up in mainhandBag, mainhandBagSlot. <code> /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> Switch from a 2h to 1h+shield <code> /script if ( not CursorHasItem() ) then PickupInventoryItem(16); if ( CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); end PickupContainerItem(offhandBag, offhandBagSlot); PickupInventoryItem(17); PickupContainerItem(offhandBag, offhandBagSlot); end </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 === Script to switch from item in main hand to another item in the main hand. mainhandBag, mainhandBagSlot need to be specified (duh). The equipped weapon will end up on mainhandBag, mainhandBagSlot. <code> /script if ( not CursorHasItem() ) then PickupContainerItem(mainhandBag, mainhandBagSlot); PickupInventoryItem(16); PickupContainerItem(mainhandBag, mainhandBagSlot); end </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 == If you are using Cosmos, you can use the following commands : /saveset <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]]
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)