Weapon Quick Swap

UI Addon to allow you to switch weapons quickly with a single keystroke.


Do not refresh or leave this page!

File Description

UI Addon to allow you to switch weapons quickly with a single keystroke.

Read More

Download 'weaponquickswap38.zip' (9KB)

WeaponQuickSwap - v38

Quick Start
Unzip the contents of the zip archive into your WoW Interface\AddOns 
directory.  Make sure you "Use folder names" so the files end up in 
the right place.  You should end up with:

Now log into your character and go to the Main Menu in-game.  Select
macros and add a New macro.  Give it a name and an icon and make the
macro text:
/script WeaponSwap(&quot;main1&quot;, &quot;off1&quot;, &quot;main2&quot;, &quot;off2&quot;, ...);

Parameters are CASE-SENSITIVE:
main1 - What weapon you want in your main hand for set 1.
off1 - What weapon you want in your off hand for set 1.

The following 2 parameters are optional:
main2 - What weapon you want in your main hand for set 2.
off2 - What weapon you want in your off hand for set 2.
(more sets can be specified if desired)

Mages wishing to wield a 2h in their main and a wand in the ranged slot
should use MageWeaponSwap() instead of WeaponSwap().
This Add-on adds two functions to the scripting namespace called:

The arguments are pairs of weapons to be held in the main hand and off
hand respectively.  For example, if you want to put a &quot;Sword of the
Black Knight&quot; in your main, and a &quot;Johnsonville Brat&quot; in the off-hand,
that is:
  /script WeaponSwap(&quot;Sword of the Black Knight&quot;,
  	&quot;Johnsonville Brat&quot;);

But you're thinking.  &quot;Bry, I could already do that pretty easily.&quot; 
The fun is that you can specify a second set of equipment to be swapped
in if the first is already in place.  This macro would switch between
just holding a &quot;Sharpened Letter Opener&quot; in the main hand (nothing
off-hand) and two &quot;Mace of Ultimate Whompitude&quot; in each hand.
	/script WeaponSwap(&quot;Sharpened Letter Opener&quot;, &quot;&quot;,
  	&quot;Mace of Ultimate Whompitude&quot;, &quot;Mace of Ultimate Whompitude&quot;);

If you do not wish to change whatever is in that a slot, a wildcard 
character &quot;*&quot; can be used.
	/script WeaponSwap(&quot;Sword&quot;, &quot;Dagger1&quot;, &quot;Dagger2&quot;, &quot;*&quot;);
Leaves Dagger1 in offhand when switching to set 2.  Note that you can
get yourself in trouble if you use too many wildcards:
	/script WeaponSwap(&quot;*&quot;, &quot;Dagger1&quot;, &quot;Sword&quot;, &quot;*&quot;);
That probsbly won't do anything once the Sword is in the main and the
dagger is in the offhand.  Think your wildcard usage through.

Note:  As as design decision, the names are CASE SENSITIVE. 
&quot;Misspelled Swoard&quot; and &quot;misspelled swoard&quot; are not the same.  Type it
exactly as it appears in your inventory.  I did it this way to avoid
lowercasing a bunch of immutable strings every time you want to switch.

Interesting facts about this script:
-- Slot lock events are used to detect when it is safe to move a
weapon. Prevents hang ups found in other scripts and Add-ons.
-- Uses LinkText to detect item names rather that creating a
GameToolTip descendant.  More efficient?  Hells yeah.

If you get an error using this, make sure you report it with your macro
line *as well as* the position of where the items where before you ran
the macro.

More examples
---- --------
Just a 2h:
/script WeaponSwap(&quot;2h&quot;);

2h to 1h/shield:
/script WeaponSwap(&quot;2h&quot;, &quot;&quot;, &quot;1h&quot;, &quot;shield&quot;);

To swap dual wield hands:
/script WeaponSwap(&quot;Hammer&quot;, &quot;Dagger&quot;, &quot;Dagger&quot;, &quot;Hammer&quot;);

2h to DW:
/script WeaponSwap(&quot;2h&quot;, &quot;&quot;, &quot;Weap1&quot;, &quot;Weap2&quot;);

DW to Backstab/Ambush
/script WeaponSwap(&quot;Weap1&quot;, &quot;Weap2&quot;, &quot;Dagger&quot;, &quot;fish&quot;);

Switch between 3 sets of weapons (ss/dw/2h):
/script WeaponSwap(&quot;shortsword&quot;, &quot;shield&quot;, &quot;shortsword&quot;, &quot;knife&quot;, &quot;2h Hammer&quot;);

Staff and Wand to Staff and another Wand:
/script MageWeaponSwap(&quot;Smackem Staff&quot;, &quot;Wand of the Fleeting&quot;,
	&quot;Smackem Staff&quot;, &quot;Tinkerbell's Fairy Wand&quot;);

Drunk to Billigerent:
/script WeaponSwap(&quot;Tankard of Ale&quot;, &quot;Tankard of Ale&quot;,
	&quot;Mace of Antioch&quot;, &quot;Sword of Barroom Brawl&quot;); 

Q1. How do I make a macro to switch to a dagger in my main hand,
backstab, then put my weapons back?
A. Short Answer: you cannot.
   Long Answer: Switching weapons is not what we call a &quot;synchronous&quot;
   event.  When you say WeaponSwap() it *requests* that the weapons
   swap and returns to your macro.  The actual weapons get in your
   hands at some point P in the future.
   Can such a macro be written?  Not since patch like 1.8 where 
   cast actions can not be scripted from an event handler.
Q2. How do I use a weapon that has an apostrophe in the name? Such
as a Tyr's Hand?
A.  Just use double quotes around the item name instead of single:
    /script WeaponSwap(&quot;Tyr's Hand&quot;, &quot;&quot;);
Q3. WeaponSwap stopped working mid-game!  What do I do?
A.  This has been reported to occur, but I have not been able to 
    reproduce the problem.  If it happens to you do any of the following:
    /script WeaponSwap_Reset()
    OR /console reloadui
    OR /script ReloadUI()

** CapnBry <bmayland@capnbry.net> **

Version History:
38 - Interface version 20003.
     Removed support for old WeaponSetsExchange function.
37 - First revision for WoW 2.0
36 - Interface version 11200
35 - Removed early complete signal.  No longer ignores some ITEM_LOCK messages
34 - Added support for PLAYER_DEAD event to abort a swap.  No longer
     waits for last item lock to change to signal swap &quot;Complete&quot;
33 - No longer tries to stuff a weapon into a Soul Pouch, as if any Warlock 
     uses WeaponQuickSwap.
     Added timeout to reset mod if weapons are swapping for longer than 5s.
32 - Interface version 11100.
31 - Fixed typo preventing detection if an item in inventory was slot locked.
     Credit and thanks go to Wikwocket for finding this major bug.
30 - Unregisters from events when player leaves world for improved zoning times.
29 - Changes to prevent re-entrance into ExecuteIteration which might cause stackoverflow.
     Check all item locks before moving.  v1.10 appears to not let you move items if any
     item is locked.
28 - Interface version 11000.
27 - Interface version 10900.
26 - Interface version 1500.
25 - Finished support for WeaponQuickSwap_OnSwapComplete and WeaponQuickSwap_OnError(err).
24 - Interface version 1300.
23 - No longer will try to put something in any &quot;Shot Pouch&quot;.  Thanks to Eric Vega  
     for bringing it to my attention.
22 - Interface version 4216.
21 - Interface version 4222.
20 - Interface version 4211.
19 - Added support for &quot;*&quot; which indicates to leave whatever is in that hand there
18 - Changes to support A,&quot;&quot; -> &quot;&quot;,B where A is a 2h.
   - When switching A,B -> C,&quot;&quot; will always try to put B in the place it took 
   	 it out of.
17 - Changes to better support StanceSets addon.
16 - Fix for people with &quot;bad argument #1 to 'find'(string expected got nil).&quot;
15 - Can now pass just one item to WeaponSwap (assumed main hand).
     Can specify as many sets as you want
14 - Interface version 4150
13 - Should no longer try to stuff weapons in a quiver / ammo pouch
12 - Fix for A,B -> C,A where B is offhand only
11 - Now searches only hand inventory and starts from the back of bags
     working toward bag 0.  0.00001s speed increase.
10 - Added MageWeaponSwap(...)
9 - Renamed to WeaponSwap(...)
8 - Support for switching X,Y <-> Y,Z
7 - Now fills bags from the rear, for more predictable storage
6 - Fix for people switching X,Y -> Y,Y
5 - Support for filling hands with 2 of the same named weapon
4 - Fix for people switching 2h -> Dual Wield
3 - Order of operations ambiguity on finding empty bag slot resolved.
2 - Weapons coming out of slots will now also go to bags, not just the
  - Prints a message if there isn't enough free bagspace to complete
    the swap.
  - Disabled unused event hooks.
  - Removed /rl slash command for reloading ui.
1 - Initial release


Does not support weapons that change names
Shadowstrike <http://thottbot.com/?i=28108> transforms to Thunderstrike
<http://www.thottbot.com/?i=28235> and backwards when right-clicked. The
same happens with Benediction <http://thottbot.com/?i=37916> and Anathema

Read More

Comments on this File

There are no comments yet. Be the first!


50 XP

Registered 8th February 2007

3 Files Uploaded

Share This File
Embed File