Crimbo 2010

slyz

Developer
I think you need to change to_item(doodad) to to_int(to_item(doodad)). Doing this worked for me:
PHP:
> ashq visit_url("crimbo10.php?place=giftshop&pwd&action=buygift&whichitem=4856&howmany=1");

You acquire an item: paperclip
You spent 5 CRIMBCO scrip
 

Bale

Minion
Oh ick. Yeah, I used to_int() like that in an earlier version of this before I screwed it up and posted. :(

Fortunately you found my error. I missed place=giftshop
 

slyz

Developer
PHP:
> ashq visit_url("crimbo10.php?pwd&action=buygift&whichitem=4856&howmany=1");

You acquire an item: paperclip
You spent 5 CRIMBCO scrip
the "place=giftshop" isn't needed though.
 

Bale

Minion
Hah? Then I must have made a different error when I wasn't making this error? I must be muzzy-headed. Long Sunday.
 

mredge73

Member
Update to my original script.
Nothing really new, uses Slyz's adventure method and is now a stand alone script that will adventure to a specified maximum boredom level.
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 ) 
	{ 
		if( contains_text( page , "choice.php" )  )Abort("Unknown Choice");			
		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; 
	}  

void main(int maxBoredom)
{	
	if( !contains_text( visit_url( "mountains.php" ) , "crimbcohq.gif" ) )
	{
		print( "I'm sorry, Crimbo2010 is currently closed!","red" );
		return;
	}	
	Print("Crimbo 2010, Wasteing Adventures the Easy Way","blue");
	int B = boredom_level();
	int S=item_amount($item[CRIMBCO scrip]);
	int A= my_adventures();
	print("Starting Boredom: "+B+"%","blue"); 	
	
	while( B < maxBoredom && my_adventures()!=0 )
	{
		adventure(1, $location[CRIMBCO cubicles]);
		B += boredom_inc( run_combat() );  
		print("Boredom: "+B+"%","olive"); 
	}		
	S=(item_amount($item[CRIMBCO scrip])-S);
	A=(A- my_adventures());
	print("");
	print("Finish Boredom: "+B+"%","red"); 
	print("You gained "+S+" script using "+A+" adventures.","blue");
	if(A==0) A=1;
	print("SPA: "+(S/A),"green");
	print("Current Crimbco Scrip: "+item_amount($item[CRIMBCO scrip]),"green");
}
 

LARRYT3HCABLEGU

New member
@mredge73 u need to add something to check for the adventure Uh Ohh! if you dont it will fail and make you manually adventure there ...

i did this:
PHP:
while( B < maxBoredom && my_adventures()!=0 )
    {
        if(contains_text(visit_url("adventure.php?snarfblat=247"),"As you're headed to the cubicles, you're nearly deafened by a blaring announcement from the loudspeaker."))
	{
		visit_url("crimbo10.php?place=office");
	}
        adventure(1, $location[CRIMBCO cubicles]);
        B += boredom_inc( run_combat() );  
        print("Boredom: "+B+"%","olive"); 
    }
and it worked out great... if anyone knows an easier method please share
 

Theraze

Active member
None of those adventures and needed visits to Mr. Mination have been detected for as yet, including the initial triggering. Not having these in helps to present that mafia isn't being used to skip the content, just speed up the automated part.

Though a suggestion for the edge script? Change my_adventures() != 0 to my_adventures() > 0. If you have less than 0 adventures due to some sort of bug or server lag or the like, you don't want to get into an infinite loop.
 

LARRYT3HCABLEGU

New member
None of those adventures and needed visits to Mr. Mination have been detected for as yet, including the initial triggering. Not having these in helps to present that mafia isn't being used to skip the content, just speed up the automated part.

hmm i see... i just thoguht it would help those with more than one account that cant be bothered with it... i have 2 accounts myself that i currently use and i dont like to read (or see ) something twice (or have mafia tell me to go visit someone and have to load the mini- or relay-browser and click on his office, gets annoying when i just wanna get my scrip, do my bounties, and spend the rest of the day in the chat lol)
hope its not to much of a bother though... if need be ill take it off...
 

Theraze

Active member
I've run more than that. After the first one gets into a loop though, you cancel out of the script, click on the cubicles, get the message, go to Mination, run manual adventures until you see the new monster(s), and go back to the script. Then further players will just log in, click on cubicle, click on Mination, and run the script. Total delay for a new character? ~10 seconds. And nothing says you have to READ what's on the screen. Though I do suggest doing it the first time. It's good stuff. Especially the dictated messages. :)
 

mredge73

Member
I thought that my line:
if( contains_text( page , "choice.php" ) )Abort("Unknown Choice");
Would have caught that issue but I didn't test it. It may catch any unknown choices, but I am not sure.
 

Theraze

Active member
It would have... if it were a choice adventure. If you notice, his is just matching on the text, which is why it captures it.

A fix would be verifying that adventures is actually going down. If you try to run an adventure and it doesn't decrement, you could break out of the automation...
 

Fluxxdog

Active member
Code:
if( !contains_text( page , "<b>Combat!</b>" )  )Abort("Unknown Encounter");
That should fit the bill nicely. Anything non-combat will cause a halt. Especially if we get more surprises. Which we almost undoubtedly will.
 

relyk

New member
Using this works fine for me, since i'm not concerned with BGE forms and can just buy the tea manually. From what i've read, is it hard/bad on the server to check boredom every adventure?

Code:
void main()
{
int B = 999;
	while( my_adventures() != 0 ){
		matcher Boredom=create_matcher("Boredom:</td><td><b><font color=blue>(\\d+)%", visit_url("charpane.php"));	
		if(Boredom.find())B =Boredom.group(1).to_int();
		print(" You currently have "+B+"% boredom.");
		
		if( B >= 25){
			cli_execute("use Workytime Tea");
		}

		visit_url( "adventure.php?snarfblat=247" );
		run_combat();
	}
}
 

Ferdawoon

Member
Maybe it is just me, but I set my Maximize Mainstat outfit, go for the CRIMBCO lanyard (or whatever it is called) and set Mafia to do 50 adv in the cubilces, use 2 tea, 50 more adv, 2 tea, and so on, with a custom combat setting to Olfaction the conference calls.
Sure, using mafia to burn 50 in a go is automation, but I dont see why you need a script to see your boredom level :eek:
If I was any good at scripting though I would probably write my own script to do the equipping, adventuring and tea drinking by itself. But, it is not like it is troublesome to do it manually.
 
Top