Vhaeraun's Glorious PVP Bookkeeper

Veracity

Developer
Staff member
There were three or four threads, all reporting the same bug. I responded on all of them that I'd fix it, but didn't bother reporting back on all of them that I HAD fixed it.
 
The new ‡ indicator means it's failing to recognize the checking it twice mini (at least, I think that's the problem, it could of course be something completely unrelated).
 
It also looks like it's not seeing the Holiday Shopping mini. By which I mean that that mini is not showing in my results table at all.
 
Regarding the unrecognized Holiday Shopping mini, I'll be damned if I can figure out why this regex isn't matching this page text:
Code:
string informationBoothContests = "<td valign=\"top\" nowrap><b>(.*?)\\**</b></td><td valign=\"top\">(.*?)</td><td valign=\"top\" align=\"center\">(\\d+|\\?\\?)</td>";
Code:
<td valign="top" nowrap><b>Holiday Shopping*</b></td><td valign="top">You know what makes a great holiday gift?  Gargle Blasters! (Who has earned the most Pan-Dimensional Gargle Blasters?)</td><td valign="top" align="center" colspan="1">3</td>

Regarding the recognized-but-not-tallied Checking It Twice mini, it was also my suspicion that the new double dagger (?) note icon is messing it up. I'm sure this could be solved by using (with a capital 'D') somewhere, to handle it. But I don't even entirely understand how the existing asterisk note icon is being handled, so I'm not sure where to make the change.
 

xKiv

Active member
Regarding the unrecognized Holiday Shopping mini, I'll be damned if I can figure out why this regex isn't matching this page text:

regex has: align="center">
page has: align="center" colspan="1">


And the * is handled by: \\**
(zero or more asterisks).

So you probably want something like:
Code:
 (\\*|‡)*
(modulo correct quoting and grouping)
 
Last edited:
Thanks a million, xKiv.

I count myself among those sorry masses that are just capable enough with regex to get in trouble. Don't know how I missed that colspan attribute. I broadened the regex to match any attributes in that last <td> tag. Hopefully that broadening doesn't cause other issues.

I'm still not entirely sure what's up with that double-backslash, double-asterisk to match the literal asterisk in mini names. Something-something-double-escaping? But even then, I don't get where the second asterisk comes in. My head hurts. At any rate, editing into that same regex solved the issue.

All-in-all: a one-line change. Here's the updated version.
 

Attachments

  • vgpb.ash
    15.9 KB · Views: 141
Last edited:

xKiv

Active member
I'm still not entirely sure what's up with that double-backslash, double-asterisk to match the literal asterisk in mini names. Something-something-double-escaping?

Yes. You need \\ in the source file to put a \ in the actual string value. And you need \* in the actual string value to match a literal asterisk.
The second asterisk is just the normal greedy quantifier - match zero or more instances of the preceding "literal asterisk" (so it will match texts with no asterisk, with *, with **, with ***, etc...).
 
Has anyone recently seen the Bookkeeper tabulate results for more than 1,000 fites? The help text seems to indicate that it was handling (at least) up to 99,999 at one point. But my copy is capping at 1,000, no matter what I enter. (I've definitely fought more fites than that, and I've tabulated more than that in stints throughout the season, including after I deleted my cache file on the 6th.)
 
Last edited:

Boesbert

Member
Thanks a million, xKiv.

I count myself among those sorry masses that are just capable enough with regex to get in trouble. Don't know how I missed that colspan attribute. I broadened the regex to match any attributes in that last <td> tag. Hopefully that broadening doesn't cause other issues.

I'm still not entirely sure what's up with that double-backslash, double-asterisk to match the literal asterisk in mini names. Something-something-double-escaping? But even then, I don't get where the second asterisk comes in. My head hurts. At any rate, editing into that same regex solved the issue.

All-in-all: a one-line change. Here's the updated version.

With the most recent season (but also before that) I ran into minis not being considered, notably Newest Born, Pirate Warrrs!, and Thirrrsty forrr Booze. So only 9 minis out of 12 were being tallied.

So I took the vgpb.ash from PaladinWhite's post and replaced my original copy with it. That broke the script though: https://i.imgur.com/APXuqqN.jpg
 

Veracity

Developer
Staff member
I noticed that the script was not picking up the Visiting The Co@^&$`~ mini. That is because that "&" is the single character in the information booth and is the HTML entity in the fight archive. I made the script do an entity_decode when reading either. Now I can see my results for the 344 fites where I've seen that contest.
 

Attachments

  • vgpb.ash
    16 KB · Views: 66

Veracity

Developer
Staff member
Here's a minor update to the script:

- Checks for updates using the new kolmafia.us URL for this thread. Considering that updates are not being added and mentioned on the first page, sort of useless, but, no more error message, at least.
- I'm not doing PVP this season. This script got a divide-by-zero when trying to calculate my stats, considering there were 0 offenses and 0 defenses.

I note that it did pick up the contests successfully from the Information Booth. I've had one report it's not always finding them in the PVP records? Since I am not PVPing this season, I can't check.

But, FWIW, here's an update:
 

Attachments

  • vgpb.ash
    16 KB · Views: 13

Boesbert

Member
So I took the vgpb.ash from PaladinWhite's post and replaced my original copy with it. That broke the script though:
If anyone had the same problem as I had with either PW's or Veracity's fix: It seems like it was just a caching error. Delete or remove the old playername_pvp_season_n_.dat from your data folder, run the script again and it should be fine.
 

Boesbert

Member
Apparently, this does not work for the current season (67). Apparently the HTML after "Newest Born" in the info booth makes the script fail no matter what when it comes to displaying the correct results.
If anyone had the same problem as I had with either PW's or Veracity's fix: It seems like it was just a caching error. Delete or remove the old playername_pvp_season_n_.dat from your data folder, run the script again and it should be fine.
 
Top