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
(section)
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!
== 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>
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)