Bug - Fixed Manuel stat parsing broken when displayed horizontally

Cool12309

Member
[20374] Sleazy Back Alley
Encounter: hung-over half-orc hobo
Strategy: attack with weapon
Round 0: Cool12309 wins initiative!
Round 0: Cool12309 tries to steal an item!
Unknown item found: 111110
111110
You acquire an item: Mad Train wine
Round 1: Cool12309 attacks!
Round 2: hung-over half-orc hobo takes 1210 damage.
Round 2: Cool12309 wins the fight!
After Battle: Teacher 36.3% rolls around in the snow suit, giving you any extra items that stick to it.
After Battle: Teacher 36.3% says, "the uncontrollable urge to dance is evidence of repressed sexual longing," and does a little soft-shoe.
You acquire an item: dirty hobo gloves
You acquire an item: hobo gristle
You gain 1 Fortitude
You gain 2 Mysteriousness
You gain 2 Cheek

It says 111110 randomly for a lot of the combats. In the session results there are also more numbers. r12229
 

lostcalpolydude

Developer
Staff member
I've spent some time staring at the HTML, and I really can't figure out what's happening. The only guess I have at a starting point is in FightRequest, the ResultProcessor.processItem() call on line 4200. Manuel stuff is inside a table node, but there is no class or rel attribute there. I also can't figure out how the session log is only getting that number logged, with no other text on the line.
 

lostcalpolydude

Developer
Staff member
I stared at the HTML and stared at mafia's code, and I couldn't figure out how it could be happening, then I gave up for now and turned off the setting. I'm sure it's happening for everyone using that setting, but I have no idea why.
 

Veracity

Developer
Staff member
I'll turn on that setting and capture a fight page tomorrow unless you have one saved for me to look at today. Thanks.
 

lostcalpolydude

Developer
Staff member
Here's the HTML I grabbed several days ago. I added some line breaks around where Manuel's stats are displayed, but otherwise it's unchanged.
 

Attachments

  • manuelHTML.txt
    50.9 KB · Views: 33

Veracity

Developer
Staff member
Thank you.

> test load manuelHTML.txt

Read 52,141 bytes

> test fight 1

KoLmafia thinks it is round 2 but KoL thinks it is round 1
Unknown item found: 879897
879897
I'm using the gCLI while not logged in. This should be easy enough to debug. "test fight" is your friend. :)
 

Veracity

Developer
Staff member
When I look at the parse tree for the fight, first I see this:

PHP:
    <table>
      <tbody>
        <tr>
          <td>
            <img id="monpic" src="http://images.kingdomofloathing.com/adventureimages/smutorc_pervert.gif" width="100" height="100">
          <td valign="center">
            You're fighting
            <span class="elementsleaze" id="monname">
              a smut orc pervert
            <font size="2" color="gray">
              <br>
              HP: 87, Atk: 98, Def: 97, Type: orc
              <br>
              Drops: smut orc keepsake box (100 no pp)
This is the "monpic" block - the monster picture. It appears to have KoLmafia's monster annotation on it. It would be nice to skip parsing this table entirely, since it has no fight data in it.

Then, there is another table:

PHP:
    <table>
      <tbody>
        <tr>
          <td width="30">
            <img src="http://images.kingdomofloathing.com/itemimages/hp.gif" width="30" height="30" alt="Enemy's Hit Points" title="Enemy's Hit Points">
          <td width="50" valign="center" align="left">
            <b>
              <font size="+2">
                87
          <td width="30">
            <img src="http://images.kingdomofloathing.com/itemimages/nicesword.gif" width="30" height="30" alt="Enemy's Attack Power" title="Enemy's Attack Power">
          <td width="50" valign="center" align="left">
            <b>
              <font size="+2">
                98
          <td width="30">
            <img src="http://images.kingdomofloathing.com/itemimages/whiteshield.gif" width="30" height="30" alt="Enemy's Defense" title="Enemy's Defense">
          <td width="50" valign="center" align="left">
            <b>
              <font size="+2">
                97
          <td>
            <img src="http://images.kingdomofloathing.com/itemimages/frattyflavor.gif" alt="This monster is an Orc" title="This monster is an Orc">
          <td>
            <img src="http://images.kingdomofloathing.com/itemimages/wink.gif" width="30" height="30" alt="This monster is Sleazy.  Sleaze is weak against Cold and Spooky." title="This monster is Sleazy.  Sleaze is weak against Cold and Spooky.">
          <td>
            <img src="http://images.kingdomofloathing.com/itemimages/watch.gif" alt="Initiative +50%" title="Initiative +50%">
This is Manuel's table. Note the table row. The "text" of that row is "879897" - the concatenation of the "content" fields. Note the first "img" tag - "hp.gif". We try to parse that table as a change to your HP.

It would be nice to skip the Manuel table and not parse it, since it has no fight data in it.

Pondering.
 

Veracity

Developer
Staff member
OK, Revision 12250 attempts to skip processing the monpic table and also Manuel's table when walking the fight HTML parse tree.

I assume this will not harm parsing other aspects of the parse tree, but it is not tested. Let me know.
 

Lxndr

Member
I'm not getting the odd artifacts anymore, but I can't speak to the rest of the parse tree. I'm not sure what to look for there.
 

Veracity

Developer
Staff member
It works; fights get recorded, same as ever, in the gCLI and session log.
I was just out of adventures yesterday and could not test.
 
Top