Help with text manipulation....

Paragon

Member
So I was trying to write a consult script like FightOptimizer. I am having trouble extracting the amount of damage that I did to the enemy. I tried borrowing some code from FightOptimizer (um... by borrow i mean pretty much copy) but it doesn't work correctly when I miss or do a non damage attack and my familiar attacks.

I was wondering if anyone had any desire to right a function to extract the damage? eh... hehe. Or maybe some Ideas on how to go about it?
I was thinking maybe it would be possible to write a greasemonkey script that would frame the numbers I was looking for to make it easier to find... but I don't know anything about grease monkey so I'm not sure if that would be easier or harder.
 

holatuwol

Developer
KoLmafia stores how much HP it THINKS the monster has in monster_hp(). If you store that between rounds, you get how much damage you did.
 

Paragon

Member
I was hoping that would be the case but it seems that monster_hp() is only updated at the start of the round... it doesn't seem to update between rounds.
 

Paragon

Member
Nevermind... I *think* fightoptimizer.ash just short circuited on non damaging actions to save time, so by eliminating the quickouts I think I can get the actual damage... with the possible exception of battlefield healing items...
 
Top