Tired of being poor? Make over 200 gold a day quickly, easily, and legally!

World of Warcraft macros allow you to automate certain repetitive or complicated tasks in WoW by binding a series of text commands (those you would normally type in the command window) to a button which will execute the commands when it is pressed.

Covering all the options you have when creating WoW macros would take a small book so instead of boring you with all those details I thought I would use this article to go over the macros that are most helpful for warriors.

First, a few general characteristics of macros themselves.

Using regular World of Warcraft commands in macros works just the same as if you were typing them in the command line. For example, to set up a macro to say “Have at you!” the line in the macro would simply be: /s Have at you!

When writing commands that utilize the WoW user interface like casting a spell or moving items in your bags, commands must be written in the LUA programming language. Don’t worry if you’re not a programmer and don’t know LUA because you don’t need to in order to use this guide, I only mention this because it will help you understand the macros better if you know the difference between a regular WoW command and a LUA command.

All macros are case sensitive and are broken into two parts. The LUA commands should be written in lower case while the WoW function commands usually use a capital letter to begin each word.

For example, if else then and not end are each a LUA command and should always be written in lowercase. CastSpellByName “Spell” is a World of Warcraft function command which you can see because the beginning of each word is capitalized.

/script must always be put at the beginning of a string of commands, unless you are just using WoW in game slash commands. For example, the above Wow function command CastSpellByName “Spell” would actually be written like this: /script CastSpellByName “Spell” as a macro because it isn’t a standard in-game slash command and therefore needs to have /script at the beginning of the sentence.

But, /logout and /laugh are examples of in-game slash commands and do not need /script at the beginning of the sentence.

Putting paragraphs between scripts will seperate the two scripts from each another and they will be recognized as two separate scripts by the game engine. So, if you are using the if command in a script the entire script up through the end command must be in the same sentence. This means you can’t use paragraphs to make the command more readable because the game engine will interpret the new paragraph as the beginning of new command.

; is commonly used as a delimiter between commands and acts like a paragraph in that the sentence after the semi-colon will be interpreted as a new command.

If you are using the if command the if must eventually be followed by the then command and ended by the endif then command in order to be valid. For example, a typical if/then/else command would look like this: if Something is true then Do Something end

Some WoW commands will have empty parentheses () at the end of the command and, even though there’s nothing between the parentheses they must still be included for the command to be valid.

Basic World of Warcraft Macros for Warriors

Two of the most common questions I see from warriors regarding macros is “How do I change my stance” and “How do I change my weapons” so those are the two macros I’m going to go over here. I’ll cover basic and advanced stance commands first then go over changing your weapons using a macro after that.

There are several commands you can use to change your stance as a warrior. I’ll explain the simple commands first then later on I’ll introduce ways to use more advanced commands to gain much more powerful effects.

Changing your stance can either be done by casting a “Spell” (CastSpellByName “Spell”) or by using the function command for changing stances (CastShapeshiftForm()). The CastSpellByName “Spell” command will cast whatever spell is typed between the two quotes (where Spell is currently written). A stance is a Spell as is a charge or an attack. Basically, anything you see in your spell book can be “cast” by using the CastSpellByName”" function.

Here are a few examples:

/script CastSpellByName”Battle Stance” will put you in Battle Stance
/script CastSpellByName”Defensive Stance” will put you in Defensive Stance
/script CastSpellByName”Berserker Stance” will put you in Berserker Stance

You can also use a function command for changing stances. This command does the same thing as the CastSpellByName command but is a little shorter. Because each macro is limited to 255 characters it’s important to use the shortest command possible to accomplish your goal.

/script CastShapeshiftForm(1) will put you in Battle Stance
/script CastShapeshiftForm(2) will put you in Defensive Stance
/script CastShapeshiftForm(3) will put you in Berserker Stance

World of Warcraft Macros: Warrior Stances (Advanced)

Now that you know the commands to use to change to each stance, I’ll show you the command to use to check which stance you’re in. This is useful if you want to set up a macro to perform some action based on which stance you’re currently in.

The Icon, Name, IsActive = GetShapeshiftFormInfo() command returns information based on the stance you specify in the parentheses. Icon will return the position and name of the icon used for the stance, Name returns the name of the stance, and IsActive returns True if the stance specified is currently active or False otherwise.

Here are examples for each stance:

/script Icon, Name, IsActive = GetShapeshiftFormInfo(1) gets information about Battle Stance
/script Icon, Name, IsActive = GetShapeshiftFormInfo(2) gets Information about Defensive Stance
/script Icon, Name, IsActive = GetShapeshiftFormInfo(3) gets Information about Berserker Stance

This command is pretty useless unless you use it in an if statement. (An if Statement is simply a logical argument that checks to see if some condition is true and then performs some action depending on the result.)

I’ll start with a simple logical command to check if I’m in Battle Stance and cast charge if so:

/script Icon, Name, IsActive = GetShapeshiftFormInfo(1); if IsActive then CastSpellByName”Charge” end

This will cast charge if I’m in Battle Stance and do nothing if I’m not in Battle Stance. We need to include the else statement to perform a command if the condition (whether or not I’m in Battle Stance) is false.

/script Icon, Name, IsActive = GetShapeshiftFormInfo(1); if IsActive then CastSpellByName”Charge” else CastShapeshiftForm(1) end

This will now charge when I’m in Battle Stance and if I’m not in Battle Stance it will put me into Battle Stance so that the next time this macro is pressed it will cast charge.

World of Warcraft Macros: Change Weapons

Next I’ll cover how to change weapons using macros. This is done using a commands that manipulate your inventory and your containers (bags).

The container function you need to know is:

/script PickupContainerItem(BagSlotID, ContainerSlotID)

This command will pick up the item that is in the specified location and place it in your cursor. BagSlotID is the id of the bag you want to pick from from and ContainerSlotID is the id of the spot within that bag. Your bags are numbered from 0 to 4 starting at the bottom right like so:

[4] [3] [2] [1] [0]

and the spots within the bag are numbered from 1 to the container size beginning at the top left. Here’s an example for an eight slot bag:

[1] [2] [3] [4]
[5] [6] [7] [8]

so /script PickupContainerItem(0, 1) will pick up the item in the top-left spot in your first bag (your backpack slot).

The inventory function you need to know is:

/script PickupInventoryItem(InventorySlotID)

This will pick up an item from the specified location in your character’s inventory. InventorySlotID is the slot number within your character inventory and ranges from 0 to 19. For changing weapons, you only need to know that the main hand weapon slot id is 16 and the offhand weapon slot is 17.

/script PickupInventoryItem(16) will pick up your main hand weapon
/script PickupInventoryItem(17) will pick up your offhand weapon

One thing to remember is that when you pick up an item from an inventory or container location, any item you already have in that hand will be placed in the inventory or container location of the item just picked up. This makes it easy to reserve a spot in one of your bags for your main hand and offhand weapons and swap them back and forth with another set.

For example, suppose you have a 2H weapon equipped and you want to replace it with another 2H weapon in your bag slot and the weapon is in first slot (upper left corner) of your main bag. This macro will do that:

/script PickupInventoryItem(16); PickupContainerItem(0,1); PickupInventoryItem(16);

Another useful command is UseContainerItem(BagSlotID, ContainerSlotID)

This will automatically equip the item specified or use the item if it is a useable item. If there is an item in your inventory already it will automatically put the equipped item in its place.

One thing to be wary of when switching weapons over is the order in which you specify the weapon switches to occur. For example, if you have a 2H weapon equipped and you want to put something in your offhand, you must unequip the 2H weapon first. If you try to equip the offhand weapon first the 2H weapon will be put into the first available slot in your containers and not where you specify in the macro.

A good way to stop this happening is check if you have got something equipped in your offhand spot before you try to change weapons. If you haven’t got anything equipped then you know that you’re using a 2H weapon.

/script CursorHasItem() returns True if the cursor has an item and False otherwise

Using this command you can pick up your offhand weapon and check if your cursor has an item. If it does then you know that your offhand has an item equiped and if it doesn’t then you know that you have a 2H weapon equipped.

The following command is very good for switching between a 2H weapon and a 1H+shield and back again:

/Script PickupInventoryItem(17); if CursorHasItem() then PickupContainerItem(0,2); UseContainerItem(0,1); else UseContainerItem(0,1); UseContainerItem(0,2); end

(This macro assumes that your shield is in slot 2 of your first bag and your 1H is in slot 1 of your first bag.)

Getting the hang of using these inventory and container functions requires a bit of experimentation but these are the only commands you need to know to create World of Warcraft macros for your warrior!

Discover how I make over 1500 gold a week even with low level characters using easy and completely legal gold making strategies.

WoW Gold Screenshot
(Notice that this screenshot was taken before I auctioned off the Mature Blue Dragon Sinew (worth 85 gold) and the stacks of Primal Water (worth 430 gold per stack) you can see there in my backpack.)

Here's another screenshot showing a few of my other auctions. I bought that Schematic: Healing Potion Injector for only 20 gold earlier in the day. When the auction clears I'll make at least 75 gold for just a few minute's work because I know what and when to buy and sell at the auction house for maximum profits.

If you're tired of struggling through WoW and not being able to afford the gear you want you need to get this guide!

Blizzard Entertainment® and World of Warcraft® are trademarks or registered trademarks of Blizzard Entertainment. These terms and all related images, materials, logos, and media on this site are copyright Blizzard Entertainment. WoW-Tips is not associated, affiliated, or endorsed by Blizzard Entertainment® in any way. Any other trademarks are the property of their respective owners.