Displaying a Player’s Latest World of Warcraft Achievements in VB.Net and C#

Setup

To fetch the achievement data of the World of Warcraft character we are going to make use of armoryapi, the armoryapi library currently requires that the project’s target framework be 3.5 or higher so set your project up to use 3.5 or higher in the project properties.

After creating your project and setting up the target framework the next step is to add the reference to the armoryapi library. Download and extract the latest armoryapi package and you will find a DLL and an XML file inside, make note of where you have extracted these files and head back to Visual Studio. Open the “Add Reference” dialog (see http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx) and click the tab labelled “Browse” and navigate to the armoryapi DLL that you extracted.

Note: in order for the intellisense documentation to work you must also extract the XML file to the same directory as the DLL

Code

Now that your project is setup let’s get started with some code, first thing’s first let’s create a very simple form that we can use to fetch and display the data. Create a form and add the following controls:

characterNameTextBox – TextBox
realmTextBox – TextBox
achievementList – ListBox
fetchButton – Button

You should now have something similar to this (I have added a few labels and a groupbox, but you obviously don’t have to do this to get started):

The main form

Now that we have our GUI sorted double click on fetchButton to create the click event handler for the button. Once you are in the code view we need to add an import to the ArmoryAPI namespace, to do this add the following line at the top of the file:

VB.Net

Imports ArmoryAPI

C#

using ArmoryAPI;

Once you’ve added the namespace import go back to the event handler for the button click and add the following code:

VB.Net

Dim armory As Armory = New Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB)
Dim character As Character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text)

For Each a As UnlockedAchievement In character.Achievements
    If (DateTime.Now.AddDays(-14) < a.Unlocked) Then
        achievementList.Items.Add(String.Format("{0} ({1} points)", a.Title, a.Points))
    End If
Next

C#

Armory armory = new Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB);
Character character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text);

foreach (UnlockedAchievement a in character.Achievements)
{
    if (DateTime.Now.AddDays(-14) < a.Unlocked)
    {
        achievementList.Items.Add(String.Format("{0} ({1} points)", a.Title, a.Points));
    }
}

If you debug the project now you will be able to fetch the achievements the character entered has unlocked within the last two weeks as can be seen below.

Main screen with achievement data

This code queries the European servers and returns the data in English, if you need a different configuration simply change the line that creates the Armory object, the following regions and locales are supported:

Regions

  • America
  • China
  • Europe
  • Korea
  • Taiwan

Locales

  • de_DE
  • en_GB
  • en_US
  • es_ES
  • es_MX
  • fr_FR
  • ko_KR
  • ru_RU
  • zh_CN
  • zh_TW

Extra Steps

In order to improve upon this project, you can utiilise the caching functionality of armoryapi, to do this you’ll have to setup a database (see http://code.google.com/p/armoryapi/wiki/GettingStarted#Setting_up_a_Database) and simply pass the connection string to the Armory object and the time in minutes that the data should be cached for as shown in the example below.

armory.ConnectionString = "Data Source=(local)\SQLEXPRESS;Initial Catalog=armoryapi;User ID=username;Password=password"
armory.RefreshInterval = 120
Posted in Gaming, Programming, Technology, Tutorials at October 8th, 2011. 2 Comments.

Modded NES Controller

As an avid gamer I like to revisit some of the classics that I used to play as a kid, most notably Super Mario Bros. As I sold the system back in 1995 to get a SNES my only option is to play my old games on my PC, but playing Super Mario Bros just isn’t the same when you haven’t got a square brick for a controller that is giving you cramp in your hands! This ended up leading to me thinking – why not just convert an old controller to work via USB? And so I have. See below some pictures and a little demonstration video of the controller in use :)

Posted in Gaming, Hacking, Hardware, Software, Technology at April 15th, 2011. 2 Comments.

Minecraft Server Backup Script

As I mentioned in my previous post, I have started hosting a dedicated Minecraft server and I have created a script that will backup all the world data every night so that should any of the files get damaged at all we can easily restore to a given date.

For anyone else who needs this sort of solution you can find the script below, make sure to change the MC_PATH and BACKUP_PATH variables to the location of your server and the folder you want the backups to be stored to.

Note: this will create the following folder structure in the backups folder: Year/Month/Day


#!/bin/sh

MC_PATH="$HOME/minecraft"
BACKUP_PATH="$HOME/minecraft_backups"
NEW_FOLDER=`date +%Y/%m/%d`

echo "Creating backup directory..."
mkdir -p $BACKUP_PATH/$NEW_FOLDER

echo "Starting backup..."
cp -R $MC_PATH/world $BACKUP_PATH/$NEW_FOLDER

 

echo "Successfully backed up to: $BACKUP_PATH/$NEW_FOLDER"

Posted in Gaming, Programming, Software, Technology at April 11th, 2011. 3 Comments.

Mario & Yoshi Minecraft Statues

A friend of mine has been running a Minecraft server for a while from his house but as it is a bit of an inconvenience for people to not be able to play when he decides to shut down I have migrated it to a dedicated server. Along the way I decided to pick up a copy of Minecraft and give it a try myself and I can’t stop playing it now! After seeing someone building a Megaman statue on our server I decided to throw up a Mario and Yoshi statue to accompany it. Click on the thumbnail to view the full size image.

If you’re interested in joining us contact me for the details.

 

Posted in Gaming, Software, Technology at April 10th, 2011. No Comments.

Kickup Goes Live on App Store

I finally managed to get my first iOS game on to the App Store two days ago and it has took off much better than I had originally anticipated. Within the first 48 hours it has had a total of 64 purchases and some quite good feedback. The game is compatible with all of the iOS product family so if you have an iPod Touch, an iPhone or an iPad go check it out at: http://itunes.apple.com/gb/app/kickup/id397618387?mt=8

Version 1.1 is currently in the hands of the Apple review team at the moment, which makes a small change to how the game ends. As it stands at the moment you have to restart the application to begin a new game, once version 1.1 is approved and made available you will be able to start a new game from within the application itself to avoid restarting.

I’d also like to point out to iPad users that this game is not just an iPhone game that will scale to the resolution of your iPad, it comes with a complete set of high definition graphics especially for the iPad so it will look just as good (if not better) than the low resolution versions.

Posted in Gaming, Software, Technology at October 20th, 2010. No Comments.

Final Fantasy XIII: How to Beat Odin

This is actually a really simple encounter, but it seems many people are struggling with it.

At the start of the fight switch your paradigm to Medic – Medic and continue to heal, typically he targets only one person and sticks on that target; if he is targeting Hope then be sure to start casting your heals before he attacks as Hope will take big damage.

Once Odin uses his shield ability (it will indicate he is using a shield in text above his head, and he will be standing still not attacking) switch the paradigm to Commando – Ravager and spam your auto-attack.

Keep repeating these steps and you should beat the doom timer in no time!

I did this and finished with a five star rating and didn’t come close to dying once.

Posted in Gaming at March 10th, 2010. 17 Comments.

The World's Shortest Vacation

I am back sooner than expected from my vacation in Nevada, Manchester airport considered the weather conditions too dangerous for my plane to land which led to the cancellation of my flight, unfortunately nothing could be rescheduled within reasonable time so here I am still in Manchester!

On the bright side I just picked up some new games for the Xbox 360:

  • Assassin’s Creed 2
  • Call of Duty: Modern Warfare 2
  • Forza Motorsport 3
  • Monkey Island: SE

I really can’t get over the Super Mario reference made by Ezio’s uncle Mario (in Assassin’s Creed 2) when he introduces himself with the line “it’s a me – Mario!”, that truly invoked a nostalgic moment.

Posted in Gaming, General at December 25th, 2009. No Comments.

How to Fix Steam Overlay in Aion

If you purchased Aion via Steam and are running either Vista or Windows 7 you have probably realised that the Steam overlay is not working, there is a really simple fix though, put a shortcut to Steam on your desktop, then go to the properties of it and under the Compatability tab choose to run it in compatibility mode for Windows XP Service Pack 3 and choose to run as administrator, and voila the overlay will now appear in game and your hours will be recorded to your Steam profile!

Aion

Posted in Gaming at November 21st, 2009. No Comments.

Gutrot Hits 80!

In case you are not aware of who Gutrot is he is the infamous troll warrior who levelled all the way to 80 (as of 26/09/2009) without any gear, last night on the Aerie Peak server hundreds of people rolled new troll characters, removed the gear they are given when created and ran to the brewfest area in Durotar awaiting for Gutrot to arrive and finally hit level 80, at which point an unbelievable amount of spam started (as you will see in the video), in all the time I have played World of Warcraft I have never seen anything like it!

After he hit 80 and the spam started to cool down everyone charged towards the Zeppelin and headed to Stranglethorn Vale and proceeded up to Stormwind, it is the first time I have ever seen hundreds of naked trolls try to raid Stormwind…

As you can imagine they didn’t get very far as a large amount of alliance just camped the entrance and killed all the lowbies as they came through. Check out the compilation video below of some of last night’s footage :)

Posted in Gaming at September 27th, 2009. No Comments.