Forum - A Mod of the mIRC Damage Calculator

0
This is a modified version of the http://www.smogon.com/forums/showthread.php?t=21084 made by Misty (you may download mIRC http://mirc.com).
    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).
To use this, open mIRC and press Alt + R. Click on the Aliases tab, click File on the menu bar, and go to New. Paste the code below into the textbox and click on the OK button.

To use this calculator, type: /dam <Attack> <Defense> <Base Power> [Target HP] <Damage Multipliers>
    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) }
}


If you find any bugs or if you have questions or feedback, please post them here, and be sure to pay us a visit on #Libelldra (server irc.slacknet.org, channel #libelldra) if you do get mIRC.
Aug 14 @ 16:42
0
This is pretty sweet, thanks for writing it.
Aug 14 @ 20:28
0
Still cant figure out how to work this and need it for my grumpig analysis.
Aug 15 @ 00:03
0
I just noticed a small problem with the non-HP based damage calculations. It has been fixed and the script has been updated.
Aug 16 @ 09:59
0
So...to get mIRC I need to put in my email? Or did I just look in the wrong place?

EDIT: Wait, ok, I did it. Now, were do you type stuff in?
Aug 23 @ 22:49
0
Wow, this is a great addition for mIRC, especially with more analysis-makers.

I'll be using this in the future for more calculations, it looks better than metalkids.
Aug 26 @ 09:38
0
I wish I knew how to code
Aug 27 @ 19:23
0
Sweet, Iggy. Thanks. This is awesome, one you learn how to use it.
Aug 28 @ 03:30

Reply

Before replying to the topic, be sure you've read the rules.

You must be logged in to post a reply.