Battle Field Bad Company 2 Stats

By Aucun50 on Jul 19, 2010

This is a Battle Field Bad Company 2 stats dialog, it has two parts one for user stats (score, kills, deaths, ratio) it will show all of these and some others along with a picture of your curret rank. The second dialog is for weapons, it will show your kills, headshots, accuracy and time used. It also has a picture of the weapon just in case you want to know what it looks like :)

You put this code in your remotes (alt + r) save it if you like or just click ok. Now you need to download all the pictures for the dialogs here: http://aucun.0fees.net/download.php?list.4

Download "Weapons (Images)" and "Ranks (Images)", after you download them you need to put them in your mircdir, don't worry they are in folders :) Put the folders "Weapons" and "Ranks" in your mircdir found by typing "//echo -a $mircdir" without quotes in your mirc.

Once you have placed the folders in your mircdir you can open the dialogs, when you open the dialog it will ask for a name, this is not your mIRC name but your Battle Field Bad Company 2 online name (Mine is Aucun so I put Aucun). If you don't use a pc that's no problem, right click in a channel and hit "BFBC2 Console" type either pc, ps3 or 360 to get stats on them.

Please note: Some weapons like the XM8 Prototype may not show time used or accuracy, this only happens now and then if you try it again it might give you all them. Also this script is still BETA I don't know if all the bugs are worked out or if the website plans to change the html.

Remember to update your stats first at http://bfbc2.statsverse.com/ and please post a comment if you find a bug, thank you.

dialog stats {
  title "Battle Field Bad Company 2 Stats"
  option dbu
  size -1 -1 150 80
  box "Stats -" 1, 2 2 143 73
  text "Score: Loading..." 2, 7 12 80 10
  text "Kills: Loading..." 3, 7 22 80 10
  text "Deaths: Loading..." 4, 7 32 80 10
  text "Ratio: Loading..." 5, 7 42 80 10
  text "Time Played: Loading..." 6, 7 52 80 10
  button ">> Advanced <<" 7, 7 62 60 10
  box "Extra Information" 8, 150 2 143 63
  icon 9, 90 10 50 50, %rank
  text "Skill Rating: Loading..." 10, 157 12 80 10
  text "Dogtags: Loading..." 11, 157 22 80 10
  text "Wins: Loading..." 12, 157 32 80 10
  text "Losses: Loading..." 13, 157 42 80 10
  text "Ratio: Loading..." 14, 157 52 80 10
}

on *:dialog:stats:*:*: {
  if ($devent == init) {
    var %user = $$?="Enter BFBC2 Name"
    did -ra stats 1 Stats - %user
    stats %user 
  }
  else if ($devent == sclick) {
    if ($did == 7) {
      if (%adv) { dialog -s stats -1 -1 300 160 | unset %adv }
      else { dialog -s stats -1 -1 600 160 | set %adv = yes }
    }
  }
  else if ($devent == close) { unset %rank %adv }
}

alias stats {
  if ($sock(stats)) { sockclose stats }
  sockopen stats bfbc2.statsverse.com 80
  sockmark stats $1 
}

on *:sockopen:stats: {
  if ($sockerr) { echo -s Socket error }
  else {
    sockwrite -n stats GET $+(/stats/,$iif(%console,%console,pc),/,$sock(stats).mark) HTTP/1.0
    sockwrite -n stats HOST: bfbc2.statsverse.com
    sockwrite -n stats $crlf
  }
}

on *:sockread:stats: {
  var %read | sockread %read 
  if (big stats isin %read) {
    sockread %read | did -ra stats 2 Score: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 3 Kills: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 4 Deaths: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 5 Ratio: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 6 Time Played: $remove($gettok(%read,5,62),</span)
  }
  else if (class="rank-img" isin %read) { 
    set %rank $+($mircdir,Ranks\,Rank-,$gettok($gettok(%read,4,34),5,47))
    did -g stats 9 %rank
  }
  else if (Skill Rating: isin %read) {
    did -ra stats 10 Skill Rating: $remove($gettok(%read,5,62),</span)
    sockread %read | sockread %read
    did -ra stats 11 Dogtags: $remove($gettok(%read,5,62),</span)
    sockread %read | sockread %read | sockread %read | sockread %read | sockread %read
    did -ra stats 12 Wins: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 13 Losses: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra stats 14 Ratio: $remove($gettok(%read,5,62),</span)
  }
}

dialog weapons {
  title "Battle Field Bad Company 2 Weapons"
  option dbu
  size -1 -1 200 80 
  icon 1, 5 5 65 17, %weapon
  text "" 3, 80 5 40 15
  text "" 2, 125 5 100 15 
  box "Stats" 4, 5 25 190 52
  text "Kills: Loading..." 5, 10 35 180 10
  text "Headshots: Loading..." 6, 10 45 180 10
  text "Accuracy: Loading..." 7, 10 55 180 10
  text "Time Used: Loading..." 8, 10 65 180 10
  combo 9, 80 15 110 10, drop
}

on *:dialog:weapons:*:*: {
  if ($devent == init) { 
    set %user $$?="Enter BFBC2 Name"
    did -a weapons 2 9A-91 AVTOMAT 
    did -a weapons 3 Class: Engineer
    weapon 9A-91 AVTOMAT
    did -a weapons 9 9A-91 AVTOMAT
    did -a weapons 9 870 MCS
    did -a weapons 9 AEK-971 VINTOVKA
    did -a weapons 9 AKS-74U KRINKOV
    did -a weapons 9 AN-94 ABAKAN
    did -a weapons 9 F2000 ASSAULT
    did -a weapons 9 G3 
    did -a weapons 9 GOL SNIPER MAGNUM
    did -a weapons 9 M1 GARAND
    did -a weapons 9 M14 MOD 0 ENHANCED
    did -a weapons 9 M16A2
    did -a weapons 9 M16A2 SPECACT
    did -a weapons 9 M24 SNIPER
    did -a weapons 9 M60 LMG
    did -a weapons 9 M95 SNIPER
    did -a weapons 9 M95 SNIPER SPECACT
    did -a weapons 9 M416
    did -a weapons 9 MG3
    did -a weapons 9 MG3 SPECACT
    did -a weapons 9 MG36
    did -a weapons 9 NEOSTEAD 200 COMBAT
    did -a weapons 9 PKM LMG
    did -a weapons 9 PP-2000 AVTOMAT
    did -a weapons 9 SAIGA 20K SEMI
    did -a weapons 9 M249 SAW
    did -a weapons 9 SCAR-L CARBINE
    did -a weapons 9 SPAS-12 COMBAT
    did -a weapons 9 STG.77 AUG
    did -a weapons 9 SV98 SNAIPERSKAYA
    did -a weapons 9 SVU SHORT
    did -a weapons 9 TYPE 88 SNIPER
    did -a weapons 9 TYPE 88 LMG
    did -a weapons 9 UMP-45
    did -a weapons 9 UMP-45 SPECACT
    did -a weapons 9 USAS-12 AUTO
    did -a weapons 9 UZI
    did -a weapons 9 VSS SPECIAL
    did -a weapons 9 WWII M1A1 THOMPSON
    did -a weapons 9 XM8 COMPACT
    did -a weapons 9 XM8 LMG
    did -a weapons 9 XM8 PROTOTYPE
  }
  else if ($devent == sclick) {
    if ($did == 9) {
      if ($did(9) == 9A-91 AVTOMAT) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\9A-91.png) }
      else if ($did(9) == 870 MCS) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\870.png) }
      else if ($did(9) == AEK-971 VINTOVKA) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\AEK-971.png) }  
      else if ($did(9) == AKS-74U KRINKOV) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\AKS-74U.png) }  
      else if ($did(9) == AN-94 ABAKAN) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\AN-94.png) }
      else if ($did(9) == F2000 ASSAULT) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\F2000.png) } 
      else if ($did(9) == G3) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\G3.png) }
      else if ($did(9) == GOL SNIPER MAGNUM) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\GOL.png) }   
      else if ($did(9) == M1 GARAND) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\M1.png) }   
      else if ($did(9) == M14 MOD 0 ENHANCED) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\M14.png) }  
      else if ($did(9) == M16A2) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\M16A2.png) }
      else if ($did(9) == M16A2 SPECACT) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\M16A2_Spec.png) }
      else if ($did(9) == M24 SNIPER) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\M24.png) }
      else if ($did(9) == M60 LMG) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\M60.png) }
      else if ($did(9) == M95 SNIPER) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\M95.png) }
      else if ($did(9) == M95 SNIPER SPECACT) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\M95_Spec.png) }
      else if ($did(9) == M416) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\M416.png) }
      else if ($did(9) == MG3) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\MG3.png) }
      else if ($did(9) == MG3 SPECACT) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\MG3_Spec.png) }
      else if ($did(9) == MG36) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\MG36.png) }
      else if ($did(9) == NEOSTEAD 200 COMBAT) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\NEO.png) }
      else if ($did(9) == PKM LMG) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\PKM.png) }
      else if ($did(9) == PP-2000 AVTOMAT) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\PP-2000.png) }
      else if ($did(9) == SAIGA 20K SEMI) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\SAIGA.png) }
      else if ($did(9) == M249 SAW) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\SAW.png) }
      else if ($did(9) == SCAR-L CARBINE) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\SCAR-L.png) }
      else if ($did(9) == SPAS-12 COMBAT) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\SPAS.png) }
      else if ($did(9) == STG.77 AUG) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\STG.png) }
      else if ($did(9) == SV98 SNAIPERSKAYA) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\SV98.png) }
      else if ($did(9) == SVU SHORT) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\SVU.png) }
      else if ($did(9) == TYPE 88 SNIPER) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\Type-88.png) }
      else if ($did(9) == TYPE 88 LMG) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\Type-88-LMG.png) }
      else if ($did(9) == UMP-45) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\UMP-45.png) }
      else if ($did(9) == UMP-45 SPECACT) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\UMP-45_Spec.png) }
      else if ($did(9) == USAS-12 AUTO) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\USAS.png) }
      else if ($did(9) == UZI) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\UZI.png) }
      else if ($did(9) == VSS SPECIAL) { did -ra weapons 3 Class: Recon | set %weapon $+($mircdir,Weapons\VSS.png) }
      else if ($did(9) == WWII M1A1 THOMPSON) { did -ra weapons 3 Class: Any | set %weapon $+($mircdir,Weapons\WWII-Tommy.png) }
      else if ($did(9) == XM8 COMPACT) { did -ra weapons 3 Class: Engineer | set %weapon $+($mircdir,Weapons\XM8-Com.png) }
      else if ($did(9) == XM8 LMG) { did -ra weapons 3 Class: Medic | set %weapon $+($mircdir,Weapons\XM8-LMG.png) }
      else if ($did(9) == XM8 PROTOTYPE) { did -ra weapons 3 Class: Assault | set %weapon $+($mircdir,Weapons\XM8-Pro.png) }
      did -ra weapons 2 $did(9) | did -g weapons 1 %weapon | weapon $did(9)
    }
  }
  else if ($devent == close) { unset %user %weapon }
}

alias weapon {
  if ($sock(weapon)) { sockclose weapon }
  sockopen weapon bfbc2.statsverse.com 80
  sockmark weapon $1-
}

on *:sockopen:weapon: {
  if ($sockerr) { echo -s Socket error }
  else {
    sockwrite -n weapon GET $+(/stats/,$iif(%console,%console,pc),/,%user) HTTP/1.0
    sockwrite -n weapon HOST: bfbc2.statsverse.com
    sockwrite -n weapon $crlf
  }
}

on *:sockread:weapon: {
  var %read | sockread %read 
  if (<div class="name"> $+ $sock(weapon).mark $+ </div> isin %read) {
    sockread %read | sockread %read 
    did -ra weapons 5 Kills: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra weapons 6 Headshots: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra weapons 7 Accuracy: $remove($gettok(%read,5,62),</span)
    sockread %read | did -ra weapons 8 Time Used: $remove($gettok(%read,5,62),</span)
    sockclose weapon
  }
}

menu channel,status {
  BFBC2 Console %console:set %console $$?="Either pc, ps3 or 360"
  BFBC2 - Stats {
    set %rank $+($mircdir,Ranks\Rank-0.png)
    $iif($dialog(stats),dialog -v,dialog -m stats) stats
  }
  BFBC2 - Weapons { 
    set %weapon $+($mircdir,Weapons\9A-91.png)
    $iif($dialog(weapons),dialog -v,dialog -m weapons) weapons
  }
}

Comments

Sign in to comment.
Jamiie   -  Jul 27, 2010

Ok, sounds great. I'll reload it, I may have missed some. :P

 Respond  
Aucun50   -  Jul 20, 2010

I had run this a few times and noticed it doesn't like ratio or time played but when I tried it again it got all them fine. I find if you don't update your stats for 10+ hours and run this sometimes it doesn't get all the information, why I have no idea the page is 100% the same shouldn't be a problem but it seems to be.

I think you may have missed some of the code when copying, my line 183 is a "}". I will update this with the current version I have just in case I missed something while copying. Thank you.

 Respond  
Jamiie   -  Jul 20, 2010

Works good for PS3, not sure about the 360 or PC. Only problem I noticed for the Stat tracker is it doesn't show my k/d ratio. I have a 1.07 but it doesn't show any digits. It also doesn't show the Time Played either. And I was also getting a error on line 183. This was the error.

* /did: 'weapons' error loading 'C:\Documents' (line 183, script2.nns)

This happened while selecting other weapons for the user.

Other than them small problems the script is great.

7/10+like

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.