Bug - Fixed Wrong/missing monster ID

ckb

Minion
Staff member
All these new monsters released through the deck of cards have me pouring through my monster manual list and making updates. I found some monsters where the monster ID in my manual does not match the monster ID in Mafia. These are those monsters in Monster Manual with their Manual IDs:

Code:
Troll Twins
# 1244

piranhadon
# 1601

junksprite sharpener
# 1436

high priest of Ki'rhuss
# 829

Higher Plane Serpents
# 368

giant giant giant centipede
# 462

devil
# 1731

crusty hippy Vegan chef
# 57

Candied Yam Golem
# 317

Boss Bat
# 49

Adventurer echo
# 1595
 

lostcalpolydude

Developer
Staff member
I entered 1000+ ids by hand, so I'm not surprised that I made a few mistakes. I fixed all these locally, plus one more mistake that I found by checking for duplicate ids between monsters. Sourceforge is unresponsive at the moment, so I'll have to wait to commit the fix.
 

Veracity

Developer
Staff member
Here is a script to look at every monster you have in Manuel, do a simple-minded conversion from Manuel's name to KoLmafia's name, and report any discrepancies.

Code:
record mon_data
{
    string image;
    string name;
};

static mon_data [int] monsters;

void parseManuel(string URL)
{
	string page = visit_url(URL);
	matcher entry_matcher = create_matcher( "<a name='mon(.*?)'></a><table width=95%>(.*?)</table>", page );
	while ( entry_matcher.find() ) {
	    int id = entry_matcher.group( 1 ).to_int();
	    string entry = entry_matcher.group( 2 );

	    matcher image_matcher = create_matcher( "/.*images/(.*?.gif) width=([(100)(60)])", entry );
	    string image = image_matcher.find() ? image_matcher.group( 1 ) : "";

	    matcher data_matcher = create_matcher( "<font size=.2>(.*?)</font>", entry );
	    if ( data_matcher.find() && data_matcher.find() ) {
		string name = data_matcher.group( 1 );
		monsters[ id ] = new mon_data( image, name );
	    }
	}
}

void parseall()
{
    monsters.clear();
    parseManuel("questlog.php?which=6&vl=a");
    parseManuel("questlog.php?which=6&vl=b");
    parseManuel("questlog.php?which=6&vl=c");
    parseManuel("questlog.php?which=6&vl=d");
    parseManuel("questlog.php?which=6&vl=e");
    parseManuel("questlog.php?which=6&vl=f");
    parseManuel("questlog.php?which=6&vl=g");
    parseManuel("questlog.php?which=6&vl=h");
    parseManuel("questlog.php?which=6&vl=i");
    parseManuel("questlog.php?which=6&vl=j");
    parseManuel("questlog.php?which=6&vl=k");
    parseManuel("questlog.php?which=6&vl=l");
    parseManuel("questlog.php?which=6&vl=m");
    parseManuel("questlog.php?which=6&vl=n");
    parseManuel("questlog.php?which=6&vl=o");
    parseManuel("questlog.php?which=6&vl=p");
    parseManuel("questlog.php?which=6&vl=q");
    parseManuel("questlog.php?which=6&vl=r");
    parseManuel("questlog.php?which=6&vl=s");
    parseManuel("questlog.php?which=6&vl=t");
    parseManuel("questlog.php?which=6&vl=u");
    parseManuel("questlog.php?which=6&vl=v");
    parseManuel("questlog.php?which=6&vl=w");
    parseManuel("questlog.php?which=6&vl=x");
    parseManuel("questlog.php?which=6&vl=y");
    parseManuel("questlog.php?which=6&vl=z");
    parseManuel("questlog.php?which=6&vl=-");
}

void main()
{
    print("Checking Monster Manuel...", "blue");
    parseall();
    print("Done checking Monster Manuel!", "blue");
    print( "Monster Manuel has told you about " + monsters.count() + " different monsters" );
    map_to_file( monsters, "monster_map.txt" );
    print( "Raw data saved to monster_map.txt in your 'data' directory." );
    foreach id, data in monsters {
	string name = data.name;
	string image = data.image;
	monster mon = name.to_monster();
	if ( mon.to_string() == "none" ){
	    mon = image_to_monster( image );
	}
	if ( mon.to_string() == "none" ){
	    print( "Discrepancy: KoLmafia could not find monster '" + name + "' with id " + id );
	}
	else if ( mon.id != id ) {
	    print( "Discrepancy: Manuel says monster '" + name + "' has id " + id + " but KolMafia thinks it is id " + mon.id );
	}
    }
}

Here is what I get when I run it:

> manuel.ash

Checking Monster Manuel...
Done checking Monster Manuel!
Monster Manuel has told you about 1525 different monsters
Raw data saved to monster_map.txt in your 'data' directory.
Discrepancy: Manuel says monster 'Boss Bat' has id 49 but KolMafia thinks it is id 48
Discrepancy: Manuel says monster 'crusty hippy Vegan chef' has id 57 but KolMafia thinks it is id 570
Discrepancy: Manuel says monster 'Orcish Frat Boy' has id 62 but KolMafia thinks it is id 527
Discrepancy: Manuel says monster 'Orcish Frat Boy' has id 63 but KolMafia thinks it is id 527
Discrepancy: Manuel says monster 'Ninja Snowman' has id 100 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Ninja Snowman' has id 137 but KolMafia thinks it is id 0
Discrepancy: KoLmafia could not find monster '(shadow opponent)' with id 210
Discrepancy: Manuel says monster 'mimic' has id 287 but KolMafia thinks it is id 283
Discrepancy: Manuel says monster 'mimic' has id 288 but KolMafia thinks it is id 283
Discrepancy: Manuel says monster 'mimic' has id 289 but KolMafia thinks it is id 283
Discrepancy: Manuel says monster 'Candied Yam Golem' has id 317 but KolMafia thinks it is id 318
Discrepancy: Manuel says monster 'Astronomer' has id 354 but KolMafia thinks it is id 184
Discrepancy: Manuel says monster 'Higher Plane Serpents' has id 368 but KolMafia thinks it is id 367
Discrepancy: Manuel says monster 'animated nightstand' has id 391 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'animated nightstand' has id 399 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'animated nightstand' has id 406 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'animated nightstand' has id 407 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'ancient protector spirit' has id 442 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'ancient protector spirit' has id 443 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'ancient protector spirit' has id 444 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'ancient protector spirit' has id 445 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'ancient protector spirit' has id 446 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'skeletal sommelier' has id 455 but KolMafia thinks it is id 714
Discrepancy: Manuel says monster 'giant giant giant centipede' has id 462 but KolMafia thinks it is id 472
Discrepancy: Manuel says monster 'erudite gremlin' has id 546 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'erudite gremlin' has id 547 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'batwinged gremlin' has id 548 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'batwinged gremlin' has id 549 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'vegetable gremlin' has id 550 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'vegetable gremlin' has id 551 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'spider gremlin' has id 552 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'spider gremlin' has id 553 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'clingy pirate' has id 626 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'clingy pirate' has id 627 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'menacing construct' has id 664 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'bizarre construct' has id 665 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'industrious construct' has id 666 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'towering construct' has id 667 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'lonely construct' has id 668 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'hulking construct' has id 669 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'menacing construct' has id 670 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'bizarre construct' has id 671 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'industrious construct' has id 672 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'towering construct' has id 673 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'lonely construct' has id 674 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'hulking construct' has id 675 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'guard turtle' has id 783 but KolMafia thinks it is id 782
Discrepancy: Manuel says monster 'Slime Tube monster' has id 791 but KolMafia thinks it is id 1706
Discrepancy: Manuel says monster 'high priest of Ki'rhuss' has id 829 but KolMafia thinks it is id 8290
Discrepancy: Manuel says monster 'Mob Penguin Goon' has id 906 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster '[somebody else's butt]' has id 1049 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Hobelf' has id 1050 but KolMafia thinks it is id 1031
Discrepancy: Manuel says monster 'Troll Twins' has id 1244 but KolMafia thinks it is id 144
Discrepancy: Manuel says monster 'Falls-From-Sky' has id 1386 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Great Wolf of the Air' has id 1387 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Zombie Homeowners' Association' has id 1388 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Mayor Ghost' has id 1389 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'Count Drunkula' has id 1390 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'The Unkillable Skeleton' has id 1391 but KolMafia thinks it is id 0
Discrepancy: Manuel says monster 'spooky vampire' has id 1414 but KolMafia thinks it is id 1
Discrepancy: Manuel says monster 'junksprite sharpener' has id 1436 but KolMafia thinks it is id 1437
Discrepancy: Manuel says monster 'Adventurer echo' has id 1595 but KolMafia thinks it is id 1596
Discrepancy: Manuel says monster 'piranhadon' has id 1601 but KolMafia thinks it is id 1608
Discrepancy: KoLmafia could not find monster 'Veracity the Adventurer' with id 1669
Discrepancy: Manuel says monster 'devil' has id 1731 but KolMafia thinks it is id 1831
Discrepancy: Manuel says monster 'queen bee' has id 1733 but KolMafia thinks it is id 1083
Discrepancy: Manuel says monster 'ghost' has id 1739 but KolMafia thinks it is id 950
The following seem to be clearly incorrect:

Code:
Discrepancy: Manuel says monster 'Boss Bat' has id 49 but KolMafia thinks it is id 48
Discrepancy: Manuel says monster 'crusty hippy Vegan chef' has id 57 but KolMafia thinks it is id 570
Discrepancy: Manuel says monster 'Candied Yam Golem' has id 317 but KolMafia thinks it is id 318
Discrepancy: Manuel says monster 'Higher Plane Serpents' has id 368 but KolMafia thinks it is id 367
Discrepancy: Manuel says monster 'giant giant giant centipede' has id 462 but KolMafia thinks it is id 472
Discrepancy: Manuel says monster 'high priest of Ki'rhuss' has id 829 but KolMafia thinks it is id 8290
Discrepancy: Manuel says monster 'Troll Twins' has id 1244 but KolMafia thinks it is id 144
Discrepancy: Manuel says monster 'junksprite sharpener' has id 1436 but KolMafia thinks it is id 1437
Discrepancy: Manuel says monster 'Adventurer echo' has id 1595 but KolMafia thinks it is id 1596
Discrepancy: Manuel says monster 'piranhadon' has id 1601 but KolMafia thinks it is id 1608
Discrepancy: Manuel says monster 'devil' has id 1731 but KolMafia thinks it is id 1831
Here are the "obsolete" monsters:

Code:
Discrepancy: Manuel says monster 'Astronomer' has id 354 but KolMafia thinks it is id 184
(354) is Astronomer (obsolete)

Discrepancy: Manuel says monster 'skeletal sommelier' has id 455 but KolMafia thinks it is id 714
(455) is skeletal sommelier (obsolete)

This script generates data/monster_map.txt with the raw data: id -> ( image, name )

For your amusement, I attach it.
 

Attachments

  • monster_map.txt
    53.2 KB · Views: 383
Last edited:

Veracity

Developer
Staff member
By the way - those 11 that my script reported are exactly the ones that ckb reported. Nice job!
 
Top