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.