buffer rainy_fax(buffer page) {
page.replace_string(">Make: <", ">Make (full list):<");
buffer filter;
filter.append("<form action=choice.php method=post><input type=hidden name=pwd value=");
filter.append(my_hash());
filter.append("><input type=hidden name=whichchoice value=970>Make (useful monsters): <select name=whichmonster>");
matcher select;
foreach mon in $strings[7-Foot Dwarf Foreman, alley catfish, Baa'baa'bu'ran, Bailey's Beetle, Blooper, Bram the Stoker, dirty thieving brigand,
gaudy pirate, ghost, giant swarm of ghuol whelps, Knob Goblin Elite Guard Captain, lobsterfrogman, mountain man, modern zmobie, ninja snowman assassin,
Orcish Frat Boy Spy, piranhadon, Quantum Mechanic, remains of a jilted mistress, screambat, sleepy mariachi, writing desk] {
select = create_matcher('<option value=\\d+>'+mon+'</option>', page);
if(select.find())
filter.append(select.group(0));
}
// Gremlins are trickier
filter.append('<option value=549>batwinged gremlin</option>');
filter.append('<option value=547>erudite gremlin</option>');
filter.append('<option value=553>spider gremlin</option>');
filter.append('<option value=551>vegetable gremlin</option>');
filter.append("</select><input type=hidden name=option value=1><input type=submit class=button name=choice2 value='and Fight!'></form>");
return page.insert(index_of(page, '</form><form ')+ 7, filter);
}
buffer annotate(buffer page) {
if(page.contains_text('bgcolor=blue><b>Rainy Fax Dreams on your Wedding Day</b>'))
return rainy_fax(page);
return page;
}
void main() {
switch(form_field("whichchoice")) {
case "793": // The Shore, Inc. > Gift Shop
case "189": // O Cap'm, My Cap'm > Set an Open Course for the Virgin Booty
return;
}
visit_url().annotate().write();
}