Geek Noise
Rants, rambles, news and notes by Peter Provost
18

Wrath of the Lich King Theme for Windows Mobile 5 and 6

Thursday, 18 September 2008 07:33 by Peter Provost

Last night I finally got around to upgrading my Blackjack to Windows Mobile 6.0. I’d been delaying because they didn’t have an updater that ran on Vista and I don’t have an XP machine available. Once the Vista updater arrived, I put it on the backlog.

I had an old WoW theme for my Blackjack but I decided it was time to make a new one. Here’s a photo of it running on my phone:

LichKing_Theme

If you’d like to download it, here’s the ZIP file: LichKing_SmartPhoneTheme.zip (26KB)

Currently rated 3.0 by 2 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
03

World of Warcraft Addon Updater in PowerShell

Saturday, 3 March 2007 15:48 by Peter Provost

UPDATE: I am now maintaining this script over on my Warcraft Wiki site on pbwiki. Please go there for documentation and the most recent updates.

I couldn't resist. Sometimes I don't even know why I do these things. Last night I decided to start playing with System.Net.WebClient from Windows PowerShell and four hours later I had something close. A few more hours today and now I have a PowerShell script that:

  • Updates Subversion working copies (can be disabled w/ a switch)
  • Can be configured to check for updates from wowinterface.com using a simple data file in your addons folder called addons.ps1 (see the comment header below for a sample of this file) and a nice XML endpoint provided by the guys at wowi (thanks Dolby!)
  • Will check to see if an addon is one of the WowAce family of addons and will try to update it from their using their RSS feed for information.

I know I can add more addon sites to this later, but now that Auctioneer is up on wowi (ID: 4812) I don't know if I have any addons that I use that can't be updated by this script. Perhaps one or two, but that isn't bad given that I have 169 addons in my Addons directory.

This script has a few dependencies for extracting ZIP and RAR files. You will need to get unzip.exe from Info-ZIP and UnRar.exe from RARLabs and put them both on your path. Both are free.

Anyway, here is the script. There is a download at the bottom of this post for those of you who just want to have it.

DISCLAIMER: This script is supplied without warranty or support. If you play WoW and don't know anything about PowerShell, this might be a bit much for you. Take a look at WowAceUpdater or WUU instead.

  1 #########################################################################
  2 # Name: update-addons.ps1
  3 # Version: 1.0
  4 # Author: Peter Provost <peter@provost.org>
  5 #
  6 # Usage: update-addons [-skipSvn]
  7 #
  8 # Remarks: This is a simple powershell script for updating your
  9 #   World of Warcraft addons. It will autodetect SVN working copies
 10 #   and update them. It will look for a file called addons.ps1
 11 #   in your Addons folder to define special locations for downloading
 12 #   addons (see below for a sample addons.ps1). After that it will test
 13 #   if the addon can be updated from http://files.wowace.com. Any addon
 14 #   still unmatched will be skipped.
 15 #
 16 #   This sample addons.ps1 hows how to configure updates from 
 17 #   wowinterface.com:
 18 #
 19 #   $wowiAddons = @{
 20 #     'FlightMap' = 3897;
 21 #     'Clique' = 5108;
 22 #   };
 23 #
 24 #   At this point only wowinterface.com is supported in this data file
 25 #   but more may be added later.
 26 #
 27 #########################################################################
 28 
 29 param (
 30     [switch] $skipSvn
 31 );
 32 
 33 # Configuration - change these as needed
 34 $wowAddonDir = "C:\World of Warcraft\Interface\Addons";
 35 $stateFile = "PSUpdateAddons.state";
 36 
 37 function update-addon($addonSource, $downloadUrl, $remoteVersion, $fileName)
 38 {
 39     if ( $remoteVersion -ne $localVer) {
 40       write-host "$_ : ($addonSource) Update required: Current ver=$localVer, Remote ver=$remoteVersion";
 41 
 42       $tempFilePath = join-path $tempDir $fileName;
 43       downloadextract-addon $downloadUrl $tempFilePath;
 44 
 45       write-host "`tUpdating state file..." -noNewLine;
 46       $remoteVersion > $stateFilePath;
 47       "done." | write-host;
 48     } else {
 49       write-host "$_ : ($addonSource) Addon up-to-date. Skipping.";
 50     }
 51 }
 52 
 53 # Helper function for updating a single addon]
 54 function downloadextract-addon ([string] $uri, [string] $tempFile)
 55 {
 56   write-host "`tDownloading $uri to $($tempFile)..." -noNewLine;
 57   $wc.DownloadFile( $uri, $tempFile );
 58   write-host "done.";
 59 
 60   $ext = [System.IO.Path]::GetExtension($tempFile);
 61   switch ($ext) {
 62     ".rar" {
 63       write-host "`tExtracting RAR Archive..." -noNewLine;
 64       & unrar x -o+ $tempFile $wowAddonDir;
 65     }
 66     ".zip" {
 67       write-host "`tExtracting ZIP Archive..." -noNewLine;
 68       & unzip -o $tempFile -d $wowAddonDir;
 69     }
 70     default { write-host "UNKNOWN EXTENSION TYPE!" }
 71   }
 72   write-host "done.";
 73 
 74   write-host "`tDeleting zip file..." -noNewLine;
 75   remove-item $tempFile;
 76   write-host "done.";
 77 }
 78 
 79 function test-wowaceaddon( [string] $addonName )
 80 {
 81   return ((get-wowaceaddon $addonName)-ne $null)
 82 }
 83 
 84 function get-wowaceaddon( [string] $addonName )
 85 {
 86   $xpath = ("//item[title='ADDON']" -replace 'ADDON', $_.Name);
 87   return $indexXmlDoc.SelectSingleNode($xpath);
 88 }
 89 
 90 # Setup a few things before we get started
 91 $wc = new-object System.Net.WebClient;
 92 $tempDir = join-path (get-content env:\temp) "PsWowUpdater";
 93 if (-not (test-path $tempDir)) { new-item -type directory -path $tempDir; }
 94 
 95 # Load in the WowAce Index file
 96 write-host "Downloading latest.xml from http://files.wowace.com";
 97 $uri = "http://files.wowace.com/latest.xml";
 98 $rssData = $wc.DownloadString($uri);
 99 $indexXmlDoc = [xml] $rssData;
100 
101 # Load in the WOWI config database
102 . (join-path $wowAddonDir "addons.ps1")
103 
104 (get-childitem $wowAddonDir | ? { $_.PSIsContainer }) | % {
105 ## SVN UPDATE
106   if (join-path $_.Fullname ".svn" | test-path ) {
107     if ($skipSvn.isPresent) {
108       write-host "$_ : Skipping SVN working copy";
109     } else {
110       write-host "$_ : Updating SVN working copy";
111       svn up -q $_.Fullname;
112     }
113   }
114 
115 ## WOWINTERFACE.COM
116   elseif ($wowiAddons.Contains($_.Name)) {
117     $stateFilePath = join-path $_.Fullname "PSUpdateAddons.state";
118     $localVer = "";
119     if (test-path $stateFilePath) { $localVer = (get-content $stateFilePath); }
120 
121     $uri = ("http://www.wowinterface.com/patcherXXXX.xml" -replace "XXXX", $wowiAddons[$_.Name]);
122     $wowiXml = [xml] $wc.DownloadString($uri);
123 
124     $downloadUrl = $wowiXml.UpdateUI.Current.UIFileURL;
125     $remoteVersion = $wowiXml.UpdateUI.Current.UIVersion;
126     $fileName = $wowiXml.UpdateUI.Current.UIFile;
127     $addonSource = "WowInterface.com";
128 
129     update-addon $addonSource $downloadUrl $remoteVersion $fileName
130   }
131 
132 ## WOWACE FILES
133   elseif (test-wowaceaddon $_.Name) {
134     $stateFilePath = join-path $_.Fullname "PSUpdateAddons.state";
135     $localVer = "";
136     if (test-path $stateFilePath) { $localVer = (get-content $stateFilePath); }
137 
138     $elt = get-wowaceaddon $_.Name;
139 
140     $downloadUrl = $elt.enclosure.url;
141     $remoteVersion = $elt.version;
142     $fileName = $downloadUrl.Substring($downloadUrl.LastIndexOf("/")+1);
143     $addonSource = "WowAce.com";
144 
145     update-addon $addonSource $downloadUrl $remoteVersion $fileName
146   }
147 
148 ## Unknown addon source
149   else {
150     write-host "$_ : Can't figure this one out. Skipping.";
151   }
152 }

Download update-addons.zip (2KB). And here is my addons.ps1 data file to update my wowi addons. Create a file like that in your Addons folder and the script will find it.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
26

Hack: How to find the name of a WoW Frame

Monday, 26 February 2007 02:49 by Peter Provost

Have you ever suddenly gone into World of Warcraft and found yourself wondering, "what the hell is that button?" It happened to me a while back after a patch day update and I couldn't figure out which addon had put it there. It really started pissing me off.

I jumped over to the #wowace IRC channel on Freenode.net and asked if anyone had any ideas. They didn't, but they did have a cool trick for figuring out the Frame's name. Assuming you have any one of the Ace addons installed on your system, you can just use this slash command in game:

/print GetMouseFocus():GetName()

That will tell you the name of the frame which might help you figure out what addon created it. (It sure helped me.)

Enjoy!

Currently rated 5.0 by 11 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
27

Yet Another PowerShell + WoW Hack

Saturday, 27 January 2007 11:37 by Peter Provost

Today I was cleaning out my World of Warcraft SavedVariables folder, which is where WoW addons keep state between sessions. Over time I have installed and uninstalled a number of addons and figured I should clean up a bit.

First I decided to hunt down all files that were for an addon I don't have any more:

function strip-extension ([string] $filename) 
{
[system.io.path]::getfilenamewithoutextension($filename)
} 
$addonsDir = 'C:\World of Warcraft\Interface\Addons' 
$savedVars = 'C:\World of Warcraft\WTF\Account\<MyAccountName>\
SavedVariables' 
ls $savedVars\*.lua | ? { (test-path (join-path -path $addonsDir 
-childPath (strip-extension($_.Name)))) -eq $false } | rm

Then I realized that I had forgotten to delete the .bak files that may have been created by upgrades, so I created this little command clean those up:

ls *.bak | ? { (test-path (strip-extension $_.Name)) -eq $false } | rm 

Have I mentioned how much I love PowerShell?

(Note: I artificially wrapped some of those lines to make them show up nicely in the blog.)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
07

Nine Months of WoW UI Modding

Thursday, 7 September 2006 15:22 by Peter Provost

A little over nine months ago, much to the dismay of my wife, my addiction to World of Warcraft began. At first it was just another game to play in my spare time, but I quickly fell in love with the teaming aspects of playing in an online world with dozens of my friends and thousands of other people.

Shortly after that I discovered that the WoW client isn’t just a game shell, but is a fully customizable smart client environment. I started downloading mods from sites like WorldOfWar.net and WoWInterface.com. I started out simply with a set of addons called CTMod and slowly progressed into more and more addons.

Feb 08, 2006:
Mar 31, 2006:
Apr 01, 2006:

After that I discovered how amazingly configurable the environment can be when I discovered a set of addons called Discord Mods. DiscordFrameMover let me move, hide or resize any visual element on the screen. DiscordUnitFrames let me create very rich frames of information about my players, my targets and the members of my group. DiscordActionBars let me create button bars that change as the environment changed around me. This was amazing stuff.

Apr 04, 2006:
Apr 06, 2006:
Apr 16, 2006:

Then I decided I was ready to see how these addon things really worked. I started exploring the Lua language, the WoW API and the XML-based widget language. I started working on my first Addon: a simple reminder to tell me when my rogue’s poisons expired. What I found was that writing well designed modular code was frighteningly hard using the out-of-the box tools and API. Frustrated, I started looking around for alternatives and finally stumbled on the Ace libraries.

Using these libraries I was able to recreate my poison addon with a dozen or so lines of code and I didn’t come away feeling dirty from all the spaghetti in my Lua files. I felt like my code was nice and modular. The object-oriented nature of the Ace approach felt good.

As I explored Ace I learned that these folks had spent a LOT of time thinking about performance and memory consumption in their addons and had rewritten a number of important addons using their framework and thereby consuming a lot less resources. Another thing I liked that aligned well with my philosophically was the Ace attitude about using more small single minded addons instead of a few large monolithic addons. I immediately started systematically trying to replace all of my non-Ace addons with Ace replacements.

I also continued to expand my Rogue poison addon eventually turning it into a full blown ItemBuff management addon for all classes called FuBar_PoisonFu. When I finished that I realized that even though Ace is easier than stock WoW, there wasn’t really enough tutorial information to help people get started, so I wrote WelcomeHome - Your first Ace2 Addon over on the Ace wiki. I’m also working on two or three other addons that I will be publishing to WoWInterface.com via my authors portal.

Aug 21, 2006:
Aug 29, 2006:
Sept 06, 2006:
Sept 07, 2006:
Free Image Hosting at www.ImageShack.us

This is where I am today. That last screenshot has changes I made to the Unit Frames today. I still use DiscordUnitFrames and DiscordActionBars, but most of my other mods are Ace addons. My framerates are up, my memory consumption is down and I’m having as much fun being an addon author as I am playing the game.

Since I know people will ask, here is my Addons list at this point:

!!Warmup
!BugGrabber
!Layout
Ace
ag_UnitFrames
ArcHUD2
Atlas
Auctioneer
AuldLangSyne
BeanCounter
BonusScanner
BugSack
CT_MailMod
CT_MapMod
DamageMeters
Detox
DiscordActionBars
DiscordActionBarsOptions
DiscordLibrary
DiscordUnitFrames
DiscordUnitFramesOptions
Enchantrix
EnhTooltip
FinderReminder
FishingBuddy
FlightMap
ForAllIndentsAndPurposes
FuBar
FuBar-compat-1.2
FuBar_AmmoFu
FuBar_BagFu
FuBar_ClockFu
FuBar_CorkFu
FuBar_DamageMetersFu
FuBar_DPS
FuBar_DurabilityFu
Fubar_EmoteFu
FuBar_ExperienceFu
FuBar_FriendsFu
FuBar_FuXPFu
FuBar_GreedBeacon
FuBar_GroupFu
FuBar_GuildFu
FuBar_KungFu
FuBar_LocationFu
FuBar_MailFu
FuBar_MoneyFu
FuBar_PerformanceFu
FuBar_PoisonFu
FuBar_QuestsFu
FuBar_Speed
FuBar_SummonFu
FuBar_tcgTradeskills
FuBar_TopScoreFu
FuBar_Transporter
FuBar_VolumeFu
FuTextures
idChat2
idChat2_Buttons
idChat2_ChannelNames
idChat2_DisableFade
idChat2_Editbox
idChat2_EditboxArrows
idChat2_PlayerNames
idChat2_Scroll
idChat2_StickyChannels
idChat2_TellTarget
idChat2_Timestamps
Informant
LazyDruid
LazyRogue
LazyScript
LFGSpam
LifeTapWarn
LitheSystemTray
LuaSlinger
MobHealth
MobHealth3_BlizzardFrames
MonkeyBuddy
MonkeyLibrary
MonkeyQuest
MonkeySpeed
MrPlow
OneBag
OneBank
OneRing
OneView
OutfitDisplayFrame
Outfitter
QuickHeal
Servitude
SheepWatch
Squeenix
Squishy
StoneScan
Stubby
tekSupport
TheLowDown
Visor
VisorGUI
WelcomeHome

Many of these you can get from www.wowinterface.com or ui.worldofwar.net. Others you have to dig a bit harder to find. Since most of the Ace developers use the same version control system, you can get up to the minute versions of many of the Ace mods from www.wowace.com/files. You should assume, however, that those are betas. If you prefer stable stuff, stick with the stuff published to the main sites.

Best of luck! If you play on Dragonblight, look me up. I’m Quaiche, Gaskett, Mirabel and Clavain in the Lithe guild.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
15

Another Cool PowerShell + Subversion Hack

Tuesday, 15 August 2006 13:22 by Peter Provost

As I said before, I’ve been writing an Addon for World of Warcraft using the Ace2 libraries which are hosted on a subversion server.

I was trying to track down a bug that I couldn’t reproduce so I decided to completely refresh my entire Ace addon set from the svn server.

So I needed to run through every directory in my Addons folder and if it was a subversion working copy then I wanted to delete it and re-checkout that folder from the subversion server.

Again, this only took a single line of PowerShell script:

[75] » ls | ? { svn st $_ 2> out-null; return ($lastexitcode -eq 0) } | % { 
$xml = [xml] (svn info --xml $_ 2> out-null); $url = $xml.info.entry.url; 
del -recu -force $_; svn checkout $url $_ }

I love PowerShell. It rocks!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
25

My newest interesting Powershell script

Tuesday, 25 July 2006 06:20 by Peter Provost

I’ve started running a bunch of Ace Addons for World of Warcraft and I love the fact that they have them all up on their Subversion server. But it was getting annoying having to do “svn update” on each and every folder (using TortoiseSVN wasn’t any better… I then had to right-click each one… not better).

But of course, being the Powershell junkie that I am, I had to automate this, so here’s what I just ran. I know it can be simplified a bit, but this works for now:

PS > gci | where { $_.GetType().FullName -eq "System.IO.DirectoryInfo" } | foreach { cd $_; svn update }

Woo hoo!

Update: I suppose I should have just tried using SVN for this first, eh? It turns out "svn update *" works just fine.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5