void Crimbo2010(){
Print("Crimbo 2010, Wasting Adventures the Easy Way","blue");
if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) ){
print( "I'm sorry, Crimbo2010 is currently closed!","red" );
return;}
int start_boredom_level(){
matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));
if(Boredom.find()) return to_int(Boredom.group(1));
return 0;}
int total_boredom_level=start_boredom_level();
while( total_boredom_level < 50 && my_adventures()>0 ){
bbsaction();
string page_text = visit_url( "adventure.php?snarfblat=247" );
if( contains_text( page_text , "Combat" ) ){
buffer finale=visit_url("fight.php?action=macro¯otext=use facsimile dictionary; repeat !pastround 9; attack; repeat");
matcher boredom_test=create_matcher("<td valign=center><b>Boredom \\+(\\d+)%", finale);
if(boredom_test.find()){
total_boredom_level+=to_int(boredom_test.group(1));}
print("Boredom level:"+total_boredom_level);}
else if( contains_text( page_text , "choice.php" ) ) abort("Unknown Choice");}
print("Done!");}