vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 Functions and slash commands found in SuperMacro addon that can be helpful in your macros are listed here in alphabetical order. Alt-click on an item to insert its item link into the macro.
2  
3 (For even more convenience and to shorten macros, I recommend another addon, Alias, a.k.a ASF. Read end of file for explanation.)
4  
5 (P.S. I may accept requests for other convenient functions and slash commands.)
6  
7 --Table of Contents
8 CancelBuff(buff [,...]), unbuff
9 cast
10 caststop(spell [,...])
11 Channel(spell), /smchan, /smchannel
12 CraftItem( skill, item, count), /craft, /smcraft
13 DoOrder(spell | item [,...]), /order, /smorder
14 echo
15 /equip, /smequip, /eq, /smeq
16 /equipoff, /smequipoff, /eqoff, /smeqoff
17 Fail(message), /fail
18 FindBuff(buff [ [, unit], item]), buffed
19 FindItem(item)
20 /in seconds[+] command, SM_IN(seconds, command, repeat)
21 Macro
22 Pass(message), /pass
23 pickup(bag, slot), pickup(inventory_slot), pickup("item")
24 /print msg, /smprint, SM_print(msg), echo
25 PrintColor(r,g,b,msg [,...]), Printc
26 Printd(msg [,...]), Print
27 PrintTable(table, rowname, level), Printt
28 RunBody(longtext)
29 RunLine(command [,...])
30 RunMacro(index|macro), Macro, /macro
31 RunSuperMacro(index|super)
32 SayRandom(speech [,...]), /sayrandom, /smsayrandom
33 send
34 SetActionMacro(actionid, macro)
35 SetActionSuperMacro(actionid, supername)
36 /shift form -- for druids, rogues, warriors only
37 stopcast
38 /unequip, /smunequip, /uneq, /smuneq
39 use(bag,slot), use(item), /use, /smuse
40 UseItemByName(item)
41 ## Alias
42 --End table of contents
43  
44 ## CancelBuff(buff [,...]), unbuff, /unbuff, /smunbuff
45 Cancel the player's buffs that match the given strings.
46 Ex. /script CancelBuff("Demon Skin")
47 Ex. /script CancelBuff("demon") -- cancel buffs with demon in it, including Demon Skin
48 Ex. /script unbuff("demon") -- same as above
49 Ex. /unbuff demon -- same as above
50 Ex. /unbuff mana, frost -- cancel any buffs matching mana or frost
51 Ex. /unbuff . -- cancel all buffs, use with care
52 Ex. /unbuff a -- careful, cancel all buffs with 'a' in their names
53  
54 ## cast
55 cast is same as CastSpellByName.
56 Ex. cast("Heal")
57  
58 ## caststop(spell [,...])
59 Cast a spell, then stop. Will cast multiple spells in sequence. Only works properly for spells that don't cause global cooldown. (Not tested.)
60 Ex. /script caststop("Arcane Power","Presence of Mind","Frostbolt")
61 is equivalent to
62 /cast Arcane Power
63 /script SpellStopCasting();
64 /cast Presence of Mind
65 /script SpellStopCasting();
66 /cast Frostbolt
67  
68 ## Channel(spell), /smchan, /smchannel
69 Safely channel a spell, ignoring accidental multiple keypresses.
70 Ex. SM_Channel("mind flay")
71 Ex. /smchan mind flay
72 -- test tooltip
73  
74 ## CraftItem( skill, item, count), /craft, /smcraft
75 Create item or enchant (at least one time). If count is left out (nil) then will make one. If count is zero, then will make all available. If count is negative, then will leave that much.
76 Ex. /craft First aid, Heavy Linen Bandage -- make one bandage
77 Ex. /smcraft First aid, Heavy Linen Bandage, 0 -- make all available bandages
78 Ex. CraftItem( "First aid", "Heavy Linen Bandage", -1 ) -- make all but one
79  
80 ## DoOrder(...), /order, /smorder
81 Use first available item or cast spell in a list separated by commas, and ignore the rest of the list. Alt-click on item to insert item link into macro.
82 Ex. DoOrder("healing potion", "lesser healing potion", "healing touch")
83 Ex. /order healing potion, lesser healing potion, healing touch
84 -- if healing potion found, will use it, and ignore the rest of the list
85  
86 ## echo
87 See /print.
88  
89 ## /equip, /smequip, /eq, /smeq
90 Equip or use an item. Also works with item links. Alt-click on item to insert item link into macro.
91 Ex. /eq hatchet
92  
93 ## /equipoff, /smequipoff, /eqoff, /smeqoff
94 Equip item into off-hand slot. Also works with item links. Alt-click on item to insert item link into macro.
95 Ex. /eqoff shield
96  
97 ## Fail(message), /fail
98 Run message or script if current action (spell or item) failed. See Pass for success.
99 Ex. /script CastSpellByName("Attack") Fail("Can't attack")
100 Ex. /script CastSpellByName("nada") Fail("not a spell")
101 Ex. /script Fail("no action")
102 Ex. /fail /script use('hearthstone')
103 Ex.
104 /cast Heal
105 /fail /p can't heal
106  
107 ## FindBuff, buffed
108 See if a unit has a specific buff or debuff, or weapon buff.
109 Usage 1: FindBuff(buff [ [, unit], item])
110 Usage 2: buffed(buff [ [, unit], item])
111 buff is the buff's name, or part of it's name--not case sensitive
112 unit is API 'unit' value ('player' if left empty or nil)
113 item value is boolean. if item is not nil or false or empty, then will search for item buff instead
114 Ex. buffed("Find Herbs") -- player's buff; returns "track", 0
115 Ex. buffed("herbs") -- also works
116 Ex. FindBuff("rockbiter",nil,1) -- player's weapon buff; returns "main" or "off", time left, charges
117 Ex. buffed("rockb") -- same as above
118 Ex. buffed("gouge", 'target') -- target's buff; returns "debuff", id
119 Ex. buffed("perception") -- returns "buff", id
120  
121 ## FindItem(item)
122 Find an item in your container bags or inventory. If found in inventory, returns slot, nil, texture, count. If found in bags, returns bag, slot, texture, total count in all bags. Also works with item links. Alt-click on item to insert item link into macro.
123 Ex. local bag,slot,texture,count = FindItem("Lesser Magic Essence");
124  
125 ## /in seconds[+] command, /smin, SM_IN(seconds, command[, repeat])
126 Execute command in seconds seconds. Use + after sec to repeat. Separate multiple commands with \n. Does not cast spells or use items.
127 Ex. /in 5 /p NOW
128 Ex. /script SM_IN(5, "/p NOW") -- same as first, no repeat
129 Ex. /in 1 /script PlaySound( "LOOTWINDOWCOINSOUND")
130 Ex. /smin 600+ /print 10 mins repeating -- use + to repeat
131 Ex. SM_IN(600, "/print 10 mins repeating", 1) -- repeats, same as above, but no +, instead include third parameter
132 Ex. /in 1 /t ;me hi\n/t ;me hey -- multiple commands separated by \n
133 Ex. /script SM_IN(1,"/t ;me hi\n/t ;me hey") -- same as above
134 Ex. /in 1m /print 1 min passed -- 1m = 1 minute, 1h = 1 hour, 1s = 1 second
135 Ex. /script SM_IN("1m","/print 1 min passed") -- same as above, note 1m in quotes
136 Ex. /in 1h30m5s+ /print repeat every hour and 30 mins and 5 seconds
137  
138 ## Macro
139 See RunMacro.
140  
141 ## Pass(message), /pass
142 Run message or script if current action (spell or item) succeeded. See Fail for failure.
143 Ex. /script CastSpellByName("Attack") Pass("Attacking")
144 Ex. /pass /macro Cheer
145 Ex.
146 /cast Heal
147 /pass /p Healing
148  
149 ## pickup(bag, slot), pickup(inventory_slot), pickup("item")
150 Pickup item from inventory or bags. One argument for inventory; two arguments for bags. Argument can also be a string containing the item's name. Calling this function again puts the item into that slot, which may swap items. Also works with item links. Alt-click on item to insert item link into macro.
151 Ex. pickup(16) --main hand weapon
152 Ex. pickup("mainhandslot") -- also main hand weapon
153 Ex. pickup(1,4) -- bag 1, 4th slot
154 Ex. pickup("hearthstone") -- pickup hearthstone
155 Ex. pickup("hearthstone") pickup("healing potion") -- consecutive pickups will swap these items
156 Ex. pickup("hearthstone") pickup(4,7) -- put hearthstone in that slot; may swap if slot is not empty
157 Ex. pickup("ring of iron will") pickup("finger0slot") -- put ring on first finger slot
158  
159 ## /print msg, /smprint, SM_print(msg), echo
160 Print message into chat that only you can see. It's identical to DEFAULT_CHAT_MESSAGE:AddMessage. Default color is white, but you can change it in options.
161 Ex. /print test
162 Ex. echo("test")
163  
164 ## PrintColor(r,g,b,...), Printc
165 Print message into chat that only you can see using specified color codes, in order of red, green, and blue. Color values are between 0 and 1. Also accepts any number of arguments like Printd.
166 Ex. PrintColor(1,0,1, "test") -- purple
167 Ex. PrintColor(1,1,0, "msg1", "msg2") -- yellow
168  
169 ## Printd(...), Print
170 Print message into chat that only you can see. Unlike /print, this accepts any number of arguments and prints each onto separate lines. Also, color is always white. If Print is taken by another addon, it will not overwrite it.
171 Ex. Printd("Test")
172 Ex. Print("msg 1", "msg 2") -- only if another addon doesn't have Print
173  
174 ## PrintTable(table, row, level), Printt
175 Print a table into chat for your view only.
176 Ex. PrintTable(SM_VARS)
177  
178 ## RunBody(longtext)
179 Execute longtext like a macro. Each line is separated by \n.
180 Ex. RunBody("/cast Attack\n/pass /p Attack!")
181 Ex. /in 5 /script RunBody("/print 5 secs passed\n/macro MyMacro")
182  
183 ## RunLine(...)
184 Execute a line like a macro or chat message. Takes multiple lines, where each line is another argument separated by commas. Excellent for doing slash commands within 'if' blocks.
185 Ex. RunLine("/p hi")
186 Ex. RunLine("/p hi", "/dance", "/supermacro")
187 Ex. if GetSpellCooldown(1,'spell')==0 then CastSpell(1,'spell') RunLine("/in 5 /print Cooldown finished") end
188  
189 ## RunMacro(index | name), Macro, /macro
190 Execute a macro by name or by index.
191 Ex. /macro Attack -- runs macro named Attack
192 Ex. RunMacro("Attack") -- same as above
193 Ex. Macro(1) -- run first macro in macro frame
194 Ex. /macro 1 -- will run macro named 1; note difference from last example
195 Ex. Macro("1") -- same as last example
196 Ex. /macro -- opens SuperMacro frame (no argument passed)
197  
198 ## RunSuperMacro(index | super)
199 Execute a SuperMacro by name or by index (in the order shown in SuperMacro frame at Super tab).
200 Ex. RunSuperMacro(1);
201 Ex. RunSuperMacro("MySuperMacro");
202  
203 ## SayRandom(...), /sayrandom, /smsayrandom
204 Say a random phrase from a list separated by comma. Actually, you can do more than send chat messages. There's an equal chance (1 in number of list items+1) that nothing will happen.
205 Ex. /sayrandom hi, hello -- says hi or hello or nothing
206 Ex. /script SayRandom("hi","hello"); -- same as last example
207 Ex. /script SayRandom("/script Print(1)","/script Print(2)"); -- actions besides chat
208 Ex. /sayrandom /script Print(1), /script Print(2) -- same as last example
209  
210 ## send
211 send is same as SendChatMessage. Also see RunLine.
212 Ex. send("hi") -- send "hi" to local channel
213 Ex. send("hi", "WHISPER", "COMMON", "Aquendyn") -- send whisper
214  
215 ## SetActionMacro(actionid, macro)
216 Set or replace an action button with another macro. The global variable lastActionUsed can be used to get the ID of the last action button that was pressed or clicked.
217 Ex. Swap two macros named FindHerbs and FindMinerals.
218  
219 Macro FindHerbs looks like this:
220 /cast Find Herbs
221  
222 /script SetActionMacro( lastActionUsed, 'FindMinerals' )
223  
224 Macro FindMinerals looks like this:
225 /cast Find Minerals
226  
227 /script SetActionMacro( lastActionUsed, 'FindHerbs' )
228  
229 Drag either macro into an action button on your action bar. Each time you execute that action, the macros will swap, along with their appropriate icons and tooltips.
230  
231 ## SetActionSuperMacro(actionid, supername)
232 Set or replace an action button with a SuperMacro. The global variable lastActionUsed can be used to get the ID of the last action button that was pressed or clicked. See SetActionMacro for an example.
233 Ex. SetActionSuperMacro(1,"MySuperMacro");
234  
235 ## /shift form
236 Form is number or name of form, stealth, or stance.
237 Druids: bear=1, aquatic=2, cat=3, travel=4, moonkin=5
238 Rogues: stealth=1
239 Warriors: battle=1, defend=2, berzerk=3
240 Ex. /shift bear
241 Ex. /shift battle
242 Ex. /shift stealth
243 Ex. /shift 1 -- all four commands are equivalent, any of them will shift to battle for warriors, stealth for rogues, bear for druids
244  
245 ## stopcast
246 stopcast is same as SpellStopCasting
247 Ex.
248 /cast Arcane Power
249 /script stopcast()
250  
251 ## /unequip, /smunequip, /uneq, /smuneq
252 Unequip an item if you have an empty bag space. Alt-click on item to insert item link into macro.
253 Ex. /uneq shield
254  
255 ## use, /use, /smuse
256 Use an item by name or link, by bag and slot, or by inventory slot. Alt-click on item to insert item link into macro.
257 Ex. /use hearthstone
258 Ex. /use 4,1
259 Ex. /script use("hearthstone");
260 Ex. /script use(4,1); -- bag 4, 1st slot
261 Ex. /script use(13); -- trinket
262  
263 ## UseItemByName(item)
264 Use or equip an item given its name or item link. Alt-click on item to insert item link into macro.
265 Ex. UseItemByName("hearthstone")
266  
267 #############
268 #
269 ## Aliases to simplify macros
270 #
271 ############
272 Aliases can simplify your macros significantly.
273 For example, to get current mana, alias is simply ;pm--instead of UnitMana('player'). More importantly, Alias allows values from functions into chat. Instead of:
274 /script SendChatMessage("Buffing you", "WHISPER", "COMMON", UnitName("target"))
275 use a regular chat message:
276 ;tt Buffing you
277  
278 Useful default aliases include:
279 ;z for /script
280 ;cn for CastSpellByName
281 ;c for /cast
282 ;m for /macro
283 ;rl for /console reloadui
284 ;pm for player mana
285 ;pmm for player max mana
286 ;ph for player health
287 ;phm for player max health
288 ;p2h for party2 health (and so on for party3, party4, party5)
289