Bricko fights

dier_cire

New member
Ok, in scripting out a fairly speed oriented Day 1 HCNP, I decided to throw in grabbing the BRICKO bulwark. Setting up is simple enough, but then I ran into the snag of running the combat. I'm guessing use() is probably what I want but I could see visit_url() as well (since use only brings up the do you want to do this button in vanilla). Even then, I'd prefer to just take control of the combat similar to the third parameter in adventure() but I doubt that's possible so my guess is I'm stuck setting up a custom script and switching it in and out just before and after the battle.

So, any information on how to script the bricko fight(s) would be great.

Also, when shrugging a buff, is it possible to remove buffs via use_skill() or is this mostly just done via cli_execute()?
 

StDoodle

Minion
I'm fairly sure use() would work. To handle the fight itself, the simple way is to follow it with run_combat(), which will use your current CCS. To get all complicimicated and use a custom macro, you could follow it with visit_url("fight.php?action=macro&macrotext=MACRO;MACRO MACRO") (replacing the MACROs with your actual macro, of course).

As for buffs, I doubt use_skill() would work. Probably cli_execute("uneffect WHATEVER") is best.
 

dier_cire

New member
Thanks. Sorta what I figured, but always good to ask. I'll test out the turtle today just to double check and update so this is confirmed for future searchers.

EDIT: confirmed. use() worked great and using a cli_execute("ccs " + turtle_ccs); beforehand just ensures it does what you want (turtle_ccs being a string with "default" in it and default having a section for [bricko turtle] for me). Didn't need the run_combat() after all. Should work for other bricko fights I'd guess.
 
Last edited:

slyz

Developer
In ASH, you can use set_property() directly instead of using a cli_execute(). And setting the CCS is not everything, you should also make sure Mafia's combat strategy is set to "custom combat script":

Code:
set_property( "battleAction", "custom combat script" );
set_property( "customCombatScript", turtle_ccs );
 

Theraze

Active member
Depends on if you want to change your default action to use turtle_ccs. If you only want to use the turtle for Bricko fights, executing turtle_ccs manually is a decent way to do it.
 

dier_cire

New member
Thanks, still discovering all the properties and their functions. That would have been annoying.

Using a get_property ahead of the sets lets me swap the things in and out just fine. Not ideal since I'd rather control the fight directly via ash but it does get the job done.
 
Last edited:

Theraze

Active member
If your goal is just to add special handling for the Bricko Turtle, if your default CCS has a [Bricko Turtle] section in it, run_combat will execute that part automatically for you. If your goal is to run a special CCS for them instead that's completely different, you can either set_property to make it your current one and then run_combat, or just manually execute it as you were doing.
 

slyz

Developer
If you do use( 1, $item[ BRICKO Ooze ] ), Mafia will automatically do the fight for you:
Code:
> ash use( 1, $item[ BRICKO Ooze ] );

Using 1 BRICKO ooze...

[1158] BRICKO ooze
Encounter: BRICKO ooze
Strategy: attack with weapon
Round 0: slyz wins initiative!
Round 0: slyz casts ENTANGLING NOODLES! (auto-attack)
Round 2: slyz executes a macro!
Round 2: slyz attacks!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: bricko ooze takes 299 damage.
You acquire an item: BRICKO brick
After Battle: Dusty smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 3 Muscleboundness
You gain 12 Enchantedness
You gain 3 Smarm
Finished using 1 BRICKO ooze.
Returned: true


You can do this, but make sure mafia is setup to do what you want in combat:
PHP:
// save current combat settings
string previous_battleaction = get_property("battleAction");
string previous_CCS = get_property("customCombatScript");

// prepare for fight
set_property( "battleAction", "custom combat script" );
set_property( "customCombatScript", turtle_ccs );  // same as doing cli_execute("ccs turtle_ccs");

//fight
use( 1, $item[ BRICKO Ooze ] );

// restore combat settings
set_property( "battleAction",previous_battleaction );
set_property( "customCombatScript",previous_CCS );
You need to set battleAction to "custom combat script" if you want your CCS to be used, then select your CCS either by using set_property() or by using the ccs CLI command in a cli_execute().

If you want to control the combat with ASH, you need to use visit_url() to bring up the combat, you can then use ASH functions to do the combat or call run_combat() to have Mafia do its thing (it will do what it is setup to do though, so you need to setup the properties beforehand).

PHP:
print( "Starting combat..." );
visit_url( "inv_use.php?pwd&which=3&whichitem=" + to_int( $item[ BRICKO Ooze ] ) + "&checked=1" );
print( "Let's let Mafia do its thing with run_combat()" );
run_combat();
Code:
> call test.ash

Starting combat...

[1158] BRICKO ooze
Encounter: BRICKO ooze
Round 0: slyz wins initiative!
Round 0: slyz casts ENTANGLING NOODLES! (auto-attack)
Let's let Mafia do its thing with run_combat()
Round 2: slyz executes a macro!
Round 2: slyz attacks!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: bricko ooze takes 298 damage.
Your familiar gains a pound: Dusty, the 6 lb. Baby Sandworm
You acquire an item: BRICKO brick
After Battle: Dusty leans against a cactus, produces a bottle of tequila, and drinks it. A few minutes later, he belches some murky fluid back into the bottle and hands it to you.
You acquire an item: agua de vida
You gain 6 Strongness
You gain 7 Magicalness
You gain 1 Sarcasm
 
Top