Useful macros ( old ) These macros have not be validated as working in patch 3 . 1 or later . These macros may no longer function as expected . General . For more info on the new macro syntax introduced in Patch 2 . 0 , see . Attack / Shoot / Throw . # showtooltip [ nomodifier ] attack ; [ modifier ] Shoot ( or Throw ) This will act like a normal attack button , except that it won ' t toggle auto - attack off in combat ( hit escape if you need to do that ) . It will , also , show your current weapon when assigned to a quick - slot . You may want to leave out the references to Shoot or Throw , or perhaps make them more precise by using [ modifier : shift ] or some such , depending on your style of play . The above will attempt to shoot , throw or even fish ( depending on what you have equipped . For Hunters , change " Thrown " to " Gun " , " Crossbow " or " Bow " and remove " Throw " and change " Shoot " to " Auto Shot " . This macro will start shooting wand , but will not toggle it off . Keeping space , switching actions . Template . This principle is for those of us who like to keep buttons as few as possible or to bind as much actions as possible . or will select actions based on the situation . The first template is better to combine with exclusively non - combat beneficial spells and items , like Arcane Intellect or food & water ( see below ) . The second template is better for use with beneficial spells which you ' re likely to use in combat ( any heal or blessing , for example ) . The icon will allow you to see what exactly you ' re going to cast . Note that you can cast the beneficial spell on yourself by mouseovering the player frame , so " mod : ctrl " ( or " alt " ) condition can better be used to modify the spells ( example below ) . Direct damage / buff spell . # showtooltip This convenient macro will cast Fireball / Pyroblast ( depending on whether or not " Ctrl " was pressed ) on a harm - able target , Arcane Intellect on selected or mouse - overed friendly target ( mouse - over the player frame to buff yourself ) , and Arcane Brilliance on a friendly target if " Ctrl " was pressed . AoE harmful / direct beneficial . # showtooltip Since AoE spells are often used to search for rogues , they require a template which will force them to be used under any circumstances except when something friendly is mouseovered or directly targeted . Combat spell / food & drink . # showtooltip A very good use for these macros is to put food & water on them so you ' ll never have to click something by mouse when grinding ! " Some of these macros have not yet been tested directly but the overall principle works . " Targets . Swap focus / target . / stopmacro [ noexists ] [ target = focus , noexists ] For more information about the focus and how to use it , see Focus target . Advanced swap focus / target . / focus [ target = focus , noexists ] This macro sets the focus if you don ' t have one and clears the focus if you ' re out of combat . If you don ' t have a target it will target the focus if you ' re in combat and don ' t have a target ; otherwise swaps the target and focus . Acquire focus target / toggle between previous target . / clearfocus [ modifier : ctrl ] How to use : If no target = does nothing . If you have a target but no focus target , it makes target focus target . Once focus target is acquired and current target is anything but focus target = switches active target focus target . Hold down Control + activate = replaces focus target with current target ( or clears if no current target ) . Hold down shift + activate = toggles between current target & last target . Replace either ctrl or shift with alt if that modifier key works better for you . Also , it will not let you add a focus target that is dead . If you want to focus corpses just delete the " [ target = target , dead ] / " from line 3 and " / [ target = focus , dead ] " from line 4 . Cast on moused - over unit . / cast [ target = mouseover , exists ] [ ] Name Of Spell The player or mob that is under your mouse pointer will be the one that is hit or healed by your spell . If there is nothing there , your selected target will be used . Crowd Control stays on 1 mob . / focus [ target = focus , exists , nodead ] focus ; [ btn : 2 ] [ ] target Replace Shackle Undead with a spell name appropriate to your class . The purpose of this macro is to eliminate micro - management of CC . Once a target is identified for control , another target may be selected for healing or damage , and the controlled target will be the victim of renewed control until it is dead . It is common for people to add a shout ( e . g . : codice _ 1 ) to warn off would - be sheep - breakers . Raid icons , Lucky Charms . / script SetRaidTarget ( " target " , n ) where n is : and 0 is no icon . It ' s more helpful when used in the same macro call as preparing to sheep ( when you as mage are leader ) and other CC preps . Alone , this command line isn ' t that useful unless with a key binding , since you can just rightclick the unit frame to change the icon . Lucky Charms with Mouseover . / script SetRaidTarget ( " mouseover " , n ) Combined with key bindings , this macro makes for extremely fast marking . See above for corresponding values for " n . " Tank assist macros . / focus [ modifier : shift ] target This macro sets the focus with shift - button , targets it with alt - button , and targets the target of the focus with the button itself . Useful for DPS trying to target what the tank is targeting in a pack , or just to keep track of a polymorphed target . or : Begin by selecting the MT / MA and then click the assist macro with the alt pressed . If no Focus ( MT / MA ) has been set and the macro is clicked , you will receive a UI message stating " Unknown Unit . " If you have set your Focus and just click the macro , you will assist the MT / MA and target his or her target . Bandages . Heavy Netherweave Bandage on self . / use [ target = player ] Heavy Netherweave Bandage This macro will always use Heavy Netherweave Bandages on yourself , regardless of target . Heavy Netherweave Bandage friendly then self . / use [ help , nomodifier : alt ] Heavy Netherweave Bandage ; [ target = player ] Heavy Netherweave Bandage This macro will use a Heavy Netherweave Bandage on your target if you can , yourself otherwise . If you hold down ALT , you will always bandage yourself . Specify target by modifier key . / use [ modifier : alt , target = player ] Heavy Netherweave Bandage Bags and money . Sell all grey items . / script for bag = 0 , 4 do for slot = 1 , GetContainerNumSlots ( bag ) do local name = GetContainerItemLink ( bag , slot ) if name and string . find ( name , " ff9d9d9d " ) then DEFAULT _ CHAT _ FRAME : AddMessage ( " Selling " . . name ) UseContainerItem ( bag , slot ) end end end Mail all green items ( Good for mailing greens to be disenchanted ) . / run for bag = 0 , 4 do for slot = 1 , GetContainerNumSlots ( bag ) do local texture , itemCount , locked , quality = GetContainerItemInfo ( bag , slot ) if quality = = 2 then UseContainerItem ( bag , slot ) end end end The mailbox must be open on the Send tab ( preferably with a To : name typed in ) to use this . Get all money from mail items ( Good for Auction House sales ) . / script CheckInbox ( ) for m = GetInboxNumItems ( ) , 1 , - 1 do TakeInboxMoney ( m ) end If there is any money in any of your mail messages it will be collected . As for the Auction House messages , once the money is collected the message will be removed . Your mailbox must be open before the script will work . Get all items from mail ( edit of macro above ) . / script CheckInbox ( ) for m = GetInboxNumItems ( ) , 1 , - 1 do TakeInboxItem ( m ) end This macro will remove any items in your mailbox . Your mailbox must be open before the script will work . Swap carried & bank bags . / script PickupInventoryItem ( 20 ) PickupInventoryItem ( 71 ) Use : Swap your four bags with the first four bags in the bank . You have to be in the bank and open the window before you use the macro . It is very helpful if you have bags with your tools and other stuff you need for your jobs . Open all bags . / script OpenAllBags ( ) This macro opens all bags , the same as pressing shift - B in the default keybindings . Useful if you want to put a button for this on an action bar . Open all bags but leftmost one . / run o = OpenAllBags c = CloseAllBags i = IsBagOpen cw = CloseBag if i ( 0 ) and i ( 1 ) and i ( 2 ) and i ( 3 ) and not i ( 4 ) then c ( ) cw ( 0 ) ; else if i ( 0 ) or i ( 1 ) or i ( 2 ) or i ( 3 ) or i ( 4 ) then c ( ) cw ( 0 ) o ( ) cw ( 4 ) else o ( ) cw ( 4 ) end ; end One could find this macro useful if playing as a Warlock and wanting to open all bags at once but the SoulBag . Please note : My SoulBag is the leftmost one but one can easily replace the code in the script above to leave closed whichever she prefers . " Background information : " In v2 . 3 . 3 . 7799 the " CloseAllBags " function is buggy : under certain conditions , it ignores the backpack . This fact led the macro author to create a longer macro than he would have preferred . Quests . One - click Skyguard / Ogri ' la / Netherwing dailies . # show [ mounted ] Skyguard Bombs ; Fel Gland These are all items used in the pre - 2 . 4 daily quests put together in a single button . If you choose the Question Mark for the icon , it will show while mounted and the number of you have while dismounted . It won ' t show the cooldown on the blasting charges nor the number of Apexis Shards you possess - unless you change the # show line , of course . Note that this will not work for druids in flight form . One - click Shattered Sun Offensive dailies . # show [ mounted ] item : 34475 ; item : 34338 There are so many quest items associated with Quel ' Danas dailies that they all had to be converted to item ID format to save space . If you choose the Question Mark for the icon , it will show while mounted and the number of you have while dismounted . The macro normally attempts to use every item available to the quests " except " Flaming Oil . To use the oil , right - click the macro button instead . ( If you prefer the ALT key , change btn : 2 to mod : alt . ) This distinction was made due to the oil ' s ability to override Arcane Charges . Equipment of Multiphase Spectrographic Goggles has also been omitted from the macro since it would become equipped too early , and decrease player stats for the other dailies . Here are the omitted lines , but they make the macro too long . Remove any 1 quest that you prefer to skip , and replace codice _ 2 with : . . . where # # # # # is the item number of your standard helm . Be sure to use the macro as you fly into Nagrand . List objectives . / script i = GetNumQuestLeaderBoards ( ) ; for j = 1 , i , 1 do a1 , a2 , a3 = GetQuestLogLeaderBoard ( j ) ; SendChatMessage ( a1 , " PARTY " ) ; end ; Use : Sends your current quest objectives to party chat . This way , you don ' t have to constantly type to party members how many of each creature you need to complete a quest . bugged : always displays the first item , even if it ' s not being tracked . Bypass turn - in dialogue . / script SelectGossipAvailableQuest ( 1 ) This macro will do the following : - Attempt to bypass any initial dialogue with an NPC ( such as a banker or flight - master ; or any NPC with only one quest available ) . - Select the first quest reward available ( can be dangerous if you get too addicted to this macro ) . Turn in a quest . Credit goes to www . Feign . org from back in the halcyon days of CC Rep farming when it was possible to get a quest done twice in one go - with a fast mount and mad skills . - Do not add the command / startattack no matter how tempting it is , you ' ll inevitably find yourself turning in a quest in a neutral town with an opposing - faction player standing in close proximity behind the quest NPC - with hilarious consequences . Add the line / cast [ insert skill / spell of choice here ] at the end of macro to make it truly vital . The druid version , for example , casts Faerie Fire or Faerie Fire ( Feral ) depending on whether the druid is in form or not . Automatically Abandon the First Quest in the Quest Log . This macro can be used to abandon a quest without clicking the abandon button and confirming your decision . It ' s most useful to perform this repeatedly to clear out your quest log . Drinking . Mana Potion / Water . This macro will use a mana potion if you ' re in combat , or your favorite beverage when not in combat . Use the icon and it will show which one will be used . Substitute your item names : Water / Manna Biscuit . This will use Purified Dranic Water on normal click and Conjured Manna Biscuits on shift - , alt - or ctrl - click if found in your inventory . This macro will use your Manna Biscuits if you have any , if not will use your Naaru Rations . Mana / Healing / Dreamless Sleep Potions . This macro will use a Super Mana Potion with a normal click , a Super Healing Potion with a alt - click or a Major Dreamless Sleep Potion with a ctrl - click . You can change the potions to whatever suits you best . Racial abilities . Forsaken . One - key Will of the Forsaken and Cannibalize . This macro will use Will of the Forsaken if in combat , or Cannibalize if not in combat : Notice that holding down the alt button will reverse the abilities , letting the user execute Will of the Forsaken outside of combat or Cannibalize inside of combat . This manual override is included because though Will of the Forsaken is mostly a combat ability and Cannibalize is a non - combat ability , there are times when it is useful otherwise . For example , if a mob fear s the player just before dying , the combat condition might be cancelled but the player runs the risk of inadventently moving into the aggro range of another mob and add ing . Likewise , during a particularly long encounter a player may need to break from combat and Cannibalize to regain health while the rest of the party is still engaged . Cooking . This consolidates the cooking button , and creating a fire . This is separated with simple left / right - click logic . Fishing . Two Modifier Swap . / equip [ noequipped : Fishing Poles , nomodifier : alt ] Seth ' s Graphite Fishing Pole This macro is handy in that on a regular click ( or hotkey press ) it will equip your fishing pole ( simply change Seth ' s Graphite Fishing Pole to the name of whichever pole you use ) , and when pressed again will begin fishing . On an alt - click ( or alt + hotkey ) it will re - equip your normal weapon ( s ) . If you use a two hand weapon , simply take out the third line and change Mana Wrath to your own main weapon , otherwise if you use two change Mana Wrath and Lamp of Peaceful Radiance to your own particular weapons . This macro also avoids any error messages from popping up . You could also add to this macro to have it swap out a Lucky Fishing Hat or gloves with the fishing enchant as well , if you had them . 2H Coordinate Swap 1 . Another , more simple , fishing macro is this : Replace x and y with the container location of your fishing pole ( bag slot and item slot respectively . ) A right - click will equip or unequip a fishing pole , and a left click will cast a lure . Note though that this macro only works with two - handed weapons and not a single - handed weapon and an offhand item , shield , or weapon ; if you are going to use other than a two - handed item , use the first macro . 2H Coordinate Swap 2 . Here is a more elaborate version : It will equip your fishing pole if not equipped , or cast Fishing . If you hold alt it will equip your weapon . If you hold ctrl it will use a fishing lure . The bag number is x , y is the slot your fishing pole is in , z is the slot for the lures . Again this works best if you have a two - handed weapon . Outfitter + Coordinate Swap . Here is a complete fishing macro that utilizes the Outfitter add - on : Where x y and z i are the bag locations of your lure and your pole , respectively . With no modifiers and a fishing pole equipped , this will cast fishing . With shift held and a fishing pole equipped , it will use your lure . With control pressed , it will toggle the " Fishing " outfit using Outfitter , which will automatically unequip your fishing outfit if you enter combat . Count fish . # show Speckled Tastyfish If you want to keep track of how many of a specific kind of fish you have , use the icon and this macro . Autolure . This macro is useful to automatically set a lure to your fishing pole , if you ' re a using a shortcut to / cast fishing . If no lure is active , then it ' ll cast one , if a lure is active , then it ' ll simply just fish . Change " Lure " to the name of whichever lure you are using and " Pole " to the name of whichever pole you are using . Announce resurrection target . / run R = R or CreateFrame ( " Frame " ) R : RegisterEvent ( " UNIT _ SPELLCAST _ SENT " ) R : SetScript ( " OnEvent " , function ( R , E , T , T , T , T ) SendChatMessage ( " Rezzing " . . ( T or UnitName ( " mouseover " ) ) , " YELL " ) R : UnregisterEvent ( E ) end ) This macro yells out the intent to resurrect someone ( " Rezzing Name " , or Corpse of Name if released ) as the spell is cast . Coordination of rezzers saves mana and time , especially after a raid wipe . Rebirth is the druid rez ; it leaves you with 40 letters to improve upon the message . The longest - named rez in the game , Ancestral Spirit , leaves 31 letters . It may be possible to find an AddOn that does the work of this macro - however , it was not always possible to identify a ghost player with a spell . Many rezzers have been witnessed making the bizarre claim " Rezzing < no target > " . Toggle gathering . / castsequence [ nocombat ] find herbs , find minerals Simple macro now that changes between Find Herbs , Find Minerals - bind it to a mouse key and you can change it every few second or so as you run along . For hunters , warlocks , druids and paladins it is easy to add in the other tracks , or make your own . Simply substitute for one of the finds below , or add on to the end , separated only by a comma . I have included some examples here . The [ nocombat ] check in the macros is so you don ' t accidentally trigger a global cooldown in combat . Macro that allow you alternate tracking automatically , once active tracking herb and tracking mine will be alternated every 3 sec , it will be inactive if you run this macro again . This macro will not active if you are mounted or in combat , you can delete [ or not IsMounted ( ) ] or [ or UnitAffectingCombat ( " player " ) ] to have it be active when you are mounted and in combat Follow with emote . / follow This macro is equivalent to following a unit - like using the " / f " command - and typing " / me is following % t . " If / follow is likely to fail or the control key is down , there is no emote . Battleground . / yell " % n , stop running so I can heal you ! " This is a simple macro for a healer in a battleground . Often your heal targets will be running away from battle , so you must tell them to stop running . Battle map . / script BattlefieldMinimap _ LoadUI ( ) if BattlefieldMinimap : IsVisible ( ) then MiniMapBattlefieldFrame . status = " " ; BattlefieldMinimap : Hide ( ) else MiniMapBattlefieldFrame . status = " active " ; BattlefieldMinimap : Show ( ) end This macro will toggle the battle map in every region , just like in the battlegrounds and the areas with outdoor pvp . Take care to combine lines 2 through 4 as shown above into a single line ( put a space at the end of each line and remove the linebreak ) . Shift - M toggles the battlemap for all zones without the need for this macro . There is also an option in the menu < esc > < Interface Options > to control default settings of the battlemap . World map . / script ToggleFrame ( WorldMapFrame ) ; This macro will toggle the world map , just like pressing " M " with the default keybinding . The ToggleWorldMap ( ) API apparently does not work in a macro . Useful if you want to put a button for this on an action bar . While these macros are useful for switching weapons with different names , if you have 2 weapons with the same name , which often happens when you wish to have different enchants , WoW will not know which you are referring to using a name or an item ID . This is remedied by using a mod like Baud Gear which keeps track of individual pieces of gear . Easy equip off - hand . See the top section for an offhand swapping macro . Use : Equips the weapon you choose into your off - hand instead of your main , so you can switch back and forth between 2 - Handed / 1 - Handed + Shield sets and Dual Wielding easily . ( Select the question mark for your picture , so the icon is your weapon of choice . ) Above macro allows you to quickly interchange your One - Handed + Shield with Two - Handed weapon . When One - Hand + Shield is equipped it will equip Two - Handed weapon and viceversa . Select the question mark for your picture , so the icon is your weapon of choice . Change the names of weapons and shield to the ones you currently use . If you wish to use Dual - Wield instead of One - Hand + Shield just change the second line to the weapon instead of the shield This macro will cycle through three sets of weapons ( NOTE : If you use the same main - hand weapon for both DPS and Tanking the third line is not necessary ) Cycle ( Starting with Two - Hand equipped ) : Note : Will " double switch " trying to re - equip tanking weapons prior to Two - Hand . At the moment , I don ' t know how to check for One - Hand weapon in Off - Hand slot ( if I did this " double switch " would not exist as that would be the requirement for equipping a shield . Possible Work around is to configure this to Cntrl Alt Shift and / or no modifier Use or swap trinket . # showtooltip This will use the trinket in slot Z , unless you click button 2 , in which case it will equip the trinket at bag coordinates X , Y . Useful for engineers with multiple trinkets on separate cooldowns ( i . e . Goblin Mortar and Goblin Dragon Gun in slot 13 , Goblin Bomb Dispenser and Mithril Mechanical Dragonling in slot 14 ) . Use either trinket . This macro activates the upper trinket if it is not on cooldown . If it is on cooldown , the macro tries to activate the lower trinket . This is useful if you have two trinkets on short cooldowns that do similar things ( add attack power , add spell damage , add healing , etc . ) . You will get an error that one item is not ready every time you use this macro . Here is another example using / castsequence and setting the reset timer to your primary trinket ' s cooldown . When you use the first trinket ( use the ' ? ' icon ! ) you will see the icon switch to your second trinket . If you use your second trinket or wait the reset time it will switch back to your primary trink . Like above , this is useful for trinkets that do similar things , as shown in this example . Another version of this macro is this : This macro is useful if you have trinkets that do dissimilar things . Left - clicking the macro will use the first trinket , right - clicking the macro will use the second trinket . This example disables the annoying sound you get when your trinkets are on cooldown ( credit to Syrloin on Steemwheedle Cartel ) : This is the same as the previous one but also disables the red error messages . In addition , the sound issue can be solved with fewer characters leaving you with extra characters for those long spell names . And the icon and tooltip of the substantive spell will be shown . This next macro moves the spellcast to the end , outside of the sound toggling . This allows the " that spell is not ready yet " warning if the final spell is indeed not ready , but still prevents the voice emote for the trinkets . As an alternative to managing the UI _ ERROR _ MESSAGE event to suppress the error messages on the trinkets , you can call UIErrorsFrame : Clear ( ) , but this will have the side effect of clearing any previous error messages . For offensive spells , the following line can be added at the top to prevent trinket use if there is no target selected , or the target is dead or not an enemy . Interface ( How to find hidden program information ) . Some AddOns include a library that provides the / print command . When the command is available , it can replace any codice _ 3 phrase in a macro with codice _ 4 . Get itemNumber ( Used to shrink a macro ) . / script local infoType , info1 , info2 = GetCursorInfo ( ) ; if infoType = = " item " then DEFAULT _ CHAT _ FRAME : AddMessage ( info1 ) ; end This macro uses the script language to obtain the item number of what is on the cursor and displays it in the chat window . Assign the macro to a hotkey , pick up an item with the cursor , and hit the hotkey of the macro to see the item ' s number . This is useful for shortening macros by replacing long item names with codice _ 5 . Get frame name . / script DEFAULT _ CHAT _ FRAME : AddMessage ( GetMouseFocus ( ) : GetName ( ) ) ; You can bind this macro to a hotkey , then hover your mouse over a frame and press this macro , and the name of the frame under your mouse will go to the chat frame . This is mostly useful to help identify AddOns that are making odd frames on the screen . Get icon name / " texture " . / script local type , id , book = GetCursorInfo ( ) ; DEFAULT _ CHAT _ FRAME : AddMessage ( ( type = = " item " ) and GetItemIcon ( id ) or ( type = = " spell " ) and GetSpellTexture ( id , book ) or ( type = = " macro " ) and select ( 2 , GetMacroInfo ( id ) ) ) Assign the macro to a hotkey , pick up an item , spell , or macro with the cursor , and hit the hotkey of the macro to see the filename of the object ' s image . The filename is relative to the World of Warcraft installation folder , and may not actually be ' there ' on your hard drive since the program has a virtual directory system . This is useful only to programmers and those curious enough to ask . Profession Macros . Easy Milling / Prospecting . # showtooltip Easy Borean Leather . This macro was made by Pyroshen of Wowhead . Just spam this macro and you ' ll make a few Borean Leather from Borean Leather Scraps . This is also easily accomplished by simply putting your stack of Borean Leather Scraps on a hotbar button , and clicking the item as you would when using a scroll or a potion . It ' s not affected by the Global Cool - Down , so you can spam it as well . An advantange to using this method is that you will not only be shown you how many Scraps you have in your bags / containers , but it will accomplish the same task without actually using one of your available macro slots . As an alternative , you could make something like To easily open clams and combine a variety of combinable items . One advantage is that you can use the macro while having the bank screen opened .