Tuesday, June 18, 2019

The Homecoming of HeroStats

It has been a long time! With the recent rise of various City of Heroes servers available to the public, I've had many requests to update HeroStats. And so I have, though for the moment it's only working for the Homecoming servers (which is where I've been playing). It can be downloaded from the SourceForge project page, since the main HeroStats website has long since lapsed and I have no immediate plans to resurrect it.

Monday, November 8, 2010

Website Updates Phase-Out

Recently the folks over at The Titan Network announced a new tracking client, Titan Sentinel. It is my intent to allow this client to replace the Titan Network website update functionality in HeroStats. I won't be actually removing anything right away, but I also don't intend to provide any new features or bug fixes around website updates. Eventually I'll probably remove those features entirely from the core HeroStats builds.

Why do this? The intent of HeroStats was always to track statistics and provide some in-game information (such as the power timers). Website updates are really outside of the core functionality of HeroStats, and it makes more sense to allow the owners of the websites to handle this.

Some of you are undoubtably wondering "what about Badge-Hunter"? For now I won't be removing the ability to update Badge-Hunter. I hope that eventually they also will have their own application, but for now HeroStats is the only update method, so I won't be taking that away.

I haven't yet decided if I'll also remove the Twitter functionality. It's also a website update of sorts, but it's a different animal than the tracker sites. For now, Twitter updates will remain intact.

Sunday, April 25, 2010

Twitter Integration - Badges and Customization

As previously posted on this blog, HeroStats contains some basic Twitter integration features. Since that posting, some new features have been added. Most notably, you can choose to tweet when your character earns a badge. This is present in HeroStats 4.9.1.7 and above (including the upcoming 5.x stable builds).

You'll first need to set up Twitter integration as described in the previous blog post. You'll notice that the configuration screen looks a bit different than the screenshots in that post, though.


If you un-check the first checkbox, HeroStats won't send a tweet when you complete the Twitter setup. This is handy if you're setting this up more than once, and don't want to spam a bunch of setup tweets.

The second checkbox is for level-up tweets. In addition to the ability to turn it on or off completely with the checkbox, you can now choose a lower limit on the levels to tweet about. The default configuration is 10, so HeroStats won't tweet when your characters reach levels 2-9, but will tweet for every level 10 or higher. This helps to minimize the Twitter spam since those lowbie levels often go by very quickly.

The third checkbox is the new badge tweet functionality. It's turned off by default. If you check this box, then HeroStats will tweet when you earn a new badge. However, it will only check for new badges as often as the number of seconds listed (300 by default). This is again a measure to prevent large numbers of tweets. Completing a task force, picking up zone explore badges, or even just creating a new character often results in obtaining several badges all at once. Rather than posting a separate tweet for each one, HeroStats will tweet just once every five minutes, with a summary something like this:

Flame of Ebony (50 Magic Blaster on Victory) just earned City Official and 1 other badge in City of Heroes! #coh

The first badge you earned will be named, and then a count of how many other badges you've gotten since the last tweet.

Here's a sample of how my configuration looks once I've done the Twitter setup:


Finally, it is possible to customize the text of your tweets. I haven't yet provided a user interface for this, but it is possible as long as you aren't scared by a little XML. Make sure you've completed the Twitter setup steps, then shut down HeroStats. Go to your HeroStats directory and open the file called "HeroStatsConfig.xml" in a text editor. (This is probably not the default program - that's usually Internet Explorer - so you can't just double-click it.)

Inside that file you'll find two lines that look like this:

<twitterlevelupmsg>$name ($origin $archetype on $server) just reached level $level in $game! #coh</twitterlevelupmsg>

<twitterbadgemsg>$name ($origin $archetype on $server) just earned $badges in $game! #coh</twitterbadgemsg>

The level-up message is the bit between <twitterlevelupmsg> and </twitterlevelupmsg>, and the badge message is the bit between <twitterbadgemsg> and </twitterbadgemsg>.

There are several variables in these messages that you can use:

$level: This is the current level of your character. Note that the level-up tweet happens after you gain a level, so in that case this is your new level.

$name, $origin and $archetype: These work just like in the game client, showing the current character's name/origin/archetype.

$server: The server that your character is on.

$game: Either "City of Heroes" or "City of Villains" based on your character's archetype. (I'm not sure yet how I'm going to deal with this after Going Rogue allows switching sides...we'll see.)

$badges: The badges you've earned since the last badge tweet. This won't include every badge name, but rather the first badge you earned in that time plus a count of additional badges. Examples: "Whitecap" (for just one badge) or "Whitecap and 1 other badge" (for 2 badges) or "Whitecap and 2 other badges" (for 3 badges).

You can modify this however you like, but keep in mind the Twitter 140 character limit! If your message exceeds that after replacing the $ variables, then your tweet will fail. This will be reported in the HSLogFile if your debug level is set high enough. Once you're done modifying the message, save the file and start up HeroStats - your next tweet should use the new message!

Saturday, February 20, 2010

Twitter Integration

As of version 4.8.0.0, HeroStats has a new feature - integration with Twitter feeds. This was added at the request of a user on the Sourceforge.net feature request list, but even before that I'd been considering it.

As of this writing the implementation is pretty basic. Do View->Global Options to open up the options window. There's a new tab labeled Twitter.


Go there and click the Set up Twitter button. Your web browser should open to a Twitter page asking you to verify that you'd like to let HeroStats connect to your Twitter account. (You may need to log into Twitter if you weren't already.)


Complete the process here by logging in (if necessary) and pressing the Allow button. You'll be redirected to the HeroStats website which directs you to return to the HeroStats application, where you'll see a popup window:


Press OK here. Your Twitter configuration screen should now look like this:


At this point, HeroStats has sent an initial tweet to your account as well:



From now on, whenever one of your characters levels up and HeroStats is running, you'll see a tweet posted:


That's all that it does currently, but I've got some future plans for more Twitter integration features. For example:
  • Give users the option of which activities to tweet, such as level-up, earning badges, login/logout, etc.
  • Allow users to customize the level-up tweet sent, using things like character name, origin, new level, server, etc.
  • Provide limits on the types of tweets sent - for example, no tweet for any level-up under 10.
Anything I implement will of course show up in the Unstable builds first, so keep an eye out for new versions there.

Saturday, November 1, 2008

Badge Tracking HOWTO

I've seen a few requests in-game lately for a better explanation of how to do badge tracking with HeroStats. I've just recently released a new HeroStats version (4.2.3.0) that contains several fixes to the badge tracking functionality, so it seemed like a good time to provide some instruction.

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: line. If you don't see that, then HeroStats isn't detecting your badges. Try the suggestions documented in the Known Issues on HeroStats.org for this situation.

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
"Sent to CIT successfully" or "Sent to BH successfully". If you count up all instances of those phrases, you can see exactly how many badges were sent to each site. (If you find some missing, you might also have to look in an older HSLogFile, as a new file is started once it reaches 1 MB in size. The timestamps on each message can tell you when each logged message was written.)

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!

Friday, May 16, 2008

Scanner changes for Issue 12

As I mentioned in my previous post, Issue 12 has changed the way things work in the chat message system. This has necessitated some fairly major changes in the HeroStats scanner as of version 4.1.0.6.

For HeroStats Users

If you're a HeroStats user, you'll notice the changes in your hero configuration options. The Channels and Globals tabs are gone - you can no longer choose which channels you'd like HeroStats to scan. Taking their place is a Scanner tab. There are two options here.

First, there is a checkbox which allows you to choose whether HeroStats should ignore any chat tabs that display only "chat-type" messages, which are messages that don't contain any statistics information. Typically this means things from your global chat channels, local chat, etc.

Second, you can enter the name of a tab that you would like HeroStats to scan while ignoring all others. This is very handy to increase performance. The name of this is "HSData" by default, although you can change it to whatever you like. If the name given here doesn't exist, HeroStats will fall back to the default behavior of scanning all tabs. The image below shows a sample setup of the HSData tab for best performance (this is on Test, but a Live setup would be the same minus the new Pet and Hit Rolls channels).


For Developers

If you're a developer who has used the HeroStats scanner in your own program, you'll need to make a few changes with versions 4.1.0.6 and above. The first thing you'll likely notice is that the CohScanner class no longer has properties to set which channels to scan. If you were using those, you'll need to remove that code.

There are some new properties on the CohScanner class, too. The boolean IgnoreChatTypeMessages property and the string HSDataTabName property implement the two hero configuration options described above. Both of these are static properties, so you'll need to set them on the CohScanner class (rather than an instance). You can update these while the scanner is running if you like, it'll recognize the changes.

If you'd like some more control over what chat tabs are being scanned, you can access the list of available tabs using the AvailableTabs property. This one's not static, so access it through your CohScanner instance. AvailableTabs is a List of ChatTab objects, each of which represents one of the user's chat tabs. You can get the tab name from the Name property, and the number of messages on the tab from the MessageCount property. You can also set whether a tab should be scanned with the IsScannable property; if true, the scanner will ignore this tab (unless it's the one specified in HSDataTabName).

Internally, the old ChatChannel class in the scanner has been greatly reduced. Most of its functionality is now in the new ChatTab class. The old channel types still exist, but they're really used only for looking at which channels should be on each tab. There is also a new property on the MemlocFinder class called IsLiveCode, which is used throughout the scanner to drive logic that's different between Live and Test servers.

Wednesday, May 14, 2008

Issue 12 beta changes

So Issue 12 is in open beta now, and there's a ton of changes. Lots of quality-of-life improvements, many of which relate to chat messages. Unfortunately, those changes mean much of what HeroStats does has to be changed in order to work with I12.

By far the biggest change is how message channel is identified. Pre-I12, the channel type was hardcoded to a particular value, and each message was tagged with the appropriate channel type value. Now that's no longer the case. Messages are instead stored in the client memory with pseudo-HTML tags that set the message color and other attributes. This is great for the game client - it enables the linking you see in I12, and the ability to change the color of each channel on your tabs. But it's not so good for HeroStats, because there's now no good way to take a message and figure out which channel it came from. Those pseudo-HTML tags don't help, because they can be changed by the user at will.

So, we're going back to an approach that I tried once before - scanning each tab of the chat message window, rather than looking for individual channels. This can potentially give us better performance, but does require that the users have their chat tabs set up in certain ways. I'm working on a way to make this transparent to the user, or at the very least use the new I12 feature to load tab settings from a file to make it easy to set up.

This also means that we no longer know which channel a particular message belongs to. Previously the channel was used to 1) let people choose which channels that HeroStats would log and 2) filter out messages on channels that never contained any information needed for stats gathering. Both of those features will no longer be available with the new system.

I haven't had as much time as I'd like to work on this, so the new scanning system isn't completely ready for prime time just yet. I'm hoping to have it finished before Memorial Day, hopefully prior to I12 actually going live.