Bug - Fixed Tavern Cellar infinite loop

slyz

Developer
Thanks for pointing that out Fluxxdog, I corrected my post.

So, I saved this script in a file called "ratfight.ash"
The code in my post was simply a function, it doesn't actually do anything by itself. It needs to be called, like Fluxxdog showed.

If you want to be able to set the number of adventures, use this script:
PHP:
int faucet = 1 + get_property( "tavernLayout" ).index_of( "3" );
if ( faucet < 1 ) abort( "Mafia doesn't know where the Faucet is." );

void squeeze_rat()
{
    visit_url( "cellar.php?action=explore&whichspot=" + faucet );
    visit_url( "choice.php?whichchoice=512&option=1" );
    run_combat();
}

void main( int turns )
{
    for i from 1 to turns squeeze_rat();
}
and call it like this:
Code:
call ratfight.ash 10
 

Veracity

Developer
Staff member
Bumping this, since I think that an infinite loop when you try to adventure at something you can select on the Adventure Frame is rude.

I looked at Theraze's last patch, and although I think the idea is sound - if there are unexplored squares, clear them, otherwise, squeeze a rat from the faucet - I don't like having all that logic sitting in AdventureRequest. I'd like the logic to be in TavernManager, along with all the rest of KoLmafia's knowledge about how to move around in the Tavern Cellar. AdventureRequest should call TavernManager to "get the next square to explore".
 
Top