Step 1 - Register with a Badge Site
HeroStats has support for two City of Heroes/Villains badge sites: Badge Hunter and City Info Tracker (part of the Titan Network). Go to one (or both) of those links and register for an account. Note the username and password for the site(s), you'll need those later.
Step 2 - Download and Install HeroStats
You can find instructions on getting the latest version of HeroStats from HeroStats.org. I highly recommend keeping your HeroStats version up to date to get the latest bug fixes and new features.
Step 3 - Configure HeroStats
Start up HeroStats and go to the Global Options (View->Global Options), then click on the Web Sites tab. You'll see a screen something like this:
Your screen may not have all the fields shown in the screenshot, if you have either "Use City Info Tracker" or "Use Badge Hunter" unchecked. Select one or both of those, depending on which badge tracking site(s) you've chosen. Then for each site, enter the username and password. You can also set the refresh interval for each site, but I recommend leaving it at the default of 60 seconds, which provides fairly frequent updates without excessive network traffic.
By default, updates are not sent when you use the Test server. You can choose to allow this by unchecking the "Block Test Server Updates" option, but be aware that updates may not be shown correctly depending on exactly what code is on the Test server at any given point in time.
If you're using an unstable build of HeroStats, you'll also see the option to use Unstable Web Services, which simply means the latest version if we're making any changes to the connectivity to the web sites. You won't even see the option if using a stable build.
Step 4 - Ensure HeroStats sees your Badges In-Game
Start up both HeroStats and City of Heroes/Villains, and log in a character. Open your Badges menu and select a badge as your character's title. Then take a look at the HeroStats window. You should see something like this:
Note the Badge Earned:
Once this is working, HeroStats will automatically detect any badges you earn while it is running, and send them to the badge tracking site(s) you have selected.
(Optional) Step 5 - Verify your Existing Badges using Settitle Binds
Both of the badge tracking sites provide bind files that can be used to verify the badges your character has already earned. This is also useful if you earned some badges while HeroStats wasn't running, and want to send them to the site. Current links to the bind files (these may change, if the links don't work then go to the badge tracking site and look around for a new version):
CIT of the Titan Network settitle bind files
Badge Hunter settitle bind files
Those links include instructions on how to use the bind files. Please note that it is important to go through the binds slowly! I typically pause a second in between each press of the key that loads the next bind file, to allow HeroStats to catch up.
If you find that badges aren't being detected by HeroStats while using the bind files, you may need to make use of the "Number of chat messages to maintain as history while scanning" option. This is shown in the Hero Options on the Options tab. Setting this to a higher number (8-10 is about the highest you should need) will help HeroStats to detect rapidly changing messages, such as those from the bind files. This will slow down the HeroStats performance, though, so remember to change it back to a lower number (I usually have mine set to 3) for your normal play sessions.
If it looks like HeroStats does see the badges, but you still don't see them on the site(s), you can use the HSLogFile to check if the badges have been sent. The HSLogFile lives in your HeroStats directory and is a plain text file. You first need to make sure that the Debug Level is set to Info (you can find this in the Global Options). Then run through the binds as described above. Once finished, open up HSLogFile and check for instances of the phrase
Conclusion
I hope all this information helps people to use the badge tracking features of HeroStats more easily. This takes a lot of the tedium out of badge tracking, and both badge tracking sites have plenty of features to make badging more fun. Try it out!