philmasterplus
Active member
As of writing, when KoLmafia parses
This patch eliminates the problem by parsing skill IDs instead of names. There is also a fallback for name checks in case KoLmafia doesn't recognize a skill ID.
I tested this on r20539 against 3 different characters, two of which were in Avatar of Boris. Both characters had regular permed skills that they couldn't use due to being AoB; the patched code correctly ignored these skills.
Incidentally, I tried to use JDOM (
charsheet.php
, it extracts each skill by name. This causes problems when two different skills have the same name. For example, skill ID 11002 ("Ferocity" in Avatar of Boris) and 24017 ("Ferocity" in Dark Gyffte). If a character is in AoB, KoLmafia thinks that the character has the DG Ferocity instead of AoB Ferocity. We could add special checks for these skills, but as skills are continuously added to the game, such approach is simply not scalable.This patch eliminates the problem by parsing skill IDs instead of names. There is also a fallback for name checks in case KoLmafia doesn't recognize a skill ID.
I tested this on r20539 against 3 different characters, two of which were in Avatar of Boris. Both characters had regular permed skills that they couldn't use due to being AoB; the patched code correctly ignored these skills.
Incidentally, I tried to use JDOM (
org.jdom2.*
) for XPath since KoLmafia already includes JDOM. However, JDOM relies on Jaxen for XPath. Since KoLmafia doesn't bundle Jaxen, I had to resort to Java's built-in XPath packages (javax.xml.xpath.*
) instead. If we can add Jaxen, please let me know, because Java's built-in DOM packages (org.w3c.dom.*
) are cumbersome to use. Besides, we'd finally get a chance to use proper XPath in ASH.