Bug - Fixed Stack overflow during ASH script

Veracity

Developer
Staff member
I figured this out.

The reason you want to call run_combat() immediately after finishing another combat is if you are in a multifight.
A multifight is invoked by calling fight.php.
It will then proceed directly into the fight, no redirect to ireallymeantit needed.

I made a small change to FightRequest.run() to invoke fight.php when you are starting a multifight, before continuing the automation.

Using this script:

Code:
buffer page = visit_url( "adventure.php?snarfblat=150" );
page = run_combat();
if ( have_effect( $effect[ eldritch attunement] ) > 0 ) {
    run_combat();
}
and this consult script:

Code:
void main(int initround, monster foe, string page)
{
    print( "initround = " + initround );
    print( "monster = " + foe );
    print( "page length = " + length( page ) );
    attack();
}
and this CCS:

Code:
[ default ]
consult consult.ash
I got 5 turns of Eldritch Attunement and did this:

Code:
[color=green]> runc1.ash[/color]

[499275] The Orcish Frat House (Bombed Back to the Stone Age)
Encounter: caveman frat pledge
Round 0: Tebryn wins initiative!
initround = 1
monster = caveman frat pledge
page length = 28353
Round 1: Tebryn attacks!
Round 2: caveman frat pledge takes 8405 damage.
Round 2: Wingwang shakes loose a considerable quantity of spice. You conjure up a canister and collect it.
You acquire an item: spices
Round 2: Tebryn wins the fight!
After Battle: Stubert sits on your fallen opponent's body, blows a smoke ring, and winks at you.
You gain 230 Meat
After Battle: Wingwang demonstrates a dance of celebration from his native land. Translated into couscous, it's basically incomprehensible.
You acquire an item: stone baseball cap
You acquire an item: chunk of rock salt
After Battle: You gain 11 Muscleboundness
After Battle: You gain 73 Enchantedness
After Battle: You gain 20 Sarcasm

[499276] The Orcish Frat House (Bombed Back to the Stone Age)
Encounter: Eldritch Tentacle
Round 0: Tebryn wins initiative!
initround = 1
monster = Eldritch Tentacle
page length = 28178
Round 1: Tebryn attacks!
Round 2: Eldritch Tentacle takes 114 damage.
Round 2: Wingwang shakes loose a considerable quantity of spice. You conjure up a canister and collect it.
You acquire an item: spices
initround = 2
monster = Eldritch Tentacle
page length = 29077
Round 2: Tebryn attacks!
Round 3: Eldritch Tentacle takes 114 damage.
Round 3: You lose 54 hit points
initround = 3
monster = Eldritch Tentacle
page length = 28702
Round 3: Tebryn attacks!
Round 4: Eldritch Tentacle takes 114 damage.
Round 4: Tebryn wins the fight!
After Battle: Wingwang whirls around picking up items, like a little couscous tornado.
You acquire an item: eldritch effluvium
After Battle: You gain 26 Strengthliness
After Battle: You gain 95 Enchantedness
After Battle: You gain 29 Chutzpah
That looks correct to me.

Try revision 18130.
 
Top