missingManuel.ash - Yet Another Manuel Script!

Yup. I haven't mentioned it in this thread because I'm more concerned with the fact that KoLmafia does not yet support either the winged yet or <yourname> the Adventurer, so there is little that missingManuel can do to support those two monsters. I've been waiting for KoLmafia to handle those before I made a post about all three problems. :(
 
KoL now has two monsters called $monster[Your winged yeti] and $monster[You the Adventurer] which missingManuel will have to recognize even though their entries in the Manuel won't use those names.

Turing, I'd recommend that you simply pick them out and identify them by their first factoids.

Your winged yeti can have any name, but it's first factoid is always, "The names of the yetis never really changed, per se, everyone just started using a new method for transliterating the Yeti language into English characters."

You the Adventurer will be my_name() + " the Adventurer" and his first factoid is my_name() + " is largely made of carbon." So for me, that first factoid is "Bale is largely made of carbon."
 
If someone updates their name capitalization, my_name() won't update to match (at least not in that session, I'm not sure when it updates), but the factoid does, so that's a thing to keep in mind.
 
So, non-case sensitive matching is necessary. In case Turing needs to know, contains_text() does case sensitive matching so I recommend using to_lower_case(). Though comparing two strings with == is case insensitive, so if that will work for you...

> ash ("AAA" == "aaa")

Returned: true

> ash "AAA".contains_text("a");

Returned: false
 
Eventually this script (or another one) can just use monster ids instead of caring about names. I'm slowly adding those by hand to mafia.
 
Eventually this script (or another one) can just use monster ids instead of caring about names. I'm slowly adding those by hand to mafia.

Good point!

Do you need any help finding monster IDs? I've got every monster in my Manuel, so if you are lacking any?
 
The work is mostly typing each value into monsters.txt. I'm running
Code:
string letter = "l";

string page = visit_url( "questlog.php?which=6&vl=" + letter + "&filter=0" );

matcher monString = create_matcher( "<a name='mon(\\d+).*?small><b><font size=\\+2>(.*?)</font>", page );

while ( monString.find() )
{
	print_html( monString.group(2) + " * " + monString.group(1) );
}
to get usable output, 1 page at a time. (Someone in Heavy Rains could grab all of it in 1 page load, but that's not the bottleneck anyway.) I have everything but a few tower monsters, and I think a check for id = 0 once the bulk of the work is done will catch the last few.

Some ids can't be added because mafia uses 1 monster where KoL uses 2, or vice versa, and for now I'm just adding comments to the file. So there will still need to be some special handling from this script, but less than there is now at least.
 
If this helps, I wrote a script for manuel parsing that grabs the key info for each monster and drops it into a record. The relevant code is this:

Code:
record manrec {
	int id;
	string name;
	string img;
	string atk;
	string def;
	string hp;
	string fone;
};

void ParseMan(string url) {
	string page = visit_url(url);
	//build regex string to pase manuel of all monster details
	string manex = "";
	//(1: id #)
	manex += "a name=\\'mon(\\d+)";
	//(2: image.gif)
	manex += ".+?(?:adventureimages|otherimages)\\/(.+?.gif)";
	//(3: atk)
	manex += ".+?<font size=\\+2>([^<]+?)<\\/font><\\/b><\\/td>";
	//(4: monster name)
	manex += ".+?<font size=\\+2>([^<]+?)<\\/font><\\/b><ul>";
	//(5: all factoids, including intermediary <li>'s)
	manex += "<li>(.+?)<\\/ul>";
	//(6: defense)
	manex += ".+?<font size=\\+2>([^<]+?)<\\/font><\\/b><\\/td>";
	//(7: hp)
	manex += ".+?<font size=\\+2>([^<]+?)<\\/font><\\/b><\\/td>";
	matcher onem = create_matcher(manex, page);
	while (onem.find()) {
		manrec mm;
		mm.id = to_int(onem.group(1));
		mm.img =  onem.group(2);
		mm.atk = onem.group(3);
		mm.name = onem.group(4);
		mm.def = onem.group(6);
		mm.hp = onem.group(7);
		string[int] facts = split_string(onem.group(5),"<li>");
		mm.fone = facts[0];
		mm.name = FixMon(mm);
	}
	
}
 
Which ones? I can look those up for you.

=================================
[Hottest Adventurer Contest]
Fire Fighter {3}
Cereal Arsonist {3}
Burnglar {3}
The Lavalier {3}
=================================
[Coldest Adventurer Contest]
Snowbrawler {3}
Ice Cream Conjurer {3}
Iceberglar {3}
=================================
[Sleaziest Adventurer Contest]
Grease Trapper {3}
Porkpocket {3}

Ideally someone would write something (probably not a mafia script, but it could be one) that can fill in monster ids into monsters.txt to avoid typing in hundreds of numbers. Other than that, my script works well enough for me.
 
=================================
[Hottest Adventurer Contest]
Fire Fighter {3} mon1686
Cereal Arsonist {3} mon1687
Burnglar {3} mon1688
The Lavalier {3} mon1689
=================================
[Coldest Adventurer Contest]
Snowbrawler {3} mon1690
Ice Cream Conjurer {3} mon1691
Iceberglar {3} mon1692
=================================
[Sleaziest Adventurer Contest]
Grease Trapper {3} mon1702
Porkpocket {3} mon1704
 
Ghost, Yeti, and You should all be working now. Also grouped Ed bosses, and added the bunch of rats and drunken rat king back to the cellar category (which had a name change at some point).
 
Code:
=================================
[Coldest Adventurer Contest]
Snowbrawler {1}
Mrs. Freeze {2}
=================================
[Unsorted]
ghost (spelunky) {1}
=================================
Very nice. But, why is the "ghost (spelunky)" in the "Unsorted" category? Do you not have a "Spelunky" category?
 
Thanks, Turing!

Done checking Monster Manuel!
=================================
[Hottest Adventurer Contest]
Fire Fighter {1}
The Lavalier {2}
=================================
[Coldest Adventurer Contest]
Mrs. Freeze {1}
=================================
[Stinkiest Adventurer Contest]
Assassin {1}
Odorous Humongous {2}
=================================

You have casually researched 2 creatures.
You have thoroughly researched 3 creatures.
You have exhaustively researched 1476 creatures.
You have not researched 0 creatures.
Total creatures: 1481.
Done.

Works perfectly now! Shame that's not likely to change until Ed is no longer current, but I've gotten this far with patience and the refusal to let Manuel rule my life. I refuse to change that determination now.
 
Very nice. But, why is the "ghost (spelunky)" in the "Unsorted" category? Do you not have a "Spelunky" category?

I wanted to do a bit more grouping with the stuff that's in Unsorted, but didn't have time, and wanted to push the actual bug fixes first.
 
Turing, if you care, there is now another way to disambiguate monsters in Manuel. They all have a monster number and KoLmafia now knows how to identify those monster numbers. For example, the queen bees are mon1083 and mon1733 as shown below:

HTML:
<a name='mon1083'></a><table width=95%><tr><td colspan=6 height=1 bgcolor=black></td></tr><tr><td rowspan=4 valign=top width=100><img src=/images/adventureimages/beequeen.gif style="max-width:350;"></td><td width=30><img src=/images/itemimages/nicesword.gif width=30 height=30 alt="Attack Power (approximate)" title="Attack Power (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>?</font></b></td><td width=30><img src=/images/itemimages/stinkbug.gif alt="This monster is a Bug" title="This monster is a Bug" width=30 height=30></td><td rowspan=4 width=10></td><td rowspan=4 valign=top class=small><b><font size=+2>Queen Bee</font></b><ul><li>The Queen Bee is constantly pregnant. She's a sex machine ready to reload.<li>The Queen Bee doesn't need to communicate where the pollen is, so don't ask her to do the fandango.<li>The Queen Bee's royal consorts are known as the Princes of the Universe.</ul></td></tr><tr><td width=30><img src=/images/itemimages/whiteshield.gif width=30 height=30 alt="Defense (approximate)" title="Defense (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>?</font></b></td><td width=30><img src=/images/itemimages/circle.gif width=30 height=30 alt="This monster has no particular elemental alignment." title="This monster has no particular elemental alignment."></td></tr><tr><td width=30><img src=/images/itemimages/hp.gif width=30 height=30 alt="Hit Points (approximate)" title="Hit Points (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>?</font></b></td><td width=30><img src=/images/itemimages/snail.gif alt="Never wins initiative" title="Never wins initiative" width=30 height=30></td></tr><tr><td></td><td></td></tr></table><a name='mon1733'></a><table width=95%><tr><td colspan=6 height=1 bgcolor=black></td></tr><tr><td rowspan=4 valign=top width=100><img src=/images/adventureimages/spelunkbeeq.gif style="max-width:350;"></td><td width=30><img src=/images/itemimages/nicesword.gif width=30 height=30 alt="Attack Power (approximate)" title="Attack Power (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>60</font></b></td><td width=30><img src=/images/itemimages/stinkbug.gif alt="This monster is a Bug" title="This monster is a Bug" width=30 height=30></td><td rowspan=4 width=10></td><td rowspan=4 valign=top class=small><b><font size=+2>queen bee</font></b><ul><li>Queen bees are several times the size of normal bees, but they have a surprisingly low density.<li>Queen bees are especially vulnerable to dynamite and laser beams.<li>The plural of "queen bee" is actually "queens bee," but nobody actually says that because it sounds stupid.</ul></td></tr><tr><td width=30><img src=/images/itemimages/whiteshield.gif width=30 height=30 alt="Defense (approximate)" title="Defense (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>60</font></b></td><td width=30><img src=/images/itemimages/circle.gif width=30 height=30 alt="This monster has no particular elemental alignment." title="This monster has no particular elemental alignment."></td></tr><tr><td width=30><img src=/images/itemimages/hp.gif width=30 height=30 alt="Hit Points (approximate)" title="Hit Points (approximate)"></td><td width=50 valign=center align=left><b><font size=+2>60</font></b></td><td width=30><img src=/images/itemimages/snail.gif alt="Never wins initiative" title="Never wins initiative" width=30 height=30></td></tr><tr><td></td><td></td></tr></table>

If you parsed those out of the html, then according to KoLmafia:

> ashq to_monster(1083).print()

Queen Bee

> ashq to_monster(1733).print()

queen bee (spelunky)

While your script does work now, I just thought I'd point out a new KoLmafia feature that your script can fall back on to identify new monsters without needing you to add special cases for each.
 
1.24 has been uploaded. Fixed Ed the Undying and removed the extra Shadow monsters.

I just logged in and saw that there was a new version of missing maneul. That fix seems to have broken the script...

> call scripts/missingManuel.ash

Bad monster value: "Shadow Accordion Thief" (missingManuel.ash, line 91)
 
Back
Top