vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 TODO
2 update readme on how to use "Super" macros
3  
4 3.14a
5 fixed: count should show totalcount in all bags and slots
6 3.14
7 Include alias replacement from other mods (eg ASF, ChatAlias)
8 for any other alias addons, do SM_InsertAliasFunction(your_replacement_function, pos) inside your mod. pos must be -1 if the function removes newlines; otherwise leave out pos. make sure SuperMacro is loaded when this insertion is called, so make SM an optional dependency or after VARIABLES_LOADED.
9 stretched popup frame by two rows
10 fixed: tooltip with macro code still appear after leaving action button
11 fixed: sayrandom error
12 hide action text on discord bars
13 make minimap button toplevel
14 brighten rank text on tooltips
15 new function CancelBuff, unbuff, /unbuff, /smunbuff
16 fixed: set owner for SM_Tooltip
17 fixed: FindBuff should work better
18  
19 SuperMacro v3.14 by Aquendyn
20  
21 Installing SuperMacro:
22 Before you unzip, backup your old Bindings.xml and SM_Extend.lua that are in the SuperMacro folder (if you have on older version of SuperMacro).
23 Unzip the files into WoW/Interface/Addons . A new directory called SuperMacro will be automatically created, and the files will be extracted there.
24 Then, copy your backup Bindings.xml into SuperMacro folder, if you have one.
25 You may also create a text file called SM_Extend.lua and put extra long codes in there.
26  
27 This addon provides a very much improved interface for macros. Its special functions includes the following, and probably more:
28 New SuperMacro frame shows all 18 global and 18 character macros. *
29 Work around the maximum macro character length of 256 characters (system limit).**
30 Run macros through keybinds*** and call other macros with RunMacro()****.
31 Some convenient slash commands and functions*****.
32 Put an item link or tradeskill recipe into the macro***** *.
33 Ingame extended LUA code editor***** **.
34 Options frame***** ***.
35 Also see functions.txt for user-friendly functions and slash commands that can be used in your macros.
36  
37 * The new SuperMacro interface displays 18 (global) account macros on the left and 18 character-specific macros on the right. Buttons at the top create new macros for each category. Buttons on the bottom are, in order, delete macro; save macro; open SuperMacro options frame; delete extend; save extend; exit frame. Enter your macro in the left editbox, and your extended LUA codes and functions in the right editbox.
38  
39 ** The letter limit for the entire macro is 256. However, you can get around that if you use call it through another macro, or put long functions in SM_Extend.lua file, or use the in-game extend editor (explained further down in this document.)
40 Suppose macro 1 has more than 256 characters. If you put this directly on your action bar and try to activate it, you will get an error because the rest of the line beyond the 256th character will be cut off when the macro is saved. What you can do is break up the long macro into smaller parts, and have them call each other, like so (where macro 1 is named Macro1):
41 <code>
42 /script RunMacro("Macro1") --more scripting here
43 </code>
44 Then put this new macro on your action bar.
45  
46 NOTE: Do not type the <code> </code> tags themselves, but type what is between them.
47  
48 Alternatively, put extremely long functions in a file called SM_Extend.lua, which you have to create since the zip doesn't come with this file (so that it doesn't get overwritten when you unzip.)
49  
50 You can also put global variables and constants in this file.
51  
52 To define a function in a lua file:
53 <code>
54 function FunctionName(parameter1, parameter2, etc.)
55 -- code goes here
56 -- return variable
57 end
58 </code>
59  
60 FOR EXAMPLE:
61  
62 <code>
63 function FindTradeSkillIndex(tradeskill)
64 if (TradeSkillFrame:IsVisible()) then
65 for i=1,GetNumTradeSkills() do
66 tsn,tst,tsx=GetTradeSkillInfo(i);
67 if (tsn==tradeskill) then
68 tsi=i;
69 SelectTradeSkill(tsi);
70 TradeSkillInputBox:SetNumber(tsx);
71 TradeSkillFrame.numAvailable=tsx;
72 return tsi, tsx;
73 end
74 end
75 end
76 end
77 </code>
78  
79 Then, your macro would look something like this:
80 <code>
81 /script CastSpellByName("First Aid")
82 /script tsi,tsx=FindTradeSkillIndex("Heavy Linen Bandage") if (tsx) then DoTradeSkill(tsi,tsx-1) end
83 </code>
84  
85 If you change the file SM_Extend.lua while in-game, you need to reload your UI by closing your Macro frame, then entering /script ReloadUI() into the chat line--even better make a macro and keybind for this:
86 <code>
87 /script ReloadUI()
88 </code>
89  
90 *** The default bindings for this addon provides entries for Macros #1 through #36. Using these as examples, you can add more keybinds by editing the bindings.xml file. Backup this file before you install a new version of SuperMacro. In addition, there are two special bindings for Attack and PetAttack. To use these two macros, you must first create macros for them.
91  
92 For Attack, follow these instructions.
93 Make a macro called Attack (note caps) with this body:
94 <code>
95 /script if ( not PlayerFrame.inCombat ) then CastSpellByName("Attack") end
96 </code>
97 Now, you can assign a keybind for attack, and you can call this macro when executing other macros. For instance, suppose you want a macro to attack and to cast a spell. You can make a macro with this body:
98 <code>
99 /script RunMacro("Attack")
100 /cast Shadow Bolt
101 </code>
102  
103 For PetAttack, do the following.
104 Make a macro called PetAttack (note caps) with this body:
105 <code>
106 /script CastPetAction(1);
107 </code>
108 Put the pet attack icon in the first slot on your pet action bar (should be there by default).
109 Now, you can assign a keybind to tell your pet to attack, and you can call this macro when executing other macros. For example, we can change the above example to this:
110 <code>
111 /script RunMacro("Attack");
112 /script RunMacro("PetAttack");
113 /cast Shadow Bolt
114 <code>
115  
116 **** SuperMacro lets your macros call other macros with the special function RunMacro(index) or RunMacro("name"). If index is a number without quotes, it will call the macro in the order displayed in the macro frame. If you instead provide a name of the macro within quotes, you can call the macro if you know its name.
117 In Bindings.xml for this addon, you will notice bindings for RunMacro(1) through RunMacro(36). They will run the respective macro in the order that you see in the macro frame. Macros 1 to 18 are account macros, and Macros 19-36 are character-specific macros.If you add or delete macros, their order may change, so be careful here. You are free to edit those bindings to call your own macros.
118 You can use a macro to call other macros simply by providing the name of the other macro. When writing a macro, you will have something like this:
119 <code>
120 /script RunMacro("Attack");
121 </code>
122 where Attack can be replaced by the name of another macro.
123 You can also use Macro() in place of RunMacro() if you are close to 256 letter limit.
124  
125 ***** Slash commands
126 For complete info on slash commands and their corresponding LUA functions, read functions.txt.
127  
128 Supermacro changes the /macro command so that you can run a macro from the chat line. Use /macro <macro_name>. This is equivalent to /script RunMacro("macro_name").
129 Ex. /macro Attack
130  
131 NOTE: Running a macro or script from the chat line will not cast spells.
132  
133 Another slash command is /supermacro. Just /supermacro shows help for SuperMacro options.
134  
135 The first option is hideaction 1 or 0. For instance,
136 /supermacro hideaction 1
137 /supermacro hideaction 0
138 Setting it to 1 hides the macro names on action buttons, and 0 shows them. This option is saved between sessions under SM_VARS.hideAction.
139  
140 Another option is printcolor <red> <green> <blue>. The red, green, and blue values are numbers from 0 to 1. This option changes the color of the text in the /print slash command.
141 Ex. /supermacro printcolor 1 .5 0.03
142 Ex. /supermacro printcolor default
143 The last line sets the color back to default color, which is white.
144  
145 /supermacro macrotip 0-3
146 /supermacro macrotip 1 is default setting
147  
148 This replaces the text in the game tooltip when the cursor moves over the action bar buttons. Instead of just showing the macro name, you can choose to have it show the spell's name, if the macro casts a spell, or show the macro code. For option 3, it will try to show the spell first. If that fails, it will show the macro code.
149  
150 These options and more can also be set in the SuperMacro options frame.
151  
152 Slash commands for using and equipping items. Use these only when you want to equip or to use a single item. For more complex situations, use other addons.
153 /use,/smuse <item_name>
154 /equip,/smequip,/eq,/smeq <item_name>
155 /equipoff,/smequipoff,/eqoff,/smeqoff <item_name> to equip offhand
156 /unequip,/smunequip,/uneq,/smuneq <item_name>
157  
158 You can item link into the macro. See next section for more on item links.
159 Make sure the /eq and the item link are on the same line.
160 Ex. 1
161 /eq [link] is good
162 Ex. 2
163 /eq
164 [link] is not good
165 Ex. 3
166 /use blazing wand
167 /smuse blazing wand
168 These two commands are equivalent. If another addon already took /use, you could use the /smuse. Same with /eq and /smeq and other commands.
169  
170 To print some text to the default chat frame, you can use the /print command. Other people cannot see what is printed.
171 Ex. /print Hello, world.
172 The default color is white. You can change the color of this text with /supermacro printcolor <red> <green> <blue>
173 where each red, green, and blue value is between 0 and 1.
174  
175 ***** * Item links
176 You can get item links directly into a macro by using Alt-click on the item button. You can do this for container items, paperdoll items, bagslots, and tradeskills. Bagslots are the icons on the main menu bar.
177  
178 To link tradeskills items, Alt-click on the skill in the top half of the frame, that is, where you would select the skill, or the icon. Ctrl-Alt-click will insert the recipe into the macro.
179  
180 Shift-click on item or tradeskill will insert name, and Ctrl-Shift will insert the name inside quotes.
181  
182 Since I was doing this anyway, you can also Shift-click on the skill in the same way to put it into the chat edit box (in addition to Shift-clicking on the icon). Ctrl-Shift-click will insert the recipe into chat edit box.
183  
184 Similarly, you can Shift-click spells from the spell book to insert /cast <spellname>(<spellrank>). Ctrl-Shift-click to insert just the "<spellname>(<spellrank>)" (with quotes.) Alt-Shift-click on spell in spellbook to insert <spellname>(<spellrank>) (without quotes).
185  
186 ***** ** Ingame extend LUA code editor and SM_EXTEND.lua
187 The right edit box in SuperMacro frame is for extended codes that is associated with that macro. This is saved in SavedVariables under SM_EXTEND table, which is not associated with SM_EXTEND.lua in any way. Either way, these extended codes can be accessed by all macros, usually in the form of functions.
188  
189 SM_EXTEND.lua does not come with the zip. If you choose to use this feature, you must create a text file and name it SM_EXTEND.lua . Any code you put in this file will be loaded when the addon is first loaded. Your code can be any length. However, if you edit this during playing, you have to reload UI for the changes to take effect.
190  
191 The in-game extend editor does not need reloading, simply press the Save Extend button. However, the max length for each macro's extend is 7000 letters (not including the macro itself, which is a totally separate issue.) CAUTION, make sure your code has no errors before you close the macro frame.
192  
193 There are also weird behaviors when you make a new macro or rename a macro.
194 When you create a new macro with the same name as an existing macro, it will inherit the same extend code from the existing macro.
195 When you rename a macro with a new name that is the same as another existing macro, the former's extend will be used for both. For example, if macro A has the extend code a=b, macro B has extend b=a, and you rename macro A to macro B, then both macros will now have extend a=b.
196  
197 If a macro is deleted, the extend that goes with it is also deleted if there are no other macros with the same name.
198  
199 Version History
200  
201 3.14
202 Include alias replacement from other mods (eg ASF, ChatAlias)
203 for any other alias addons, do SM_InsertAliasFunction(your_replacement_function, pos) inside your mod. pos must be -1 if the function removes newlines; otherwise leave out pos. make sure SuperMacro is loaded when this insertion is called, so make SM an optional dependency or after VARIABLES_LOADED.
204 stretched popup frame by two rows
205 fixed: tooltip with macro code still appear after leaving action button
206 fixed: sayrandom error
207 hide action text on discord bars
208 make minimap button toplevel
209 brighten rank text on tooltips
210 new function CancelBuff, unbuff, /unbuff, /smunbuff
211 fixed: set owner for SM_Tooltip
212 fixed: FindBuff should work better
213  
214 3.13
215 fixed: SM_Tooltip.lua:131: `then' expected near `return'
216  
217 3.12
218 fixed: this is nil: SM_tooltip.lua line 81
219 fixed: body is nil for FindFirstSpell and FindFirstItem
220 caststop(spell [,...]) put in functions.txt
221  
222 3.11
223 text and texture for supers returned for non-default action buttons.
224 tooltip for supers on action buttons.
225 optimize tooltip, cooldown and icon replacement.
226 per-character settings for supers on action bars.
227 option to check cooldown (may decrease framerate). must be on for auto-replace icons to work properly.
228  
229 3.1 changes
230 change Print to Printd, other addons retain their Print if present, else Print works like Printd
231 Ctrl-Shift-click on spell in spellbook to insert "<spellname>(<spellrank>)" (with quotes).
232 Alt-Shift-click on spell in spellbook to insert <spellname>(<spellrank>) (without quotes).
233 Shift-click on item or tradeskill will insert name, and Ctrl-Shift-click will insert the name inside quotes.
234 CraftItem( skill, item, count), /craft, /smcraft
235 SayRandom(...), /sayrandom, /smsayrandom
236 Super tab to hold virtual macros (aka Super ones). You can make an unlimited number of "Super" macros, and each Super will hold 7000 characters. Drag them onto action bar as usual. Downside is you can't tell range or IsUsable from action buttons (won't fade out). Cooldown and tooltip still work.
237 There are new key bindings for the first ten SuperMacros. You can make your own bindings by copying the format of the default ones in Bindings.xml in SuperMacro folder. You could backup your old Bindings.xml and copy over the new bindings.
238 Function to run a Super is RunSuperMacro(supername | index).
239 Ex. RunSuperMacro(1);
240 Ex. RunSuperMacro("MySuperMacro");
241 You can place SuperMacros on action buttons, but swapping them around is not perfect. These problems may not be not fixable with LUA.
242 Read functions.txt for further explanations of these new commands: CraftItem, SayRandom, RunSuperMacro.
243  
244 3.04 changes
245 fixed bug: tooltip
246 fixed bug: update buttons
247 SM_CastSpell renamed SM_FindSpell
248  
249 3.03 changes
250 fixed bug: cooldown
251 fixed bug: /cast
252 moved menu button
253  
254 3.0 changes
255 for 1.9 patch
256 lost blizzard_macroui dependency
257 lost unlimited macros
258 shortened versions of common functions (eg cast, stopcast, use, echo, send, pickup). read functions.txt
259 options frame
260 /supermacro options to open options frame
261 minimap button (optional)
262 tooltip, cooldown, and count about items and spells (tooltip optional)
263 action buttons replaced with appropriate icons (optional)
264 game menu button below Keybindings and above Macros
265 tooltip support for discordactionbars (untested)
266 documentation for user-friendly functions in functions.txt
267 SM_Channel(spell) for uninterrupted channeling, /smchan, /smchannel
268 /in seconds[+] command, /smin, SM_IN(seconds, command[, repeat])
269 /shift form
270 Right-click macro button in SuperMacro frame to run macro.
271  
272 2.89 change
273 fixed self-cast
274 fixed item link from tradeskill
275 functions.txt lists convenient functions and slash commands
276 imported some functions from 1900 series
277 new functions: DoOrder, Pass, Fail
278  
279 2.85 changes
280 fixed sending chat messages with \n from RunMacro
281 remove editing CastSpellByName
282 /cast to cast highest ranking spell if no rank specified
283 allows alias in macro (need more testing) [using my other addon Alias-Spellchecker aka ASF]
284 switch macros on actionbar with SetActionMacro( actionid, macro )
285  
286 2.8 changes
287 actionbarbutton macro tooltips enhanced to show spell and/or macro code
288 slash command for macrotip options
289 fixed behavior regarding ingame extend
290 macroframe framestrata changed to high
291  
292 2.7 changes
293 in-game extend code increased to 7000 characters (instead of 900)
294 shows extend character limit
295 ## OptionalDeps: Blizzard_MacroUI
296  
297 ## 2.6 changes
298 added Macro() function:
299 Macro = RunMacro;
300 in-game extend editor (not same as SM_EXTEND.lua):
301 scripts written with in-game extend are saved in SavedVariables under SuperMacro.lua
302  
303 ## 2.5 changes
304 Max macro length decreased from 1023 to 256.
305 Interface updated to show 256 limit.
306 Makes use of SM_Extend.lua.
307 Due to the max macro length being shortened, make a file called SM_Extend.lua to define long functions and global variables, then call them from your macros. See example above (FindTradeSkillIndex).
308  
309 ## 2.4 changes
310 Item link to MacroFrame from container frame items, paperdoll items, bagslots, tradeskills using Alt-click.
311 Item link to ChatFrameEditBox from tradeskills using Shift-click.
312 Slash commands for using and equipping items.
313 /use,/smuse <item_name>
314 /equip,/smequip,/eq,/smeq <item_name>
315 /equipoff,/smequipoff,/eqoff,/smeqoff <item_name> to equip offhand
316 /unequip,/smunequip,/uneq,/smuneq <item_name>
317 /print,/smprint <text> to display text into chat frame.
318 /supermacro printcolor <red> <green> <blue> to change color used in /print.
319