use_skill(1,$skill[Lunch Break]);
Speaking of Crimbo 2010 stuff: I'm trying to use the Lunch Break skill into my breakfast scripts through the following code:
Code:use_skill(1,$skill[Lunch Break]);
I'm getting the error, "Bad skill value: "Lunch Break" (sandbox.ash, line 1)". Any ideas?
(Didn't know where else to post this we can move it if necessary)
Hmm... Not sure what 8833 references (sorry); I'm running KoLmafia v14.3, released on October 19 2010 (latest stable release on sourceForge site). Is there a separate library or file or something I should manually update? Thanks for the help.
void Crimbco2010(){
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();
print("Starting Boredom level: "+total_boredom_level);
while( total_boredom_level < 50 && my_adventures()>0 ){
(!adventure(1, $location[CRIMBCO cubicles]));
if (have_effect($effect[beaten up]) > 0) cli_execute ("uneffect beaten up");
else total_boredom_level += 1;
print("Boredom level: "+total_boredom_level);}
print("Done!");}
Hmm... Not sure what 8833 references (sorry); I'm running KoLmafia v14.3, released on October 19 2010 (latest stable release on sourceForge site). Is there a separate library or file or something I should manually update? Thanks for the help.
For : 10
Against : 3
Undecided : 1
Couldn't Beaten Up be removed by your auto-restore settings at the end of adventure()? I think auto-restore runs before adventuring though, so it's probably not a problem.If beaten up, try to uneffect it. If not, we won, so increment boredom count.
void main(){
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();
print("Starting Boredom level: "+total_boredom_level);
while( total_boredom_level < 50 && my_adventures()>0 ){
adventure(1, $location[CRIMBCO cubicles]);
buffer finale=run_combat();
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);}
print("Done!");}
int boredom_level()
{
buffer charpane = visit_url( "charpane.php" );
// Full
matcher Boredom = create_matcher( "Boredom:</td><td><b><font color=blue>(\\d+)%", charpane );
if( Boredom.find() ) return Boredom.group( 1 ).to_int();
// Compact
matcher Bored = create_matcher("Bored:</td><td aligh=left><b><font color=blue>(\\d+)%", charpane );
if( Bored.find() ) return Bored.group( 1 ).to_int();
return 0;
}
int boredom_inc( string page )
{
matcher bored_inc = create_matcher( "<td valign=center><b>Boredom (\\+|-)(\\d+)%", page );
if( bored_inc.find() )
{
int fac = 1;
if( bored_inc.group( 1 ) == "-" ) fac = -1;
return fac * bored_inc.group( 2 ).to_int();
}
return 0;
}
adventure( 1, $location[CRIMBCO cubicles] );
total_boredom_level += boredom_inc( run_combat() );
Also, to work for weirdos who have the compact charpane, the regex input string should be "Bored.+?(\\d+)%".