Bug - Fixed Recent mafia updates broke buffbots (or at least the Noblesse Oblige buffbot)?

JLE

New member
Can you pass this on to the KOLmafia devs?

When I upgraded the Noblesse Oblige buffbot to run on the newest KOLMafia version at the time of download (version 16852.jar), it was only a couple of days later that I discovered that this buffbot seemed to have stopped working.

Investigation of the problem showed that, instead of actually buffing people in response to the messages, it was treating the message as a non-buff message and saving it to the "saved" folder, but not actually handing out any buffs.

This had been going on for two days. Reverting to an older version of KolMafia (16809.jar) seems to work fine, and Botty is now buffing again.

But I would like to be able to update mafia sometime because otherwise *eventually* some game change will happen which breaks compatibility with old versions of mafia.

Worse still: I managed to inadvertently delete the most recent 100 messages - after checking they were all buff-requests with a trivial amount of meat (I dealt with all the ones that weren't) so I can't even hand out the most recent buffs manually. :-( And there are about 450 older messages in there which I may have to go through one at a time.

Botty is now back working again, and will buff people properly *in future* as long as I don't update mafia... but I don't want to have to use out-of-date versions of mafia.
 

lostcalpolydude

Developer
Staff member
Can you pass this on to the KOLmafia devs?

Weird way to start a bug report here.

The post in the KoLmafia thread on the main forum will do absolutely nothing to help, since anyone that will work to fix the problem will see the report here. Also, anything where you can go back to an older version and things will work for a while wouldn't fall into the "urgent" category.
 

JLE

New member
Erm, this is now weird. Having been working for a while with the *old* version of mafia, I leave it for a few hours, come back, and... it's stopped buffing again and has started saving mesages to the "saved" folder without buffing, AGAIN.

Can anybody have an idea as to what may be causing this?
 

heeheehee

Developer
Staff member
r16843 contained the only change in the past year to BuffBotManager, which affected MEAT_PATTERN:
PHP:
public static final Pattern MEAT_PATTERN =
		Pattern.compile( "<img src=[^>]*?(?:images.kingdomofloathing.com|/images)/meat.gif\" height=30 width=30 alt=\"Meat\">You gain ([\\d,]+) Meat" );

On a multi:
HTML:
<center><table><tr><td><img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/meat.gif" height=30 width=30 alt="Meat"></td><td valign=center>You gain 1 Meat.</td></tr></table></center>

It... doesn't look like that pattern even matches anymore.
 

heeheehee

Developer
Staff member
Although, stepping through this with a debugger, I see
HTML:
<img src="https://s3.amazonaws.com/images.kingdomofloathing.com/itemimages/meat.gif" height=30 width=30 alt="Meat">You gain 1 Meat.</center>
so maybe I spoke too soon.

edit: I guess it was the lack of itemimages?
 

Veracity

Developer
Staff member
Exactly. I did a mass conversion of regexps that had previously hardcoded http://images.kingdomofloathing.com to use your scheme, but I screwed up this one by deleting a little too much...
 
Top