vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | WeaponQuickSwap - v32 |
2 | |||
3 | =========== |
||
4 | Quick Start |
||
5 | =========== |
||
6 | Unzip the contents of the zip archive into your WoW Interface\AddOns |
||
7 | directory. Make sure you "Use folder names" so the files end up in |
||
8 | the right place. You should end up with: |
||
9 | <wowdir>\Interface\AddOns\WeaponQuickSwap\readme.txt |
||
10 | <wowdir>\Interface\AddOns\WeaponQuickSwap\WeaponQuickSwap.toc |
||
11 | <wowdir>\Interface\AddOns\WeaponQuickSwap\WeaponQuickSwap.xml |
||
12 | <wowdir>\Interface\AddOns\WeaponQuickSwap\WeaponQuickSwap.lua |
||
13 | |||
14 | Now log into your character and go to the Main Menu in-game. Select |
||
15 | macros and add a New macro. Give it a name and an icon and make the |
||
16 | macro text: |
||
17 | /script WeaponSwap("main1", "off1", "main2", "off2", ...); |
||
18 | |||
19 | Parameters are CASE-SENSITIVE: |
||
20 | main1 - What weapon you want in your main hand for set 1. |
||
21 | off1 - What weapon you want in your off hand for set 1. |
||
22 | |||
23 | The following 2 parameters are optional: |
||
24 | main2 - What weapon you want in your main hand for set 2. |
||
25 | off2 - What weapon you want in your off hand for set 2. |
||
26 | (more sets can be specified if desired) |
||
27 | |||
28 | Mages wishing to wield a 2h in their main and a wand in the ranged slot |
||
29 | should use MageWeaponSwap() instead of WeaponSwap(). |
||
30 | |||
31 | =========== |
||
32 | Description |
||
33 | =========== |
||
34 | This Add-on adds two functions to the scripting namespace called: |
||
35 | WeaponSwap(...); |
||
36 | MageWeaponSwap(...); |
||
37 | |||
38 | The arguments are pairs of weapons to be held in the main hand and off |
||
39 | hand respectively. For example, if you want to put a "Sword of the |
||
40 | Black Knight" in your main, and a "Johnsonville Brat" in the off-hand, |
||
41 | that is: |
||
42 | /script WeaponSwap("Sword of the Black Knight", |
||
43 | "Johnsonville Brat"); |
||
44 | |||
45 | But you're thinking. "Bry, I could already do that pretty easily." |
||
46 | The fun is that you can specify a second set of equipment to be swapped |
||
47 | in if the first is already in place. This macro would switch between |
||
48 | just holding a "Sharpened Letter Opener" in the main hand (nothing |
||
49 | off-hand) and two "Mace of Ultimate Whompitude" in each hand. |
||
50 | /script WeaponSwap("Sharpened Letter Opener", "", |
||
51 | "Mace of Ultimate Whompitude", "Mace of Ultimate Whompitude"); |
||
52 | |||
53 | If you do not wish to change whatever is in that a slot, a wildcard |
||
54 | character "*" can be used. |
||
55 | /script WeaponSwap("Sword", "Dagger1", "Dagger2", "*"); |
||
56 | Leaves Dagger1 in offhand when switching to set 2. Note that you can |
||
57 | get yourself in trouble if you use too many wildcards: |
||
58 | /script WeaponSwap("*", "Dagger1", "Sword", "*"); |
||
59 | That probsbly won't do anything once the Sword is in the main and the |
||
60 | dagger is in the offhand. Think your wildcard usage through. |
||
61 | |||
62 | Note: As as design decision, the names are CASE SENSITIVE. |
||
63 | "Misspelled Swoard" and "misspelled swoard" are not the same. Type it |
||
64 | exactly as it appears in your inventory. I did it this way to avoid |
||
65 | lowercasing a bunch of immutable strings every time you want to switch. |
||
66 | |||
67 | Interesting facts about this script: |
||
68 | -- Slot lock events are used to detect when it is safe to move a |
||
69 | weapon. Prevents hang ups found in other scripts and Add-ons. |
||
70 | -- Uses LinkText to detect item names rather that creating a |
||
71 | GameToolTip descendant. More efficient? Hells yeah. |
||
72 | |||
73 | If you get an error using this, make sure you report it with your macro |
||
74 | line *as well as* the position of where the items where before you ran |
||
75 | the macro. |
||
76 | |||
77 | More examples |
||
78 | ---- -------- |
||
79 | Just a 2h: |
||
80 | /script WeaponSwap("2h"); |
||
81 | |||
82 | 2h to 1h/shield: |
||
83 | /script WeaponSwap("2h", "", "1h", "shield"); |
||
84 | |||
85 | To swap dual wield hands: |
||
86 | /script WeaponSwap("Hammer", "Dagger", "Dagger", "Hammer"); |
||
87 | |||
88 | 2h to DW: |
||
89 | /script WeaponSwap("2h", "", "Weap1", "Weap2"); |
||
90 | |||
91 | DW to Backstab/Ambush |
||
92 | /script WeaponSwap("Weap1", "Weap2", "Dagger", "fish"); |
||
93 | |||
94 | Switch between 3 sets of weapons (ss/dw/2h): |
||
95 | /script WeaponSwap("shortsword", "shield", "shortsword", "knife", "2h Hammer"); |
||
96 | |||
97 | Staff and Wand to Staff and another Wand: |
||
98 | /script MageWeaponSwap("Smackem Staff", "Wand of the Fleeting", |
||
99 | "Smackem Staff", "Tinkerbell's Fairy Wand"); |
||
100 | |||
101 | Drunk to Billigerent: |
||
102 | /script WeaponSwap("Tankard of Ale", "Tankard of Ale", |
||
103 | "Mace of Antioch", "Sword of Barroom Brawl"); |
||
104 | |||
105 | === |
||
106 | FAQ |
||
107 | === |
||
108 | Q1. How do I make a macro to switch to a dagger in my main hand, |
||
109 | backstab, then put my weapons back? |
||
110 | A. Short Answer: you cannot. |
||
111 | Long Answer: Switching weapons is not what we call a "synchronous" |
||
112 | event. When you say WeaponSwap() it *requests* that the weapons |
||
113 | swap and returns to your macro. The actual weapons get in your |
||
114 | hands at some point P in the future. |
||
115 | Can such a macro be written? Not since patch like 1.8 where |
||
116 | cast actions can not be scripted from an event handler. |
||
117 | |||
118 | Q2. How do I use a weapon that has an apostrophe in the name? Such |
||
119 | as a Tyr's Hand? |
||
120 | A. Just use double quotes around the item name instead of single: |
||
121 | /script WeaponSwap("Tyr's Hand", ""); |
||
122 | |||
123 | Q3. WeaponSwap stopped working mid-game! What do I do? |
||
124 | A. This has been reported to occur, but I have not been able to |
||
125 | reproduce the problem. If it happens to you do any of the following: |
||
126 | /script WeaponSwap_Reset() |
||
127 | OR /console reloadui |
||
128 | OR /script ReloadUI() |
||
129 | |||
130 | ** CapnBry <bmayland@capnbry.net> ** |
||
131 | |||
132 | Version History: |
||
133 | 32 - Interface version 11100. |
||
134 | 31 - Fixed typo preventing detection if an item in inventory was slot locked. |
||
135 | Credit and thanks go to Wikwocket for finding this major bug. |
||
136 | 30 - Unregisters from events when player leaves world for improved zoning times. |
||
137 | 29 - Changes to prevent re-entrance into ExecuteIteration which might cause stackoverflow. |
||
138 | Check all item locks before moving. v1.10 appears to not let you move items if any |
||
139 | item is locked. |
||
140 | 28 - Interface version 11000. |
||
141 | 27 - Interface version 10900. |
||
142 | 26 - Interface version 1500. |
||
143 | 25 - Finished support for WeaponQuickSwap_OnSwapComplete and WeaponQuickSwap_OnError(err). |
||
144 | 24 - Interface version 1300. |
||
145 | 23 - No longer will try to put something in any "Shot Pouch". Thanks to Eric Vega |
||
146 | for bringing it to my attention. |
||
147 | 22 - Interface version 4216. |
||
148 | 21 - Interface version 4222. |
||
149 | 20 - Interface version 4211. |
||
150 | 19 - Added support for "*" which indicates to leave whatever is in that hand there |
||
151 | 18 - Changes to support A,"" -> "",B where A is a 2h. |
||
152 | - When switching A,B -> C,"" will always try to put B in the place it took |
||
153 | it out of. |
||
154 | 17 - Changes to better support StanceSets addon. |
||
155 | 16 - Fix for people with "bad argument #1 to 'find'(string expected got nil)." |
||
156 | 15 - Can now pass just one item to WeaponSwap (assumed main hand). |
||
157 | Can specify as many sets as you want |
||
158 | 14 - Interface version 4150 |
||
159 | 13 - Should no longer try to stuff weapons in a quiver / ammo pouch |
||
160 | 12 - Fix for A,B -> C,A where B is offhand only |
||
161 | 11 - Now searches only hand inventory and starts from the back of bags |
||
162 | working toward bag 0. 0.00001s speed increase. |
||
163 | 10 - Added MageWeaponSwap(...) |
||
164 | 9 - Renamed to WeaponSwap(...) |
||
165 | 8 - Support for switching X,Y <-> Y,Z |
||
166 | 7 - Now fills bags from the rear, for more predictable storage |
||
167 | placement. |
||
168 | 6 - Fix for people switching X,Y -> Y,Y |
||
169 | 5 - Support for filling hands with 2 of the same named weapon |
||
170 | 4 - Fix for people switching 2h -> Dual Wield |
||
171 | 3 - Order of operations ambiguity on finding empty bag slot resolved. |
||
172 | 2 - Weapons coming out of slots will now also go to bags, not just the |
||
173 | backpack. |
||
174 | - Prints a message if there isn't enough free bagspace to complete |
||
175 | the swap. |
||
176 | - Disabled unused event hooks. |
||
177 | - Removed /rl slash command for reloading ui. |
||
178 | 1 - Initial release |
||
179 | |||
180 | TODO: |
||
181 | |||
182 | Does not support weapons that change names |
||
183 | Shadowstrike <http://thottbot.com/?i=28108> transforms to Thunderstrike |
||
184 | <http://www.thottbot.com/?i=28235> and backwards when right-clicked. The |
||
185 | same happens with Benediction <http://thottbot.com/?i=37916> and Anathema |
||
186 | <http://www.thottbot.com/?i=38169>. |