I've had a few requests to share this. It's basically just a slightly tweaked version of Sentrion's excellent "Defensive PvP results in chat", found here:
http://kolmafia.us/showthread.php?10718-Defensive-PvP-Results-in-Chat
Before I go any further, let me make something perfectly clear...