Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

The Incomplete and Unofficial Guide to /bind

From Paragon Wiki Archive
Jump to: navigation, search
Player Guide Notice
This article is a Player Guide. Paragon Wiki takes no responsibility for the content within.
Questions and concerns should be posed to the authors of the article using the article's talk page.

Introduction

Welcome to The Incomplete and Unofficial Guide to /bind, an attempt to collect all the information we know about the bind command and organize it in a way that will make using it a lot easier to understand. Bind is a very powerful tool for customizing the way you play your game, and while it is a little confusing to use when you first get into it, it gets easier the more you play with it.

This guide will (hopefully) make it easier for you to:

  • Understand what the /bind command does
  • Get a solid grasp on how it works, so you can play around with it on your own, and
  • Immediately start using /bind to remap your keyboard and mouse in ways that the basic options in-game will now allow

Understanding What /Bind Is

City of Heroes comes with a set of predefined in-game navigation and control commands. Pressing the W key moves your character forward, pressing the A key rotates your character to the left, pressing the D key rotates your character to the right, and so on. If you are not happy with these commands, you can open up the options panel, press the controls button, and replace some of them with key strokes or mouse button clicks of your own choosing. But you cannot do this with every single key in the game. If you want more control over how the in-game commands are assigned to keys, you must use /bind.

In its simplest form, /bind tells the game, "From now on, when this button is pressed, I want you to trigger that action." That action could be anything—start a power, bring up a user interface panel, send a message to another player, and so on. It is even possible to assign multiple actions to the same bind, though there are limits, and the more complex your /bind, the greater a chance that something unexpected (and perhaps unwanted) will happen. That button can be almost any button on your keyboard or mouse, though again there are some limits. Essentially, /bind is telling the game that when you press the F key you want to activate the Hover power.

What /Bind Is Not

/bind is not a macro language, and it cannot be used to automate your actions. In some games it is popular to write macros or shortcuts that allow you to queue up a number of attacks. For example, to start out with Jab, then Punch, then Haymaker, and then to repeat until you no longer have a target. This is not possible using /bind, though it is possible to do some interesting things with it that come close.

There are in fact macros in the game, but they are slightly different than macros in other games. Macros will also be covered at the end of this guide, since they share many similarities to /bind (and enough differences to make them important).

Using /Bind: The Basics

Before you can understand how to use /bind properly, you need to know how to use slash commands. Slash commands are commands that you send to the game while using the chat window. /Bind is a slash command, so understanding how they work in general will help you understand how to use /bind specifically.

Tangent: A Brief Guide to Slash Commands

While you are in-game, press your ENTER key. You will see a flashing prompt in your chat window. You have probably used this any number of times to say something to other players in game, either through the local, team, broadcast or query channels. You may also know that if you append certain words to a slash ("/"), they will be interpreted as in-game commands. For example, if you have ever fallen through the city and find yourself standing in the middle of a big blue void, with the ghostly image of the city hanging above your head, you might press the ENTER key and type

/stuck

And voila! You reappear at the entrance to the zone you were just in. City of Heroes saw the slash in front of "stuck" and realized that you were sending it a command. It then looked up "stuck" and saw that it needed to return you to the proper zone, and *poof*—it was done.

Any time you put a slash in front of text in your chat window, City of Heroes interprets the word that follows as though it were a command, whether the command exists or not. For example, /g tells City of Heroes that all of the text following the "g" should be sent to the group channel (or the team channel).

So if you type:

/g I'd really like a ham sandwich.

Anyone in my team would see the following message:

I'd really like a ham sandwich.

Some commands are a little more complicated. Not only will the game need to know the general command to tell it what to do, it will need a few pointers to show it how or where to do it. For example, /t or /tell informs the game that you want to send a single character on the server a private message. But which character?

The proper way to send a tell is to type the following:

/t character name, Hey! Want to group?

character name in this case represents someone's actual name. So what you have to do is use the /t command, then enter the character's name, then use a comma to separate the instructions from the message, then type the message. So:

/t Curveball, Hey! Want to group?

Would cause the message "Hey! Want to group?" to show up in Curveball's text window.

All this really means is that when you are using a complicated slash command, you often have to be very specific in telling City of Heroes what you want to happen, and that often you have to give it that information in a very specific way. For example, if you typed

/t Curveball Hey! Want to group?

City of Heroes wouldn't know what to do. For all it knows, the character you are trying to send a message to is named "Curveball Hey! Want to group?" which is impossible, since the name field is not long enough and does not allow exclamation points or question marks. The comma after the name is very, very important, because it tells the game "I have told you who to send the message to, now I am going to tell you the message."

Slash commands may optionally have underscores in them. Any underscores in a slash command are ignored by City of Heroes. This feature is handy for commands that are composed of multiple words to make the command more clear. For example, all of the following commands are functionally equivalent:

/powexecname Temp Invulnerability
/pow_exec_name Temp Invulnerability
/_p_o_w_e_x_e_c_n_a_m_e_ Temp Invulnerability

But the second version is arguably the most clear and readable. In binds, no underscores are typically used so that more characters may be used in the command's parameters. However, underscores are used in some game documentation and in keybind files (covered in a later section) and in this guide.

Bringing the Tangent Back On-Topic

That is all well and good, you ask, but what does that have to do with /bind? Well, two things:

  • First, /bind is a slash command, and you need to know how slash commands work in general.
  • Second, /bind is a slash command that can trigger other slash commands.

Format of the /Bind Command

/Bind, like /t or /tell, requires that you format your command very specifically. The basic layout of a properly constructed /bind command is:

/bind trigger "command"

First you identify the slash command (/bind), then you identify what key will start the command (trigger), and then you place quotes around what the /bind actually does (command).

Of course, none of that makes any sense unless you know what a trigger is and what a command is.

Triggers

A trigger is either a:

  • single key
  • combination of keys
  • mouse click, or
  • key and mouse click combination

A trigger activates the /bind command. It can be pressing the E key, or clicking mouse button 1, or pressing the left shift key in combination with either the E or mouse button 1. Combinations of keys and mouse buttons allow you to map a lot of very specific commands to a limited number of keys, provided you can keep track of all of them.

Each key has a name that /bind uses to differentiate it from other keys. The majority of the names are pretty easy to figure out. For example, the E key is "E", and the F1 key is "F1." But because some keys on your keyboard share the same name, City of Heroes has assigned them unique, more complex names to set them apart. For example:

  • LSHIFT: the shift key on the left side of your keyboard
  • RSHIFT: the shift key on the right side of your keyboard
  • NUMPAD1: the "1" key on your number pad (as opposed to the row of numbers at the top of your keyboard)
  • LBUTTON: the left mouse button on a right-handed mouse (more commonly known as mouse button 1)
  • MBUTTON: the middle button on a three-button mouse (more commonly known as mouse button 3, often the scroll wheel on modern mice)
  • BUTTON4: usually the thumb button on modern mice

Some special keys called chord keys can be used in combination with other keys and mouse buttons. They do not act as triggers themselves, but can be used with trigger keys to make new triggers.

For example, suppose you have set up the E key to trigger your Tanker's Temp Invulnerability power. In this case, E is a trigger; when you press it, it causes the power to activate. So the /bind command might look like this:

/bind e "power activation command"

(The specifics of the command are not important at the moment. It will be dealt with in the next section. )

The E key is very convenient to access in combat, and if you want you can combine it with a chord key in order assign another command to it. So you could have something like:

/bind LSHIFT+E "another power activation command"

which would tell the game "when the left shift chord key key is pressed, and then (while the left shift key is still pressed down) the E trigger key is pressed, execute the following command."

In the first example, pressing the E key allows you to trigger a power. In the second example, pressing the left shift key and E key together allows you to trigger another power entirely—the shift key is essentially making the E key a completely new trigger.

When you are setting up a chord key and trigger key combination, separate them with the "+" symbol. This tells the game that you are using both keys together. /Bind commands are read from left to right, so if you are using chords in a trigger you must always use the chord key first. If you typed:

/bind e+lshift "another power activation command"

The game would read it as:

/bind e "another power activation command"

and overwrite your original e binding. It does this because e is a trigger key and cannot chord, so it sees "oh, there's an E, I can't do anything else" and skips right to the command in quotation marks.

Commands

Commands are the instructions the game follows when a trigger is pressed. Commands are usually other slash commands. In fact, most of the time when you create a /bind, you are assigning a slash command to a key or mouse button.

But what are these commands? There are a lot of them, and they are scattered around the forums, but the most important ones can be found in these two locations:

Putting it all together

Now that you know what triggers are, what types of things those triggers can make happen, let's look at a simple /bind command:

/bind E "pow_exec_name Temp Invulnerability"

This tells the game that whenever the e key is pressed, the power "Temp Invulnerability" should activate.

Pow_exec_name is a slash command. To activate Temporary Invulnerability in your chat window, you would type:

/pow_exec_name Temp Invulnerability

And the power would trigger (assuming you had it). By binding that command to the E key, you save a lot of time, especially in combat.

One of the things you will notice in the /bind example is that in the /bind, the slash command was called without the actual "/." /Bind assumes that you are going to send it a slash command, so the slash is unnecessary, and if you use the slash it will not work.

Binding Multiple Commands to the Same Key

The previous example was the simplest form of a /bind command: a key triggered a single action. Sometimes you might want to do something a little more complicated, to set up a bind so that when a single key is pressed, multiple things happen simultaneously.

In keeping with our previous example, let's say that when the Temporary Invulnerability power is triggered you want to have your character say "I am invincible!" Well, that action is actually two slash commands:

  • /powexec_name Temp Invulnerability
  • /local I am invincible!

To do this, you need a way to tell /bind, "But wait, I want you to do something else." You do this by inserting "$$" between the two commands:

/bind E "local I am invincible!$$pow_exec_name Temp Invulnerability"

"$$" can be thought of as "and then." You are telling the game, "Say 'I am invincible!' and then trigger the Temporary Invulnerability power." The game will do just that, in that order, though it will happen so quickly it will appear to occur simultaneously.

You could do this with just about any power you want. A popular keybind is to add a message to the Taunt power, such as:

/bind T "local C'mere, ya pansy! Who wants some?$$pow_exec_name Taunt"

You can even do this to trigger more than one power with the same key:

/bind e "pow_exec_name Temp Invulnerability$$pow_exec_name Hover"

This turns on the the Temporary Invulnerability power and then turns on the Hover power. (Unless Hover is already on, in which case it turns Hover off.)

Things to Consider When Using $$

Spaces should be omitted between the commands that appear before and after the $$ symbols. All of the examples in this guide adhere to that standard, but sometimes binds will be seen by developers who have used spaces on either or both sides of the $$ symbols. Placing a space between $$ and your commands can cause things to break. For example:

/bind H "pow_exec_name Healing Aura $$ local You are healed!"

Will not work. Why? Because the /bind command is not being read as "execute 'Healing Aura'," it is being read as "execute 'Healing Aura '," with a space after the word Aura. Since there is no such power as Healing-space-Aura-space, nothing happens.

Strangely enough, you CAN use:

/bind h "local You are healed! $$ powexec_name Healing Aura"

And it will work. This is because the first command is a text message, and City of Heroes doesn't care if a text message ends in an exclamation point or a space.

Nevertheless, in general, no spaces at all should be between your first command, the $$, and the second command, and third command, and fourth command, etc.

What You Cannot Do with Multiple Actions

The one thing you cannot do when you bind multiple actions to the same key is set up a macro that will execute one attack, then a second attack, then a third attack, and so on. If you tried to do the following:

" /bind 1 "pow_exec_name Punch$$pow_exec_name Jab$$pow_exec_name Haymaker"

The game would immediately try to set up Punch, an instant later be told to execute a Jab instead, and finally be overridden a second time and be told to perform a Haymaker. The only action it would perform is the Haymaker.

There is an interesting trick you can use to get around this to an extent covered in the Neat Things You Can Do with /Bind section.

Using Variables in /Bind

Sometimes you will want to create a binding that will require the use of information that you will not necessarily have at the moment. You may not have it because you do not know it, or because that information changes, or because that information will be different depending on which character you are playing (and you want a common set of key bindings for all your characters). City of Heroes currently supports six variables that you can use as placeholders that will be substituted with the actual information when it is available.

Five of the variables are placeholders for information about your own character:

  • $name: your character's name
  • $origin: your character's origin
  • $archetype: your character's archetype
  • $level: your character's level
  • $battlecry: your character's battlecry (set in your character's ID screen)

It is possible to supply this information yourself, but then the /bind command would be specific to that character only, and if you ever exported the key bindings and imported them into another character you would have redo those /binds. Besides, your level changes throughout the game.

With these variables, it is possible to have a /bind command like this:

/bind V "local Hello, I am $name, a level $level $origin $archetype. $battlecry"

This bind would cause whichever character you were using at the time to fill in those variables with information specific to their individual builds. For three different characters, for example, the result may be:

  • Curveball
"Hello, I am Curveball, a level 10 magic defender. You have GOT to be kidding me!"
  • The Judge
"Hello, I am Judge, a level 11 mutant tanker. You are... guilty."
  • Stormhaven
"Hello, I am Stormhaven, a level 12 mutant defender. "

Note that if the battlecry has its own punctuation it will be included in the battlecry string (which is why I did not include any in my bind.) Stormhaven, who has no battlecry, says nothing, but there is still a trailing space between the period at the end of the first sentence and where the battlecry would start.

The last variable is $target, which acts as a placeholder for the name of any other character or object you are currently selecting, whether that is another hero, a civilian, a villain, or any other targetable object. This variable can be very useful when you want to identify whomever or whatever you have targeted.

For example, you could create a /bind command that would call out a specific villain whenever your tanker uses taunt:

/bind t "local C'mere, $target!$$pow_exec_name Taunt"

If you had selected a Hellion Gunner and selected the T key, your character would say "C'mere, Hellion Gunner!" and activate the Taunt power.

This can be used in informational ways as well. For example, a keybind may be set up with the Recall Friend power to inform group members when someone is being teleported with the following bind:

/bind T "group $target, prepare to be teleported to my location.$$pow_exec_name Recall Friend"

This sends a message across the group (team) channel letting everyone know that a character is about to be teleported to the hero using the power, and then activates the Recall Friend power. For the message to be more private, it could have done it this way:

/bind t "tell $target, Prepare to be teleported to my location.$$pow_exec_name Recall Friend"

In this example, the variable $target is actually part of the command. Remember, /tell needs a character name (followed by a comma) in order to know who to send the message to.

Using /Bind with Your Mouse

Mouse buttons are triggers just like standard keyboard keys are, so you can assign /bind commands to them in the same manner.

The trigger key names for each of the mouse buttons are listed below:

  • LBUTTON: The left mouse button on a right-handed mouse. It is usually referred to as "Mouse Button 1" when used in the context of both left and right handed mice.
  • RBUTTON: The right mouse button on a right-handed mouse. It is usually referred to as "Mouse Button 2" when used in the context of both left and right handed mice.
  • MBUTTON: The button between Mouse Button 1 and Mouse Button 2. In modern mice it usually doubles as the scroll wheel. It is usually referred to as "Mouse Button 3."
  • BUTTON4
  • BUTTON5
  • BUTTON6
  • BUTTON7
  • BUTTON8

Buttons 4 through 8 are used to describe extra buttons your mouse may have. At present, it does not seem possible to successfully use button 6, button 7 or button 8 in key bindings, but button 4 and button 5 seem to work just fine.

LBUTTON/BUTTON 1

Button 1 is used in-game when you select targets (friendly, unfriendly and neutral) and click on items in the user interface or certain objects in game. It seems to resist being overridden. You cannot, for example, attempt to replace its default "click" binding with another command. Attempts to do so cause both commands to execute.

For example:

/bind LBUTTON "+forward"

Does not replace button 1's default functionality with "forward." Instead, when you press down on button 1, a "click" is triggered and your character moves forward. This could have some awkward consequences. If your mouse was resting over a power icon in the power tray, for example, and you clicked on the button to move forward you would also click on that power.

RBUTTON/BUTTON 2

Button 2 is used in-game to "right click" on objects in order to see the options on their cascading menu. This is extremely important because it gives you access to the complete descriptions of powers and the ability to trade with other characters.

Button 2 is easier to override than button 1, but it still retains the ability to pop up a right-click menu no matter what you do to it.

MBUTTON/BUTTON 3

Button 3 is a weird button. It seems to be permanently bound to +camrotate, which allows you to rotate the camera around your character. The command may be overridden for short periods of time, but eventually +camrotate suddenly reattaches itself to mbutton while retaining the functionality of whatever else is bound to it.

Saving and Loading Key Bindings

If you want to save your keybinds to your hard drive, use the slash command /bind_save. This saves your keybinds in a file called keybinds.txt in your City of Heroes application directory (C:\Program Files\City of Heroes by default).

/bind_save  
Saves the all current keybinds to keybinds.txt in the install directory.
/bind_load  
Loads keybinds from the file keybinds.txt in the install directory.

If you want to load the keybinds.txt file, use the slash command /bind_load. As long as the keybinds.txt file is still in your City of Heroes application directory, it will load automatically.

It is possible to load other text files with bind commands in it simply by specifying the file name and location. The full command is

/bind_load_file full path or relative path
Full path would be the full path to the file, including spaces (if there is a space, the path needs to be in quotes).
/bind_load_file C:\CoH\textfiles\judge.txt
The command would load the judge.txt file from the C:\CoH\textfiles directory.
Relative path would be any file or directory in the piggs directory.
/bind_load_file mybinds.txt
This would load the file c:\Program Files\City of Heroes\piggs\mybinds.txt.
/bind_load_file .\binds\otherbinds.txt
This would load the file c:\Program Files\City of Heroes\piggs\binds\otherbinds.txt

/bind_save_file follows the same rules.

/bind_save_file full path or relative path


When a bind file is loaded using either /bind_load or /bind_load_file, the new file does not replace the old file, it is merged with it. If a key binding conflicts between the current file and the file being loaded, the binding in the file being loaded is used, but any key binding mentioned in the current file that is not present in the file being loaded is left alone.

Thus you can use /bind_load_file to load a keybinds file that has only two entries in it, and only those two entries will be changed. This is useful in the toggle key bindings section of the Neat Things You Can Do with /Bind section.

Understanding Keybinds.txt

The keybinds.txt file is the file that is created when you use the /bind_save slash command. It contains a list of all the triggers and commands you have defined for the character you saved it from.

This is a sample of what keybinds.txt looks like:

Q "powexec_name Hurricane"
R "powexec_name Sprint"
RALT "alttraysticky"
RBUTTON "+forward$$+mouse_look"
SHIFT+RBUTTON "+backward$$+mouse_look"
ALT+RBUTTON "nop"
RIGHT "+turnright"

Notice the /bind command is not used at all. All you see is the trigger and the command. If you want to make custom keybind files that can be loaded with the slash command /bind_load_file, you need to follow this format. Use the /bind command in the chat window, not in the keybinds.txt file.

Using "Rotating Binds"

/Bind is designed to tie a specific command to a specific key. The command might be fairly elaborate, involving an action, speech, a remapping of auto-attack, and a few combinations of slash commands, but each time you press the key it always invokes the same command. "One key, one command" is the way /bind was intended to work.

There is, however, a way around this.

Let's say that you want to bind some text to your character's taunt power, so that your character will actually taunt the villain when the power is activated. But you don't want to use the same text time after time after time, because you don't want your group to get annoyed. So you come up with five different taunts:

"Get over here!"
"You're next."
"Who wants some?"
"C'mere, ya pansy."
"Let's see what you've got."

These taunts will add a little variety to your character's taunting power, and because it is not the same thing over and over again, it may be a little tolerable for your teammates.

Now, you could go ahead and bind each taunt with your taunt power to a different key, but that would be wasteful. Wouldn't it be more convenient if you hit one taunt key, and each time you did so it called up a different taunt? It is possible to configure a key to rotate through a set of different key bindings, but it is a little complicated. The way you do this is by constantly replacing your current key binding with a new one using the command /bind_load_file

A Brief Tangent: A Recap of /Bind_load_file

The /bind_load slash command tells City of Heroes to load the keybinds.txt file in your City of Heroes application directory. The /bind_load_file slash command allows you to specify the name and location of the keybind file you want to load. Thus, if the following commands are used:

/bind_load_file C:\keybinds\curveball.txt
/bind_load_file C:\keybinds\stormhaven.txt
/bind_load_file C:\keybinds\judge.txt

The game would go into your c:\keybinds directory and load whatever file name specified.

The curveball.txt, stormhaven.txt and judge.txt files might have a few commands specific to those characters. For example, Stormhaven is a storm/electric defender, and the key used to bring up his hurricane power might be the same key used to bring up Curveball's teleport foe power. When a new character is created, /bind_load may be used to bring in my basic command set, and then /bind_load_file c:\keybinds\curveball.txt (or stormhaven.txt, or judge.txt) might be used to bring in character-specific key bindings.

And because these files only require a few deviations from the default keybinds.txt file, only a few commands are needed in each:

curveball.txt

E "powexec_name Personal Force Field"
W "nop"
Q "powexec_name Teleport Foe"
F "nop"
T "nop"

stormhaven.txt

E "powexec_name Steamy Mist"
W "powexec_name Freezing Rain"
Q "powexec_name Hurricane"
F "powexec_name Hover"
T "nop"

judge.txt

E "powexec_name Temp Invulnerability"
W "nop"
Q "nop"
F "nop"
T "powexec_name Combat Jumping"

Each of these files only import five keybinds. Some of those keybinds are simply commands that overwrite what was originally there and replace it with nothing (nop) and others are specific powers.

If wanted, in the default keybinds.txt, Commands may be created that automatically loaded these:

NUMPAD1 "bind_load_file C:\keybinds\curveball.txt"
NUMPAD2 "bind_load_file C:\keybinds\stormhaven.txt"
NUMPAD3 "bind_load_file C:\keybinds\judge.txt"

By pressing the numbers 1, 2, and 3 on the number keypad, a custom bind set can be loaded.

Back on Course: Creating a Rotating Bind

To set up a key that rotates between the five taunts listed earlier in this section, you need to create custom keybind files for each of them. These keybind files need to contain three things:

  • the command to speak the taunt,
  • the command to activate the taunt command, and
  • the command to load the next taunt binding

The first thing you need to do is to create five keybind files: taunt1.txt, taunt2.txt, taunt3.txt, taunt4.txt, and taunt5.txt. In each taunt file, you need to put in the /bind command that gets executed. So each file would look like this:

taunt1.txt

T "local Get over here!$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt2.txt"

taunt2.txt

T "local You're next.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt3.txt"

taunt3.txt

T "local Who wants some?$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt4.txt"

taunt4.txt

T "local C'mere, ya pansy.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt5.txt"

taunt5.txt

T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"

When taunt1.txt is active, pressing T will cause the character to say "Get over here!" and activate the taunt power. At the same time, City of Heroes loads the taunt2.txt file and, since the bind command is for the same key, overwrites the T key with the new binding. So the next time T is pressed the character says "You're next." and the taunt power is launched again. This time, taunt3.txt is loaded, and that binding replaces the current one, and so forth and so on until finally taunt5.txt rebinds the key to load taunt1.txt, and the cycle starts over again.

Because the toggle bind is only loading and replacing one key binding at a time, the process takes place very quickly.

Now the only thing left to do is to actually bind T to the first toggle command. You can either do this manually or you can add it to your keybinds.txt file:

T "local Let's see what you've got.$$pow_exec_name Taunt$$bind_load_file C:\keybinds\taunt1.txt"

When you use the slash command /bind_load, then T will be bound to emulate the taunt5.txt binding, and the first taunt binding will activate the next time T is pressed.

As long as you are willing to be patient and set up your files before you get into the game, you can create rotating binds for just about everything. For example, rotating binds may be created for your mouse so that pressing a key loads one set of binds to the mouse to put it in "movement mode" and pressing it again loads another set of binds to put it in "default mode".

Macros

What do you do when you run out of keys to bind? Create icons.

By the time you've reached 40th level in City of Heroes, you will have roughly 20 powers. Some of those powers will be powers you need to activate, some won't. If every single power required activation, they would take up two full trays on your power bar.

So why are there nine trays? Why, so you can create your own icons, of course!

In City of Heroes it is possible to create your own icons on the power bar. These icons can be activated with a mouse click, or can even be bound to keys if you use the /pow_exec_tray slash command to identify which tray and which slot in that tray the icon is sitting. You do this by using the /macro command.

/Macro is very similar to /bind. You are, in effect, binding a command to an object. The main difference is that /bind uses objects that already exist (keys on your keyboard) as the trigger, whereas /macro creates the trigger and then associates the command to it. The trigger it creates is a new icon that sits on the first empty slot on your power bar.

The basic format for /macro is:

/macro macroname "command(s)"

It is possible to do anything with /macro that you can do with /bind. The only major difference is that instead of pressing a key to trigger the command, you click on the macro icon sitting in the power bar. You can also use any key bindings associated with the slot it is sitting in (for example, if it were in the second slot on the first tray of the power bar, you could press the 2 key to activate the macro) but you cannot bind a key directly to the macro itself.

People are often confused by /macro because it is so similar to /bind. Here is an example of macro creation to put the entire thing in context.

Let's say you want your character to have an emote/speech combination: You want him to perform the ThumbsUp emote and say "Good work!" But you don't want to devote a key to it—you need your keys for combat and navigation controls—but you decide it would be okay if you could just click on an icon in the power tray to perform that function.

The /bind command would be for this:

/bind [some key] "em ThumbsUp$$local Good Work!"

For /macro, [some key] is replaced by whatever name you want to give the macro:

/macro GW "em ThumbsUp$$local Good Work!"

Typing that in the command window will cause a new icon to appear in the first empty slot on the first available tray on your Power Bar with the letters "GW" stamped on it. You can now move that icon anywhere I want to on my tray, and clicking on it will cause your character to stick his thumb up in the air and say "Good Work!"

You can name your macro anything you like, but the icon has limited space to actually display the letters. You will probably want to try to keep your macros down to one- or two-letter names so they can be read clearly on the icon tray.

That is the /macro command in a nutshell. Really, that's all there is to it. /Macro seems tricky because it is almost identical /bind, and the "almost" throws people. The only difference between the two is that /macro creates the object that triggers the command, and you need to tell the game what the object is named.

Neat Things You Can Do with /Bind

This is the section that has samples of some of the fun stuff you can do with the /bind command.

Getting Around the "No Queued Attack" Rule

We have already learned that you cannot "queue up attacks" with /bind, but there is a way to get around that limitation to an extent. One of the participants in a "The Day I remapped my mouse with /bind" thread had an ingenious bind that did no less than SEVEN actions. The last two actions were to attack with two different ranged attacks.

How did he do it? By not really attacking the first attack. Instead, he just set it up so that attacking would be the immediate consequence of the command:

/bind NUMPAD0 "pow_exec_auto Dark Blast$$pow_exec_name Moonbeam"

This is just the last bit of the original bind, which is much longer. When the 0 button on the number keypad is pressed, Dark Blast is set up as an automatically fired power. That is, it will fire at an enemy is selected and within range of the attack. After Dark Blast is set to auto, Moonbeam is fired. This is what happens:

  1. Dark Blast is set up as an "autofire" power.
  2. Moonbeam is fired.
  3. Dark Blast will fire, recharge, fire, recharge, fire, recharge, etc.

With this bind, two attacks were set up, but only one is specifically fired off.

Targeting the Nearest Enemy

The tab key is nice for quickly moving from enemy target to enemy target, but how do you quickly attack the closest enemy to you? It's easy. First you tell the game to target no one at all, then you tell to to target an enemy. It will always choose the closest one to you:

/bind space "target_enemy_near"

When you press the space bar, the game will drop any target you currently have and then target the closest enemy.

Remapping Your Mouse to Control Your Movement

If you are not satisfied using your keyboard to control all your movement, you can bind navigation and movement keys to your mouse buttons to give you greater mouse control. The following examples assume you have a four button mouse:

/bind RBUTTON "+forward$$+mouse_look"
/bind LBUTTON "-mouse_look"
/bind MBUTTON "map"
/bind BUTTON4 "+up"
/bind LSHIFT+RBUTTON "+backward$$+mouse_look"
/bind LALT+RBUTTON "-mouse_look"

The first button is the basic navigation command. When you click mouse button 2, the mouse enters "mouse look" mode. The mouse pointer disappears when you move the mouse to the left or right, your character turns left or right. When you move your mouse up or down, your character looks up or down (and if flying, your character tilts up or down). Now every time you press down on mouse button 2 your character will move forward.

The second binding ends mouse look. When you actually need to use your mouse to click on something, click on mouse button 1 and your pointer will reappear.

The third mouse binding causes the zone map to pop up whenever you press mouse button 3. Mouse button 3 will probably continue to stay mapped to +camrotate, so you can still use it rotate the camera around your character. It is alternately annoying and amusing to see one happen when you are only interested in the other.

The fourth mouse binding allows mouse button 4 to control when the character jumps.

The fifth mouse binding acts just like the first, only instead of going forward the character moves backward.

The sixth mouse binding allows me to right-click on objects with my mouse when I have the left alt key pressed down in order to bring up the pop-up menu.

Selecting Teammates Using the Number Pad

This set of binds allows players to use the number pad to select their teammates and allies. For buffing or any other team selecting activity, this can be simpler than clicking with the mouse or using shift-<number>. Numbers 1-8 will select that particular team slot. The zero key contains a targeting bind to assist with buffing pets or players that are not on the team.

numberpad.txt

numpad1 teamselect 1
numpad2 teamselect 2
numpad3 teamselect 3
numpad4 teamselect 4
numpad5 teamselect 5
numpad6 teamselect 6
numpad7 teamselect 7
numpad8 teamselect 8
numpad0 target_custom_next friend notteammate notmypet

Note that the above text box is designed for a Bind File, such as c:\keybinds\numberpad.txt , which can then be loaded using the /bind_load_file command.

One could also bind them in separate commands using:

/bind numpad1 "teamselect 1"
/bind numpad2 "teamselect 2"
...

Players can then customize other number pad keys to use buffs. For instance, on characters that have Kinetics, one can use:

/bind add "powexec_name Increase Density"
/bind numpadenter "powexec_name Speed Boost"

This makes it easy to buff any single teammate or the whole team in succession.

The names of other keys on the number pad are: decimal, subtract, multiply, divide.

For a complete list of key names, see List of Key Names.

Source

The original text of this article was derived from The Incomplete and Unofficial Guide to /bind (1.1) by Curveball.