Crimbo 2010

Fluxxdog

Active member
Fair enough. I'm farming scrips for my clan so we can get a fax machine (optimal or not be damned!) and forsaking semirares. So my play style is going to be violently different from yours.
 

huvanile

New member
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)
 

lostcalpolydude

Developer
Staff member
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)

It's recognized in 8833. You must have an old version.
 

huvanile

New member
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.
 

charred

Member
adding my 2 cents also. i full support automation of crimbo. i went through the zone once and checked everything out and laughed at all the hilarity and loved it. but now its on to scrip farming business and it saves me real life time. i already edited my adventures and zonelist a couple days ago. ive just been doing it very rudamentary today.
ive just been typing in the gcli
adventure 50 crimbco cubicles
then after the 50 advs
use workytime tea; adventure 25 crimbco cubicles
and repeating that until im done
yeah it sucks real bad compared to the scripts here, but being such a short time period im fine with crappy :) it works for me
 

Theraze

Active member
Slight tweaks to my adventure script. Wanted it to be less nasty server-wise, so using this to clean it up a bit.
PHP:
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!");}

Basically, it checks the charpane the first time, displays boredom level from that, and then runs up to 50 boredom if not there yet. If beaten up, try to uneffect it. If not, we won, so increment boredom count. Since it only runs up to 50, I don't need to worry about if I want to Workytime or not, and whether or not I win the BGE and so need to subtract 50 boredom.

Since BGE items got released, I think my current run will be running the script to check boredom, then after the adventures finish (if need be), run the rest of adventures. Maybe run the script again after, to do a 1-page hit to check boredom... less server impact then actually loading the relay browser and having it load 4 panes.
 

Ferdawoon

Member
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.

I recommend getting the exe file from here: http://kolmafia.us/showthread.php?2856-Automatically-download-the-newest-daily-build
That is what I have stickied to my actionbar, so that whenever I start Mafia using that shortcut it check for a more recent version, download it and then start it.
 
After quite a bit of reading and experience with this Crimbo, I feel it's pretty safe to suggest that automation is no longer a huge issue. Lag seems to be all but nonexistent, and as for my reasons against automation (i.e. not enjoying the actual content) it generally takes a day for mafia to catch up, and players will have time to experience a chunk of it before automation becomes possible (for mafia, that is. I have nothing to say in regards to other techniques)
I'd still like it if there was maybe a week before it was implemented for the masses, though, so that the common player is more likely to read the actual adventure text (remember why you started playing KoL? This shit is hilarious.)
Jick seems rather apathetic about it all, and that's not necessarily a good sign for either argument.

That said and done, there is still a flaw with this:
For : 10
Against : 3
Undecided : 1

You assume that each person should have equal say in this... what is this? Debate? Decision? Whatever. And that's just not true. I'm not one to judge who's opinion is worth more or less, but I can say that they are not equal.
 

slyz

Developer
If beaten up, try to uneffect it. If not, we won, so increment boredom count.
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.

Another solution would be to parse the last combat page, returned by run_combat() without any additional server hit.
 

Theraze

Active member
So, tomorrow I try this:
PHP:
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!");}
 

slyz

Developer
I could test it today, and everything seemed to work. Here are the functions I use (the matcher accounts for the -50% boredom from the BGE, but I only tested this with a specific string, not with the actual BGE combat page):
PHP:
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;
}
and I simply use boredom_inc() like this:
PHP:
adventure( 1, $location[CRIMBCO cubicles] );
total_boredom_level += boredom_inc( run_combat() );
 

Theraze

Active member
Spiffy. Put both of those in there, so now it should work for compact pane or full, and properly -50 at BGE. If I let it. :) I'm still stopping at 50 on the script for now, but eventually will probably change that up. Speaking of which, I should really be running these adventures against my trackitems alias, so I can just get my scrip/form count at the end without needing to switch back to the adventure tab. Heh.
 

slyz

Developer
I went back a few pages in the thread but skipped heeheehee's regex. Fixed:
PHP:
int boredom_level() 
{ 
    matcher Boredom = create_matcher( "Bored.+?(\\d+)%", visit_url( "charpane.php" ) ); 
    if( Boredom.find() ) return Boredom.group( 1 ).to_int();
    return 0; 
}
 

Bale

Minion
Can anyone help me with the code to turn in crimbco scrip at the gift store. I have this, but it doesn't seem to work:

Code:
void crimbo_gift(item doodad, item q) {
	visit_url("crimbo10.php?action=buygift&pwd&whichitem="+to_item(doodad)+"&howmany="+q);
}

What should that be?
 

Veracity

Developer
Staff member
Should we have "coinmaster buy" and "coinmaster sell" commands, or something of the sort, to obviate visit_url to do the same thing?
 
Top