Smogon Community (Programming) mIRC Damage Calculator
 Register FAQ Social Groups Calendar Search Today's Posts Mark Forums Read

Categories: HTML, Programming, Other
Jun 2nd, 2007, 5:50:27 PM   #1
Misty**
oh

Join Date: Mar 2005
Posts: 7,151
mIRC Damage Calculator

The attached file is a fairly comprehensive damage calculator, used to calculate damage at level 100, created by me. I'm putting this here because people keep asking for it. To use it, save the file to your computer, then go into mIRC, hit alt+r, select the Aliases tab, then go to File -> Load... From there, find and open the damagecalc.txt file. You should immediately see the following:

dam {
blah blah blah
etc etc etc
stuff
...

Close the window.

Once you've loaded it, the usage is as follows:

/dam <attack> <defense> <base power> [target HP] <multiplier equation>

The multiplier equation is the trickiest part, so here are some examples:

A 359 attack Garchomp, holding Dragon Plate, using Outrage on a Suicune with 350 defense and 404HP:

/dam 359 350 120 404 * 1.5 * 1.2

The 1.5 indicates STAB; the 1.2 indicates the Dragon Plate. The * means that these numbers are being multiplied into the final numbers. If you desire, you can use / to divide -

A 359 attack Garchomp, holding Dragon Plate, using Outrage on a Skarmory with 400 defense and unknown HP:

/dam 359 400 120 * 1.5 * 1.2 / 2

The 1.5 and 1.2 are as before. The / 2 indicates the attack is not very effective, so the damage is halved. Note that the HP parameter is optional.

As a note - Choice items, Soul Dew, any stat boosts or drops, and abilities such as Guts should be multiplied directly into the attack stat. However, you can usually put these in the multipliers - as far as I can tell, it makes no difference.
Attached Files
 damagecalc.txt (853 Bytes, 380 views)

Last edited by Oglemi; Aug 17th, 2011 at 11:43:47 PM.

 Jun 2nd, 2007, 5:55:46 PM #2 Mekkah** pfbwowbfobwobwobfwowbf     Administrator Join Date: Feb 2005 Posts: 13,835 Most of them are good In other words, meybe stop asking "how much does x do to y" and do the hard work yourself. (: If you're amazing like me and hate aliases you can always change the "dam" from the first line to "alias" dam and put the whole thing in remote. But that's just because I'm awesome. __________________ onions videos cameras models steroids dinoturtlethings
 Jun 2nd, 2007, 6:11:17 PM #3 Max yadig     Join Date: Jan 2007 Posts: 1,375 Maryland Thanks, Misty. This will be very useful indeed.
 Jun 2nd, 2007, 7:30:53 PM #4 Akayfortyseven     Join Date: Apr 2006 Posts: 1,146 United Kingdom Thanks for this. __________________
Jun 3rd, 2007, 5:22:52 AM   #5
X-Act
np: Biffy Clyro - Shock Shock

Join Date: Feb 2006
Posts: 4,679
Malta

Quote:
 Originally Posted by Fat Misty As a note - Choice items, Soul Dew, any stat boosts or drops, and abilities such as Guts should be multiplied directly into the attack stat. However, you can usually put these in the multipliers - as far as I can tell, it makes no difference.
They do make a difference, but it's a minimal one - usually by 1 or 2 damage at most. If people are THAT fussy about their damage calculation (like I am), they must calculate those stat boosts in the attack stat, and not the multipliers, as Misty says. This difference, incidentally, is mainly because of the "+2" part in the damage formula.

Say you have a Choice Banded Tyranitar with a normal 403 attack as an example. This 403 is multiplied by 1.5, giving 604. Say it's using Stone Edge against a Pokemon with 200 defense for neutral damage.

Maximum damage will be ((604 * 100 * 0.84) / 200) + 2) * 1.5 = 382
Minimum damage will be ((604 * 100 * 0.84) / 200) + 2) * 0.85 * 1.5 = 324

If we put the 1.5 in the multipliers part, we'd have:

Maximum damage: ((403 * 100 * 0.84) / 200) + 2) * 1.5 * 1.5 = 384
Minimum damage: ((403 * 100 * 0.84) / 200) + 2) * 0.85 * 1.5 * 1.5 = 325

As I said, this doesn't change the damage percentage much, but, for all the fussy people out there, it makes a difference of 1 or 2 damage.
__________________
http://users.smogon.com/X-Act

For all your Pokemon needs (and more!) including: the Defensive EVs applet, the Probabilities of Breeding IVs in Pokemon applet, and the Ratings of Pokemon Base Stats applet (now Version 2.0!). And also the IV to PID applet!

 Jun 19th, 2007, 5:49:18 PM #6 _Zero1   Join Date: Jun 2007 Posts: 12 How does this work exactly? I followed all of the steps, but every time I open it I get a bunch of \$ and ? and the occasional word "Attack" or "Defense" here and there... Is there a place I need to open the file or what? Sorry for the dumb question but I've never used mIRC before if that has anything to do with it...
 Jun 19th, 2007, 5:59:31 PM #7 Misty** oh     Administrator Join Date: Mar 2005 Posts: 7,151 Use /dam in a window, as shown... it has no GUI interface, you just enter text and it gives back.
 Jun 25th, 2007, 6:00:48 PM #8 Spidersonic     Join Date: Mar 2005 Posts: 59 New York City Thanks a lot for this. I'll use it in a project to give the community a list of "magic numbers" for certain pokes to reach; set attacking stats that enable it to OHKO or 2HKO specific walls, more specifically.
Jun 26th, 2007, 7:11:59 PM   #9
Konako

Join Date: Mar 2007
Posts: 69

When I try to open the attachment it says I'm not allowed to access that page. Help?
__________________
http://i126.photobucket.com/albums/p...racross-CC.jpg

Quote:
 AncientAlvmew2: wats a smogon?

 Jun 26th, 2007, 7:51:04 PM #10 Misty** oh     Administrator Join Date: Mar 2005 Posts: 7,151 Probably because you "could be banned".
 Jul 30th, 2007, 7:26:55 PM #11 TheLegendaryX   Join Date: Jun 2007 Posts: 6 Why can't I open the attachment? MetalKid's calculator is good but it's a lot of hassle. This one has been recommended to me so I want to try it. Last edited by TheLegendaryX; Jul 30th, 2007 at 7:30:23 PM.
 Aug 8th, 2007, 2:06:44 AM #12 Haitian   Join Date: Aug 2005 Posts: 114 Is there anyway to make the script work on ChatZilla? I used it on mIRC and it worked like a charm (great work on this, very helpful), but I put it on ChatZilla and get the following on every start-up: "SyntaxError: missing ; before statement @ 1"
 Aug 8th, 2007, 7:23:06 AM #13 Mekkah** pfbwowbfobwobwobfwowbf     Administrator Join Date: Feb 2005 Posts: 13,835 Most of them are good I'm pretty sure it only works for mIRC, that's what the program language is written for. __________________ onions videos cameras models steroids dinoturtlethings
 Aug 9th, 2007, 12:15:11 AM #14 Haitian   Join Date: Aug 2005 Posts: 114 I was hoping since the 2 were similar, that it'd work for both. Oh well.
 Aug 9th, 2007, 6:16:44 AM #15 crabnebula     Join Date: Jul 2006 Posts: 584 In the depths of a....Black Hole!! No, it doesn't work on chatzilla because mirc has its own scripting language, which I am pretty sure isn't recognized by Chatzilla. My primary reason to switch from chatzilla to mirc :(
 Aug 14th, 2007, 7:25:00 PM #16 Iggy Koopa   Join Date: Aug 2007 Posts: 3 A modified version I've made a modified version of the calculator (with some help from Team Rocket Elite). This version does the following things:Calculates OHKO, 2HKO (including Sandstorm and Leftovers) chances. Tells you how high an attack stats is required for a guaranteed OHKO for things that have a chance of OHKOing. Allow you to enter things such as "405*2" in place of stats to calculate boosted stats more easily (ie Porygon-Z after Nasty Plot using Ice Beam on a max HP/min SpDef Blissey after a Calm Mind would be /dam 405*2 306*1.5 95 714). Examples: Porygon-Z with a +2 SpAtk boost using Ice Beam on a +1 SpDef Blissey: /dam 405*2 306*1.5 95 714 Persian with a Life Orb using a Technicianed Icy Wind on Skarmory: /dam 251 176 55*1.5 334 *1.3 Rampardos with a +6 Atk boost holding Life Orb using a super-effective STAB Stone Edge on Dragonite: /dam 471*4 226 100 324 *1.3 *2 *1.5 Code: ```dam { var %basedam = \$calc((\$int(\$calc(\$int(\$calc(42 * \$int(\$calc(\$1)) * \$int(\$calc(\$3)) / \$int(\$calc(\$2)))) / 50)) + 2) \$iif(\$4 isnum,\$5-,\$4-)) if (\$4 isnum) { var %mn = \$int(\$calc(%basedam *.85)) | var %mx = \$int(%basedam) var %min = \$round(\$calc(%mn * 100 / \$4),2) | var %max = \$round(\$calc(%mx * 100 / \$4),2) if (%mn < \$4 && %mx >= \$4) { var %i 0 | while (\$int(\$calc(%basedam * ((%i + 85) / 100))) < \$4) { inc %i } var %x \$int(\$calc(\$1)) while (\$int(\$calc((\$int(\$calc(\$int(\$calc(42 * %x * \$int(\$calc(\$3)) / \$int(\$calc(\$2)))) / 50)) + 2) \$5- *.85)) <= \$4) { inc %x } var %OHKO ( \$+ \$calc(100 - %i / .16) \$+ % OHKO, \$calc(%x - \$int(\$calc(\$1))) more \$+(point,\$iif(\$calc(%x - \$int(\$calc(\$1))) != 1,s)) required for OHKO) } if (%mn < \$int(\$calc(\$4 / 2)) && %mx >= \$int(\$calc(\$4 / 2))) { var %j 0 | var %a 0 | while (%j <= 16) { var %i 0 | while (\$calc(\$int(\$calc(%basedam * ((%i + 85) / 100))) + \$int(\$calc(%basedam * ((%j + 85) / 100)))) < \$4 && %i < 15) { inc %i } inc %a %i | inc %j } var %THKO \$calc((256 - %a)/2.56) \$+ % 2HKO } if (%mn <= \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,/2-1,*15/32))) && %mx >= \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,/2-1,*15/32)))) { var %j 0 | var %a 0 | while (%j <= 16) { var %i 0 | while (\$calc(\$int(\$calc(%basedam * ((%i + 85)/100))) + \$int(\$calc(%basedam * ((%j + 85)/100)))) < \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,-1,*15/16))) && %i < 15) { inc %i } inc %a %i | inc %j } var %THKO \$iif(%THKO,\$+(%THKO,\$chr(44))) \$calc((256 - %a)/2.56) \$+ % \$iif(!%THKO,2HKO) with Sandstorm } if (%mn <= \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,/2+1,*17/32))) && %mx >= \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,/2+1,*17/32)))) { var %j 0 | var %a 0 | while (%j <= 16) { var %i 0 | while (\$calc(\$int(\$calc(%basedam * ((%i + 85)/100))) + \$int(\$calc(%basedam * ((%j + 85)/100)))) < \$int(\$calc(\$4 \$iif(\$calc(\$4 / 16) < 1,+1,*17/16))) && %i < 15) { inc %i } inc %a %i | inc %j } var %THKO \$iif(%THKO,\$+(%THKO,\$chr(44))) \$calc((256 - %a)/2.56) \$+ % \$iif(!%THKO,2HKO) with Leftovers } echo 4 -a \$1 attack vs \$2 defense, \$3 \$+(power,\$iif(\$5,\$+(\$chr(40),\$5-,\$chr(41))),\$chr(44)) \$4 max HP: %min \$+ % - %max \$+ % \$iif(%OHKO,%OHKO) \$iif(%THKO,\$+(\$chr(40),%THKO,\$chr(41))) } else { echo 4 -a \$1 attack vs \$2 defense, \$3 \$+(power,\$iif(\$4,\$+(\$chr(40),\$4-,\$chr(41))),:) \$int(\$calc(%basedam *.85)) - \$int(%basedam) } }``` __________________ ~ Iggy Koopa Last edited by Iggy Koopa; Aug 16th, 2007 at 12:55:56 AM.
 Aug 15th, 2007, 5:16:25 AM #17 X-Act np: Biffy Clyro - Shock Shock     Join Date: Feb 2006 Posts: 4,679 Malta This produces damage percentages that are more accurate. Well done! __________________ http://users.smogon.com/X-Act For all your Pokemon needs (and more!) including: the Defensive EVs applet, the Probabilities of Breeding IVs in Pokemon applet, and the Ratings of Pokemon Base Stats applet (now Version 2.0!). And also the IV to PID applet!
 Aug 16th, 2007, 12:56:36 AM #18 Iggy Koopa   Join Date: Aug 2007 Posts: 3 I just noticed a small problem with the non-HP based damage calculations. It has been fixed and the script has been updated. __________________ ~ Iggy Koopa
 Aug 16th, 2007, 3:38:51 AM #19 comoesa   Join Date: Feb 2007 Posts: 157 Now all I need to know is how to get too #smogon
 Aug 21st, 2007, 2:38:45 AM #20 Impetus     Join Date: Oct 2006 Posts: 366 Cali I was just wondering, could I put this program into my calculator (TI-84)? It would be nice to have this handy when I start to brainstorm during class. __________________ Skill is when Luck becomes a Habit.
Sep 4th, 2007, 2:47:31 PM   #21
Reflect Suicune

Join Date: Jul 2005
Posts: 553
Agrabah

Quote:
 Originally Posted by Fat Mekkah If you're amazing like me and hate aliases you can always change the "dam" from the first line to "alias" dam and put the whole thing in remote. But that's just because I'm awesome.
What does this accomplish?