BRICKOS summoning (hopefully I haven't butchered the ash language!)

So here is what I am using. It is very simple but works well for me.
Code:
# http://kolmafia.us/showthread.php?3456-BRICKOS-summoning-%28hopefully-I-haven-t-butchered-the-ash-language!%29/page2
void main( int adv_to_use )
{

     while ( adv_to_use > 0 )
     {
         if ( my_mp() > mp_cost($skill[Summon BRICKOs])+12 )
               cli_execute("cast * BRICKOs");
         
         adventure(1, $location[Giants Castle]);
         adv_to_use = adv_to_use - 1;
     }
}
 
The only issue (once per day, at most) is that after the initial cast, you might be left with < 12 MP (if it casts multiple times and the last one brings you under 12 MP).
 
Hi,

I still have some trouble with this part of the script I am using:

Code:
	string oldMall = get_property("autoSatisfyWithMall");
	string oldNPCs = get_property("autoSatisfyWithNPCs");

	set_property("autoSatisfyWithMall" , "false");
	set_property("autoSatisfyWithNPCs" , "false");

	while ( adv_to_use > 0 ) {
		int c = to_int(get_property("libramSummons"));
		int j = 0;
		while(my_mp()-65>((j+c)*(j+c+1)*(j+c+2)/6)-(j+c*(j+c-1)/2)-(c*(c+1)*(c+2)/6)-(c*(c-1)/2)) {
			j=j+1;
		}
		use_skill(j, $skill[Summon BRICKOs]); 
		adventure(1, $location[Giants Castle]);
		adv_to_use = adv_to_use - 1;
	}

	set_property("autoSatisfyWithMall" , oldMall);
	set_property("autoSatisfyWithNPCs" , oldNPCs);

I had to remove the part with storing the autoSatisfy values because the script sometimes crashed. A few things: There are some brackets missing, I also believe that the last minus in the formula should be a plus.

Curious enough: Like this the formula ALWAYS returned a negative number, thus making the condition true. BUT it still worked. Does anyone have a idea why?

Anyway, back to my problem, I am now using this:

Code:
if (my_name() == "ki77bot" && have_skill($skill[Summon BRICKOs])){
	set_property("autoSatisfyWithMall" , "false");
	set_property("autoSatisfyWithNPCs" , "false");
	int adv_to_use = farm_cycle * 10;
	while ( adv_to_use > 0 ) {
		int c = to_int(get_property("libramSummons"));
		int j = 0;
		while((my_mp()-51)>(((j+c)*(j+c+1)*(j+c+2)/6)-((j+c)*(j+c-1)/2)-(c*(c+1)*(c+2)/6)+(c*(c-1)/2))) {
			j=j+1;
		}
		use_skill(j, $skill[Summon BRICKOs]); 
		adventure(1, $location[Giants Castle]);
		adv_to_use = adv_to_use - 1;
	}
} else {	
adventure(( farm_cycle * 10 ), $location[Giant's Castle]);
}

	set_property("autoSatisfyWithMall" , "true");
	set_property("autoSatisfyWithNPCs" , "true");

And it should - at least the way I understand the formula - ALWAYS leave me with at least 51 MP, right? (50 MP = Olfaction and Leash) Somehow I end up with less than that, and I have no idea why this happens. Can anyone give an explanation to this?

Cheers
ki77bot
 
When j = 0, then j+c = c. Therefore you've got a problem. You could fix the the way you use the forum, add 1 to the first part of the formula, or else only summon j-1 brickos.

At least I'm pretty sure that will do the job.

Curious enough: Like this the formula ALWAYS returned a negative number, thus making the condition true. BUT it still worked. Does anyone have a idea why?
It wasn't ALWAYS negative. Once j was high enough it would stop looping although j reached ridiculous levels. That's why you needed to turn off buying. It was never working quite right.
 
It wasn't ALWAYS negative. Once j was high enough it would stop looping although j reached ridiculous levels. That's why you needed to turn off buying. It was never working quite right.

Hmmm, but the way I am using this, is that the NPZR keeps generating MP. So usually the script will summon a bunch of BRICKOs in the beginning and after that j almost NEVER becomes greater than 1...

edit:

OK, checked it and it seems to work, for people interested in the code:

Code:
if (my_name() == "ki77bot" && have_skill($skill[Summon BRICKOs])){
	set_property("autoSatisfyWithMall" , "false");
	set_property("autoSatisfyWithNPCs" , "false");
	int adv_to_use = farm_cycle * 10;
	while ( adv_to_use > 0 ) {
		int c = to_int(get_property("libramSummons"));
		int j = 0;
		while((my_mp()-51)>(((j+c+1)*(j+c+2)*(j+c+3)/6)-((j+c+1)*(j+c)/2)-(c*(c+1)*(c+2)/6)+(c*(c-1)/2))) {
			j=j+1;
		}
		use_skill(j, $skill[Summon BRICKOs]); 
		adventure(1, $location[Giants Castle]);
		adv_to_use = adv_to_use - 1;
	}

Thank you Bale! (I still don't get your explanation though, but I'd like to understand what went wrong.)

Cheers,
ki77bot.
 
Last edited:
Back
Top