> 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.
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) );
}
I have everything but a few tower monsters
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.
=================================
[Coldest Adventurer Contest]
Snowbrawler {1}
Mrs. Freeze {2}
=================================
[Unsorted]
ghost (spelunky) {1}
=================================
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.
Very nice. But, why is the "ghost (spelunky)" in the "Unsorted" category? Do you not have a "Spelunky" category?
<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>
> ashq to_monster(1083).print()
Queen Bee
> ashq to_monster(1733).print()
queen bee (spelunky)
1.24 has been uploaded. Fixed Ed the Undying and removed the extra Shadow monsters.