The recent interface change that brought uparrows also added an interface option to display recently expired effects (default: 0).
Sample HTML of the table in question:
Debug log snippet:
CharPaneRequest.java:651 (with context):
I think CharPaneRequest.refreshEffect is matching the onClick of one of the expired effects, but extractEffect is only working with the text of the title, but that's just a guess.
(aside: I was not aware that lastIndexOf could return an index to indicate a position prior to the specified start index)
Sample HTML of the table in question:
Code:
<table cellpadding=1 cellspacing=0><tr><td colspan='3' style='color:#666' align='center'><font size=2><b>Recently Expired Effects:</b></font></td></tr><tr><td></td><td valign='middle'><img src="http://images.kingdomofloathing.com/itemimages/buttrock.gif" width=30 height=30 onClick='eff("04bc18fe47f495a894774fa1bbb9713d");'></td><td valign=center><font size=2 color='#666'>Butt-Rock Hair (0)</font><br></td></tr><tr><td></td><td valign='middle'><img src="http://images.kingdomofloathing.com/itemimages/strboost.gif" width=30 height=30 onClick='eff("943ba3b11499412f041807f8a7835d75");'></td><td valign=center><font size=2 color='#666'>Go Get 'Em, Tiger! (0)</font><br></td></tr><tr><td></td><td valign='middle'><img src="http://images.kingdomofloathing.com/itemimages/beatenup.gif" width=30 height=30 onClick='eff("acf143c704afaf7504ac07375084f79e");'></td><td valign=center><font size=2 color='#666'>Beaten Up (0)</font><br></td></tr></table>
Debug log snippet:
Code:
Unexpected error, debug log printed.
class java.lang.StringIndexOutOfBoundsException: String index out of range: -96
java.lang.StringIndexOutOfBoundsException: String index out of range: -96
at java.lang.String.substring(String.java:1911)
at net.sourceforge.kolmafia.request.CharPaneRequest.extractEffect(CharPaneRequest.java:651)
at net.sourceforge.kolmafia.request.CharPaneRequest.refreshEffects(CharPaneRequest.java:722)
at net.sourceforge.kolmafia.request.CharPaneRequest.processResults(CharPaneRequest.java:211)
at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:2164)
CharPaneRequest.java:651 (with context):
Code:
int startIndex = responseText.indexOf( "<font size=2>", searchIndex ) + 13;
durationIndex = responseText.indexOf( "</font", startIndex );
durationIndex = responseText.lastIndexOf( "(", durationIndex ) + 1;
effectName = responseText.substring( startIndex, durationIndex - 1 ).trim();
I think CharPaneRequest.refreshEffect is matching the onClick of one of the expired effects, but extractEffect is only working with the text of the title, but that's just a guess.
(aside: I was not aware that lastIndexOf could return an index to indicate a position prior to the specified start index)