Bug - Fixed having both a macro and consult script fails in [default] section of ccs

fxer

Member
Making a combat macro directly in the KoL interface works as expected, only Extract is cast. Likewise the same CCS inside mafia also works as expected, only Extract is cast.

Code:
if hasskill extract
skill extract
endif 
if hasskill open the bag o' tricks
skill entangling noodles
skill open the bag o' tricks
endif



However adding a consult to the CCS makes Extract, Entangle and Bag o' Tricks be cast:

Code:
[ default ]
if hasskill extract
    skill extract
endif
if hasskill open the bag o' tricks
    skill entangling noodles
    skill open the bag o' tricks
endif
consult wham.ash
 

Veracity

Developer
Staff member
Yeah. Setting "macroDebug" to true and running with this CCS:

Code:
[ default ]
if hasskill pocket crumbs
    skill pocket crumbs
endif
consult dummy-consult.ash
where dummy-consult.ash is this:

Code:
void main( int round, monster mon, string page )
{
    print( "round = " + round + " monster = " + mon );
    while ( can_still_steal() ) {
	steal();
    }
    attack();
}
results in this:

Code:
[685476] The Hidden Office Building
Encounter: pygmy witch accountant
Strategy: brianna [default]
Round 0: Brianna wins initiative!
(unable to macrofy due to action: consult dummy-consult.ash)
(unable to macrofy due to action: consult dummy-consult.ash)
Round 1: Brianna casts POCKET CRUMBS!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
(unable to macrofy due to action: consult dummy-consult.ash)
(unable to macrofy due to action: consult dummy-consult.ash)
round = 1 monster = pygmy witch accountant
Round 1: Brianna tries to steal an item!
Round 2: Gronald climbs up and sits on your shoulder, and hands you some Meat. Huh, where did he find that?
You gain 84 Meat.
Round 2: Brianna attacks!
Round 3: pygmy witch accountant takes 3268 damage.
Round 3: Brianna wins the fight!
After Battle: Gronald sits on your fallen opponent's body, blows a smoke ring, and winks at you.
You gain 647 Meat
You acquire an item: short calculator
After Battle: You gain 11 Strongness
After Battle: You gain 14 Magicalness
After Battle: You gain 29 Chutzpah
We try to generate a macro for the entire CCS. As soon as we hit the "consult" line, we give up doing that.

KoLmafia then executes the lines in CCS as if they are normal CCS lines. The "if" and "endif" don't do anything, but "skill" is a valid CCS line, so we try doing it.

I'm going to see if we can macrofy everything preceding the "consult" script, submit that as a macro, and then proceed with the consult script.

Sort of exactly what you are hoping will happen.
 

Veracity

Developer
Staff member
Revision 17500 should fix this.

When automating a fight:

- we macrofy everything up to "consult" (or "delevel" or "twiddle") and execute it.
- we execute "consult" (or the others)
- if the combat is not over, we macrofy everything following (up to the next troublesome action) and execute it.

This was complicated and tricky. I've done extensive testing and it works to my satisfaction, but lets see if any problems show up.
 
Last edited:
Since I'd reported this issue in the SmartStasis thread, noting it here: I had encountered the same behavior reported by fxer above. Using 17504 I no longer encounter this behavior.
 
Top