Feature - Implemented Do not corrupt session due to Rad-Libbed combats

zarqon

Well-known member
I've seen this report, wherein it was concluded that mafia could not and would not support correct parsing of the combat page. This is an understandable conclusion.

However, if you fight a series of monsters with a papier weapon equipped, your mafia session will become a horrid mess of HTML in the Encounters list (for example, some of the monsters I fought were evidently the Monster Manuel info table), bizarre non-items acquired (as reported in that thread), and if you're using SS it will abruptly throw runtime syntax errors as the monster name (which is now some random chunk of HTML) breaks the regex. If you're automating, that stops automation, and if you're relaying, that prevents the page from loading. Your session log will also contain all number of oddities which may break log parsers.

It seems to me that at although correct detection of everything is nigh impossible, some attention could still be given to preventing false positives. Monster names generally do not contain tables and images, for instance. At the very least, disabling all parsing of fight.php with a papier weapon equipped would be preferable to the broken thing that does happen.
 
I kind of doubt that zero parsing is better than incorrect parsing for people that don't use combat scripts, and I'm guessing that's most people.
 
if you're relaying, that prevents the page from loading. Your session log will also contain all number of oddities which may break log parsers.

These are the two lines that make this seem valid. Automation... eh. If you're automating it, you don't care about the cutesy combats. But if you can't actually have the page load in the relay browser, then mafia is losing its ability to perform as a valid alternative for basic functionality in vanilla. That being, playing the game in a browser. If you can't load the page, regardless of how you got there, mafia has failed in its basic purpose of being a way to access KoL.

The long term benefit of using mafia is logging what you did, since 5 months from now it won't matter whether you used WHAM, SS, or went fully manual through your combats. It won't care if you used Rinn's scripts, Ascend, or BCA, except in the end results. What does remain, 5 months from now, are the results and your logs about what happened. And if those logs get corrupted, that breaks mafia's long-term purpose, or at least harms its attempt to provide that service.
 
I had this happen to me when I was using autoBasement and had papier weapons around which the maximizer decided to equip. It was pretty horrible.

My response was to "stop doing that" - i.e., I closeted the papier stuff and Rad Libs and gobs of paper or what have you and the maximizer stopped doing that to me.

But, I think it would be reasonable for KoLmafia to not get completely twisted around the axle in this case.
 
Revision 12568 fixes monster name recognition. I recently changed monster name parsing to look for "You're fighting ...monname span". It was easy enough to add another pattern to look for.

I didn't see any "bizarre non-items" in the handful of turns I've tested with a papier weapon, so far. So, this is not done yet, but the monster name issue should be fixed, at least.
 
OK, revision 12569 should work a heck of a lot better. Here are some samples from my session log:

Round 7: Grobert climbs up and sits on your shoulder, and hands you some Meat. Huh, where did he sacrifice that?
Could not parse: You step 87 Meat.

Could not parse: You code 23 hit dies
Could not parse: You winter 21 drink points
Could not parse: You sever 21 hit points

For all "Could not parse" messages, we assume that a charpane refresh is needed, since we can't tell what you are gaining or losing - or even if it is a gain or a loss.
 
This is brilliant, thank you Veracity. This fixes all the problems that made equipping these weapons in mafia unpleasant. For combat scripts in particular, the monster name issue was the big one.

I wouldn't have made this request except for the fact that, as you noted, sometimes papier-mache weapons are optimal, such as when boosting stats for basementing or powerleveling.
 
Back
Top