Displaying your COD4 stats in a WordPress widget

So, I finally got the thing running. Of course, it turned out to be harder than i thought…

Some things i ran into while implementing it:

  • It’s not exactly possible to read in bytes from a file with JavaScript. This isn’t an issue normally, as the usual environment for JS is the web, but you kind of would expect there’d be a way to do this with WSH. Workarounds exist, but are lacking.
  • PHP and the Google Charts API don’t play along too nicely when you have to deal with JSON encoded Dates. The Google API expects months starting with 0 (e.g. January = 0, February = 1), PHP delivers months starting with 1.

My approach basically boils down to this:

  • Run a WSH script regularly which executes a c program which decrypts the mpdata file, reads in the relevant bytes for kills and deaths.
  • It then makes a GET request to a PHP script which saves the kills, deaths and a unix timestamp to a file.
  • A WordPress widget displays the statistics as a Google Chart after converting the file to JSON.

The code is on github, it’s all very ugly, but working.

 

Posting Call of Duty 4: MW stats to a php script

I’ve started working on a little project which will do the following:

  • Read out the current cod4 stats (kills/deaths) from the local player profile
  • Post it automatically to a php script so it can be displayed (e.g. on this site) using WSH (Windows Script Host)

What i will need to figure out for that:

  • Decrypting the mpdata file in <cod 4 game dir>\players\profiles\<profile name>
  • Read in the correct offsets for kills and deaths in the decrypted file using JS
  • Bonus: Fancy stats with the Google Charts API

The first item on this list is solved by using this guy’s decrypter which can be executed from the script. The code for the decryption is available under GPL so a future version would involve porting this code to JS.

Update: Turns out the whole read some bytes from a file thing is incredibly stupid in JS/VBS.

Update 2: Doing this in C is way easier.

function (i, s, o, g, r, a, m) {…}

Why does the anonymous function in the Google Analytics tracking snippet have such peculiarly named parameters?

An isogram (also known as a „nonpattern word“) is a logological term for a word or phrase without a repeating letter. It is also used by some to mean a word or phrase in which each letter appears the same number of times, not necessarily just once.[1] Conveniently, the word itself is an isogram.

en.wikipedia.org/wiki/Isogram

The letters probably are a by-product of the obfuscation used… and then someone shuffled them around to spell it out?

Recycling Methheads

Es ist offensichtlich möglich Urin von Methamphetaminkonsumenten zu recyclen:

There is a new method of cooking methamphetamine that’s starting to pop up in East Tennessee.

On Thursday, Anderson County authorities raided a house being used by a suspect to allegedly recycle urine back into the powerful and illegal stimulant.

Officials with the Anderson County Sheriff’s Office told Volunteer TV News that they’ve recently started coming across urine meth labs.

“This is the third one,” said Lt. Kenny Sharp, “but this is the largest we’ve had.”

Und natürlich gibt es jemanden der eine völlig… entmenschlichte Frage dazu stellt:

[…] she told me to force her on her belly and piss inside of her ass. I was honestly turned on at the time (in my sober state… yuck), but I didn’t because I have read that a decent amount of meth is excreted unchanged in urine. Would anything be absorbed rectally if I were to do that? I’m not too sure just how viable meth in urine is, or rectal drug use. Sorry for the really… weird question, and yes, I’m serious, just playing it as safe as possible!