New Crypt Quest Script

So, I'm working on a script for the new Level 7 quest because it got so fiddly and my little aliases I set up for the old two-pass method don't work anymore and I have a few questions.

The new Evil tracking.. I can invoke those with
Code:
if (get_property("cyrptNookEvilness") > 0 ) {do stuff}
??

Second, I'm doing a lot of equipment changes, including unequipping and folding the legion necktie into rollerblades for the +init. I'm writing this with my softcore character in mind, but would not be adverse to making it so that my HC character can run it as well. I'm sure I could probably use the maximizer for things like "maximize items", "maximize ML +noncombat", and "maximize initiative", it probably is more difficult than that as I contemplate different classes having different combat needs (my sc dude mainly shieldbutts). I'm also wondering how I can make mafia cast the available buffs/effects it finds as well, ie sugar rush for the +init if I have any candy.

eta: Oh, another thing I just thought of, I probably only want to initially decrease the Evil in each zone to 25, then do all 4 bosses at the end with my +ML/+stat (or boss killing gear if in HC) gear on.
Code:
while ( get_property("getNicheEvilness") > 25 ) adventure(1,$location[defiled niche]);
?

Finally, at the end of all the quest fiddliness, I'd like to revert to the outfit and stuff I had on when I started. Barring having to unequip, fold, and equip the LL thing again, is that something that checkpoint() will do? I don't find any documentation for that function on the wiki.

TIA, you guys are awesome for indulging me.
 
Last edited:

slyz

Developer
You will need to turn the result of get_property() into an int if you want to compare it to 0:
PHP:
if (get_property("cyrptNookEvilness").to_int() > 0 ) {do stuff}

For the equipment, you can add checks like
PHP:
if ( available_amount( $item[ loathing legion necktie ] ) > 0 )
{
   // fold and equip 
}
so that your HC character will just skip that part.

Regarding the maximizer, you can pretty much tweak it any way you like, and use different expression whether the character is in HC or SC by checking with in_hardcore(). If you want to shieldbutt, simply add "+melee, shield" to your expression.

Regarding buffs, why not simply create a mood? You can switch to a mood by doing:
PHP:
cli_execute ( "mood cyrpt" );
Simply create a mood named "cyrpt" for all your characters with the appropriate effects.
If you want to do something more complicated, just use have_skill() and use_skill().

Regarding outfits, simply do:
PHP:
// at the beginning
cli_execute( "checkpoint" );

// at the end (after folding the legion stuff back)
cli_execute ( "outfit checkpoint" );
 
OK great. So this is what I have.
Code:
// The New Level 7 Defile Crypt Quest Optimized
// This script requires 4 moods: default, +items, +noncombat, +init
// I'm using a Bandersnatch for default familiar, Hound dog for items, Bugged Bugbear for ML, finally a Hobo monkey for the Bonerdagon
// your ccs should include an entry for the [old dirty lihc] if you have olfaction/odor extractors

familiar f_default = $familiar[bandersnatch];
familiar f_items   = $familiar[hound dog];
familiar f_ml      = $familiar[bugged bugbear];
familiar f_meat    = $familiar[hobo monkey];

boolean can_pool() {
	if (item_amount($item[vip lounge key])>0 && contains_text(visit_url("clan_viplounge.php"),"A Pool Table")) 
		return true;
	else return false; }

void CryptQuest() {
    if (my_level() >= 7) {
        council();

		if (contains_text(visit_url("questlog.php?which=1"),"Cyrptic Emanations"))  {
			cli_execute("conditions clear");
			cli_execute("checkpoint");
			
			if (get_property("cyrptNookEvilness").to_int() > 25) {
				if (!in_hardcore()) {
					equip($slot[acc3],$item[mr. accessory jr.]);
					if (item_amount($item[greatest american pants])>0) {
						equip($item[greatest american pants]);
						cli_execute("gap vision"); }
					}
				else cli_execute("maximize items");
				use_familiar(f_items);
				cli_execute("mood +items");
				cli_execute("mood execute");
				if (can_pool() && get_property("_poolGames").to_int() < 2 ) cli_execute("pool 3");
				if (item_amount($item[lavender candy heart])>0) use(1,$item[lavender candy heart]);
				if (item_amount($item[green candy heart])>0) use(1,$item[green candy heart]);
				while (get_property("cyrptNookEvilness").to_int() > 25) adventure(1, $location[Defiled Nook]); }
			
			if (get_property("cyrptNicheEvilness").to_int() > 25) {
				if (!in_hardcore()) equip($slot[acc3],$item[c.a.r.n.i.v.o.r.e.]);
				else cli_execute("outfit checkpoint");
				use_familiar(f_default);
				cli_execute("mood default");
				cli_execute("mood execute");
				while (get_property("cyrptNicheEvilness").to_int() > 25) adventure(1, $location[Defiled Niche]); }
			
			if (get_property("cyrptCrannyEvilness").to_int() > 25) {
				set_property("choiceAdventure523",4);
				if (!in_hardcore()) {
					if (my_enthroned_familiar() != $familiar[megadrone]) enthrone_familiar($familiar[megadrone]);
					equip($slot[acc2],$item[ring of conflict]); 
					}
				else {
					cli_execute("maximize ml");
					cli_execute("maximize -combat -tie"); 
					}
				if (item_amount($item[pumpkin juice])>0 || item_amount($item[pumpkin])>0 ) use(1,$item[pumpkin juice]);				
				change_mcd(10+in_mysticality_sign().to_int());
				use_familiar(f_ml);
				cli_execute("mood +noncombat");
				cli_execute("mood execute");
				while (get_property("cyrptCrannyEvilness").to_int() > 25) adventure(1, $location[Defiled Cranny]); }
			
			if (get_property("cyrptAlcoveEvilness").to_int() > 25) {
				if (!in_hardcore()) {
					equip($item[crown of thrones]);
					enthrone_familiar($familiar[potato]);
					if (item_amount($item[loathing legion necktie])>0) {
						cli_execute("fold loathing legion rollerblades");
						equip($slot[acc2],$item[loathing legion rollerblades]); }
					if (have_effect($effect[gaze of the trickster god])==0 && have_equipped($item[juju mojo mask])) {
						equip($slot[acc1],$item[none]);
						equip($slot[acc1],$item[juju mojo mask]); }  // first combat action needs to be use item
					}
				else cli_execute("maximize initiative");
				
				if ( ( ( my_class()==$class[turtle tamer] || my_class()==$class[seal clubber] ) ||
					( my_class()==$class[accordion thief] && my_level() > 8 ) ) && guild_store_available() ) {
					buy(1, $item[cheap wind-up clock]);
					use(1, $item[cheap wind-up clock]); }
				if (can_pool() && get_property("_poolGames").to_int() < 3 ) cli_execute("pool 3");
				if (item_amount($item[yellow candy heart])>0) use(1,$item[yellow candy heart]);
				if (item_amount($item[pile of candy])>0) cli_execute("use * pile of candy");
				if (item_amount($item[angry farmer candy])>0) use(1, $item[angry farmer candy]);
				use_familiar(f_default);
				cli_execute("mood +init");
				cli_execute("mood execute");
				while (get_property("cyrptAlcoveEvilness").to_int() > 25) adventure(1, $location[Defiled Alcove]);
				}				
			
			if (have_equipped($item[crown of thrones])) enthrone_familiar($familiar[megadrone]); 
			if (have_equipped($item[loathing legion rollerblades])) {
				equip($slot[acc2], $item[none]);
				cli_execute("fold loathing legion necktie");
				equip($slot[acc2], $item[loathing legion necktie]); }
			cli_execute("outfit checkpoint");
			change_mcd(10+in_mysticality_sign().to_int());
			cli_execute("mood default");
			cli_execute("mood execute");
			
			// kill sub-bosses and bonerdagon
			if (get_property("cyrptNookEvilness").to_int() > 0) adventure(1, $location[Defiled Nook]);
			if (get_property("cyrptCrannyEvilness").to_int() > 0) adventure(1, $location[Defiled Cranny]);
			if (get_property("cyrptNicheEvilness").to_int() > 0) adventure(1, $location[Defiled Niche]);
			if (get_property("cryptAlcoveEvilness").to_int() > 0) adventure(1, $location[Defiled Alcove]);
			use_familiar(f_meat); 
			adventure(1, $location[Haert of the Cyrpt]);
			if (available_amount($item[chest of the bonerdagon]) == 1) use(1, $item[chest of the bonerdagon]);
			council();
			}
		else if (contains_text(visit_url("questlog.php?which=2"),"Cyrptic Emanations")) print("You have already completed the level 7 quest.");
		else print("The level 7 quest is not currently available.");
		}
	else print("You must be at least level 7 to attempt this quest.");
	}

void main()
{
	CryptQuest();
}

I have a comment in the initiative section about getting Gaze of the Trickster if I'm not already a moxie class needing a ccs action in that area that uses an item in the first round instead of my usual entangling noodles.

I've also written a section for Bale's FinalAttack consult script to handle this since the ccs is kinda clunky (as in, its not something I want to do if I don't have the mask, ie in hardcore). I'm not actually using the consult script in run yet as I play around with it some to know what it's doing.

Code:
case $location[defiled alcove]:
	if (have_effect($effect[gaze of the trickster god])==0 && have_equipped($item[juju mojo mask])) {
	enqueue(get_action($item[seal tooth]));
	enqueue(get_action($skill[entangling noodles])); }
	if(can_splash())
            return splashSauce();
        else if(hitchance(1) < .1)
		enqueue(dangeraction(), "");
	else enqueue(get_action("attack"), "");
	return macro();
	}
Actively taking suggestions for other improvements.
 

Attachments

  • Level 7.ash
    5.4 KB · Views: 45
Last edited:

bumcheekcity

Active member
From bumcheekascend:

Code:
boolean bcascCyrpt() {
	boolean stageDone(string name) {
		if (get_revision() < 9260 && get_revision() > 0) abort("You need to update your Mafia to handle the cyrpt. A revision of at least 9260 is required. This script is only ever supported for a latest daily build.");
		print("The "+name+" is at "+get_property("cyrpt"+name+"Evilness")+"/50 Evilness...", "purple");
		return (get_property("cyrpt"+name+"Evilness") == 0);
	}

	if (checkStage("cyrpt")) return true;
	set_property("choiceAdventure523", "4");
	
	while (!stageDone("Nook")) {
		if (item_amount($item[evil eye]) > 0) use(1, $item[evil eye]);
		bumAdv($location[Defiled Nook], "", "items", "1 evil eye", "Un-Defiling the Nook (1/4)", "i");
		if (item_amount($item[evil eye]) > 0) use(1, $item[evil eye]);
	}
	while (!stageDone("Alcove")) bumAdv($location[Defiled Alcove], "", "", "", "Un-Defiling the Alcove (2/4)");
	while (!stageDone("Niche")) bumAdv($location[Defiled Niche], "", "", "", "Un-Defiling the Niche (3/4)");
	while (!stageDone("Cranny")) bumAdv($location[Defiled Cranny], "", "", "", "Un-Defiling the Cranny (4/4)");
	
	if (!contains_text(visit_url("questlog.php?which=2"), "defeated the Bonerdagon")) {
		if (my_buffedstat(my_primestat()) > 101) {
			set_property("choiceAdventure527", "1");
			bumAdv($location[Haert of the Cyrpt], "", "meatboss");
			visit_url("council.php");
			if (item_amount($item[chest of the Bonerdagon]) > 0) {
				cli_execute("use chest of the Bonerdagon");
				checkStage("cyrpt", true);
				return true;
			}
		}
	} else {
		checkStage("cyrpt", true);
		return true;
	}
}

Of course, it relies on quite a lot of subfunctions, but that's the gist.
 
I'm relying on mafia to handle the evil eyes and BBB to make sure the choiceadv in the Cranny is set to fight the swarm.

(I should probably hardcode those in my script to make sure, eh?)

Also, bumcheekcity, are you not dealing with the initiative or the noncombat/ML zones at all? Or is that in some of those subfunctions? I understand BCCAscend isn't meant to be "optimal", I'm just asking.
 

slyz

Developer
Just a little programming quirk of mine: instead of doing things like this
PHP:
void CryptQuest() {
    if (my_level() >= 7) {
        council();

		if (contains_text(visit_url("questlog.php?which=1"),"Cyrptic Emanations"))  {
			//code
		}
    }
}
which make you write your code all the way to the right, why not make CryptQuest() return a boolean value (so you can check for success or failure) and do something like this:
PHP:
void CryptQuest() {
    if (my_level() < 7) return false
    
    council();
    if (!contains_text(visit_url("questlog.php?which=1"),"Cyrptic Emanations"))
        return false

    //code
}

EDIT:
I'm relying on mafia to handle the evil eyes
How does Mafia handle the evil eyes?
 
Last edited:
I thought it was mafia, but it might be BBB, that uses the evil eye as they drop.
Code:
Round 4: weatherboy wins the fight!
After Battle: Your Evilometer emits a single beep.  The air in this part of the crypt smells slightly less evil...
You acquire an item: evil eye
You gain 17 Strengthliness
You gain 8 Wizardliness
You gain 21 Roguishness

use 1 evil eye

[124] Defiled Nook

As for my code design, I claim lack of formal specialized instruction. :) As such, my first pass at something is generally real top-down / linear (as this currently is), then I start looking for places where I do the same thing more than once, and try to make a function out of that, etc. For this example, I started with the shell from Rinn's Quest Scripts, and that's how he handled all the Council checking stuff, but I agree, I think another way might be better. Thanks for the input.
 

slyz

Developer
It's more about clarity than functionality, really. And that is subjective I guess, so there isn't a 'better' or 'worse'. I was only pointing to an alternative :)
 
I've rewritten the quest_check as it's own function and clarified the handling for the evil eyes.
Code:
void quest_check() {
	if (my_level() < 7) abort("You must be level 7 to start this quest."); 
	else if (contains_text(visit_url("questlog.php?which=2"),"Cyrptic Emanations")) 
		abort("You have already completed the level 7 quest.");
	else if (item_amount($item[evilometer]) == 0) {
		council();
		cli_execute("conditions clear");
		cli_execute("checkpoint");
		}
	}

Code:
while (get_property("cyrptNookEvilness").to_int() > 25) {
	adventure(1, $location[Defiled Nook]); 
	if (get_property("betweenBattleScript") == "" && item_amount($item[evil eye])>0 ) use(item_amount($item[evil eye]), $item[evil eye]); 
	}

I've updated the attachment in the third post.
 
Last edited:
Top