slash commands
Now that you have a solid foundation I'd like to briefly cover some of the other slash commands at your disposal. Some of these commands may seem a bit pointless at first glance, but when you combine them with the macro options from Part II, they can perform some neat tricks.
Equipping items
There are two commands for equipping items: /equip and /equipslot. /equip simply takes an item name and will equip it to the default slot as if you had right-clicked it in one of your bags (i.e., a one-handed weapon will be equipped to your main hand). /equipslot takes an inventory slot id (see http://www.wowwiki.com/InventorySlotId) and an item name, and equips the item to the specified slot. Examples:
Equip a weapon to default slot:
/equip Honed VoidaxeEquip a trinket to the lower trinket slot:
/equipslot 14 Carrot on a StickNote: Addons are allowed to use the equipping functions directly, even during combat. By the same mechanism, you can use the equipping slash commands with addons like AfterCast or Chronos. You might have some trouble if the addon first checks whether the command is secure; the equipping commands are in the secure command list, though they aren't inherently secure.
Sequencing spells and items
Many times you will find yourself casting a series of spells or use certain items in the same order on pretty much any mob you fight. To make this job a bit easier, we have the /castsequence command. /castsequence takes a list of spells and/or items separated by commas. These follow the same rules as /cast and /use. This means you can interchange spell names, item names, item IDs, inventory slots, and bag slot combinations. Each time you run the macro, it activates the current spell/item. If the spell or item is used successfully, the sequence will move to the next entry. You must repeatedly activate the macro to use all the spells in the sequence. Once you use the last entry in the list, it will reset to the beginning. Example:
/castsequence Immolate, Corruption, Curse of Agony, Siphon LifeThis might be something you would use for a Warlock's opening attack. Note, however, that if Immolate fails to cast for some reason (out of mana, not in range, silenced, etc.), the sequence will remain at that point. Because of this, you cannot use a /castsequence to make a spammable macro like:
/castsequence Overpower, Execute, Mortal StrikeBefore the spell list, you can also specify reset conditions to start the sequence over before it reaches the end. The basic syntax for reset conditions is:
reset=n/target/combat/shift/alt/ctrlWhere n is a number of seconds. You can specify any number of these conditions separated by slashes as shown. Seconds are used as a timeout for the command. Each time the sequence runs, it resets the timer. If you don't use the macro within the number of seconds specified, the sequence will start over. This is a very important distinction because it means you cannot use a reset timer to account for cooldown. target resets the sequence when you change targets; combat when you leave combat; shift, alt, and ctrl when you activate the macro with one of those keys depressed. Example:
/castsequence reset=10/shift Spell 1, Other Spell, Some Item
If you used the question mark icon, WoW will automatically update the icon to the current element of the sequence. If you have other /casts or /uses before the /castsequence, though, they will interfere and there is no way currently to tell WoW to pay attention to the sequence instead.
Random spells and items
One of the most common requests on this forum is for a macro to use a random mount. This is extremely trivial thanks to the addition of /castrandom and /userandom. Like /castsequence, /castrandom and /userandom takes a list of spells and/or items separated by commas and picks one at random when you run the command. Example:
/castrandom Swift Green Mechanostrider, Black Battlestrider, Summon Dreadsteed Attacking
The simplest attack command is /attack. This functions identically to the attack skill or key binding and will toggle your attack. If you'd rather have an "always start" or "always stop" attack, you can use /startattack or /stopattack, respectively. Both /attack and /startattack can take a name or unit ID to specify who to attack. Example:
/attack Cogwheel Action bar manipulation
There are two commands that allow you to change action bar pages: /changeactionbar and /swapactionbar. /changeactionbar takes a single number and will always switch to that page. One use of this is for hunters to emulate stances by having a pair of macros like:
/cast Aspect of the Hawk
/changeactionbar 1and
/cast Aspect of the Monkey
/changeactionbar 2/swapactionbar takes two page numbers and will swap between them each time it runs. If you're on a page other than one of the two specified, it will be change to the first of the two.
/swapactionbar 1 2Removing buffs
The /cancelaura command allows you to remove unwanted buffs. For example, a tank could remove an unwanted buff in a macro with the following command:
/cancelaura Blessing of Salvation Leaving a form
With the exception of Warriors, any class with stances (Druids, Priests with Shadowform, etc.) can use /cancelform to leave their current form. See the stance section of Part II for an example.
Stopping a cast
/stopcasting has been touched on briefly in other contexts but its main use, as you might guess, is to stop another spell cast that's in progress. This is useful for making "panic buttons" that interrupt whatever you're doing at the moment in favor of something more important. On my Warlock, for instance, I use the following macro:
/stopcasting
/cast ShadowburnHalting a macro early
/stopmacro is one of those commands that doesn't really come into its own unless you use it with macro options. Its main use is to implement "fall-through" logic to prevent you from continuing a macro if certain conditions are true. See "Using Focus " for an example.
Dismounting
/dismount
'nuff said...
Simulating button clicks
The /click command takes the name of a frame and virtually clicks the frame with your mouse. By default, it behaves like a left-click, but you can specify other mouse buttons in the command. To determine the name of the frame you're interested in, you can use an addon like MoveAnything, look through the UI code for the frame, or activate the following macro by a key binding with your mouse over the frame in question:
/run local f = GetMouseFocus(); if f then DEFAULT_CHAT_FRAME:AddMessage(f:GetName()) end/click can be used for many different purposes. You can chain macros together by ending each with a /click command that activates the next macro in the sequence. You can also do things you wouldn't normally be able to do with macros. For instance, there is no command to toggle your pet's auto-cast abilities (until patch 2.3). However, you can use /click to reproduce a right-click on the given button (the fifth one in this example):
/click PetActionButton5 RightButton