ChatSubs
--------
v 2.2.2 - Dec. 13, 2009
by Travis S. Casey (efindel@gmail.com)

Purpose:
ChatSubs is meant to make the writing of macros that say and emote 
things based on your target, your focus, the character you're playing,
or your current pet easier.  With it, you can use "substitution 
strings" that ChatSubs will replace for you.

For example:

/s Hi, <target>.  I'm <name>.  Pleased to meet you.

/em makes a few quick practice strokes with <hisher> weapon, while giving <target> a meaningful look.

/s Oh, so you're a <targetclass>, <target>?

/em 's <pettype> <petname> playfully bats at a passing butterfly.


The uses aren't just listed to RP, though:

/3 <targetpvp> level <targetlevel> <targetrace> <targetclass> spotted at <position> - name is <target>

/p sheeping <target> with <targetmark> - you break it, you tank it!


Since ChatSubs hooks the "SendChatMessage" function in WoW, these 
substitutions work with all channels -- say, emote, yell, raid, party,
general, defense, guild, officer, even player-created channels.


Substitution Strings
--------------------

ChatSubs supports two styles of substitution strings:  a more verbose,
but hopefully easier to remember style, and a more compact style
suited to macros where every character counts.

Substitution strings of the first style start and end with angled 
brackets:  <>.  Inside the angled brackets are two components:  who
the string is about, and what the string should give.  That is:

<whowhat>

The who part can be:

target     - your current target
focus      - your focus
mouseover  - your mouseover target
player     - your character
pet        - your active combat pet

If the who part is left out, it defaults to "player".

The what part can be:

name       - in-game name -- "Noobkiller", "Defias Bandit", or whatever

class      - note that for mobs, their game-mechanic class may not match
             how they're described

race       - most mobs don't have a "race" assigned, but instead simply 
             have a "creature type" -- humanoid, beast, demon, etc.

type       - for pets, this is their "creature family" -- "voidwalker",
             "cat", "imp", "bear", etc.

sex        - "male", "female", or "unknown sex" for those mobs that don't
             have one

level      - will be "unknown level" for anything that is skull to you

pvp        - PVP status ("flagged" or "unflagged")

heshe      - "he", "she", or "it", depending on sex

himher     - "him", "her", or "it", depending on sex

hisher     - you see where this is going, right?

hishers    - same type of thing

mark       - raid mark that's applied to the target

health     - current health of the target, as a percentage (e.g., "70%")

position   - *your* current map position.  WoW doesn't provide functions
             to get anyone else's, so no matter what "who" you specify,
             this is always your character's position

If no "what" is given, "name" is assumed.  Thus, <targetname> and <target>
give the same output.  Note that you *can* use this with the assumed
"who" of player -- <> will give your character's name.

If the first character of "what" is lowercase, the produced string will
be lowercase; if it's uppercase, the produced string will have the first
letter capitalized.  Thus:

<heshe> will come out "he" or "she", depending on your character's sex, but

<Heshe> will come out "He" or "She".  

The rest of the characters are ignored:  <targetClass>, <TARGETCLASS>, 
and <taRGetClASs> would all give the same output.


The shorter substitution strings somewhat mimic the "%t" and "%f" that 
WoW already has:

%t 	- target
%f 	- focus
%o	- mouseover ("o" for "over", since "m" was already minion...)
%p 	- player
%m 	- pet ("m" for "minion", since "p" was already taken)

Those are equivalent to the <who> above.

The equivalents to the "what"s are:

c 	- class
l 	- level
r 	- race 
s 	- sex 
pvp 	- pvp
n 	- heshe ("n" for "nominative pronoun")
o 	- himher (objective pronoun)
p 	- hisher (possessive pronoun)
p2 	- hishers 
h 	- health
m 	- mark
t 	- type

So, for example:

%tc - target's class
%fo - focus' objective pronoun (him/her/it)
%tpvp - target's PVP status
%ph - your current health, as a percentage of maximum

Lastly,

%pos - your current position

(Actually, you *can* do %tos or %fos, but since WoW only allows you to
get your own position, they all give the same thing.)

For any of these, capitalizing the letters following the %t, %p, or %f 
will capitalize the string produced.  So, if your target is a warrior:

%tc - gives "warrior"
%tC - gives "Warrior"

Notes:

WoW limits chat strings to 255 characters.  Since ChatSubs expands the 
string before sending it, the expanded string is the limited one.  If the
string expands to more than 255 characters, WoW will cut off everything
past 255.