Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17

Thread: Trouble With use_familiar()

  1. #11
    Senior Member
    Join Date
    Jun 2016
    Posts
    234

    Default

    I do (vaguely) remember something like that, which was why I moved my familiar swapping stuff to my afterAdventure script.

  2. #12
    Developer
    Join Date
    Aug 2009
    Posts
    2,814

    Default

    Hm. I see this code:
    Code:
            public static void runBetweenBattleChecks( final boolean isScriptCheck, final boolean isMoodCheck,
                    final boolean isHealthCheck, final boolean isManaCheck )
            {
                    // Do not run between battle checks if you are in the middle
                    // of your checks or if you have aborted.
    
                    if ( !RecoveryManager.isRecoveryPossible() || KoLmafia.refusesContinue() )
                    {
                            return;
                    }
    
                    // First, run the between battle script defined by the
                    // user, which may obviate the built in behavior.
    
                    RecoveryManager.recoveryActive = true;
    
                    if ( isScriptCheck )
                    {
                            KoLmafia.executeScript( Preferences.getString( "betweenBattleScript" ) );
                    }
    
                    // Now, run the built-in behavior to take care of
                    // any loose ends.
    
    
                    SpecialOutfit.createImplicitCheckpoint();
    which suggests that there should be no such outfit restore for a betweenBattleScript. recoveryScript, on the other hand, is definitely encapsulated by an instance of outfit checkpoint / restore.

    I wonder if use_familiar(fam) fails to update equipment appropriately. That could explain it.

  3. #13
    Developer
    Join Date
    Aug 2009
    Posts
    2,814

    Default

    I wonder if use_familiar(fam) fails to update equipment appropriately. That could explain it.
    Originally Posted by heeheehee View Post
    Limited manual testing indicates that familiar swapping updates equipment as desired.

    Hm. Looking back at the thread, the OP never explicitly mentioned a betweenBattleScript. This post indicates an afterAdventureScript.
    Thank you for the reply. In Automtion, other than log in and log out scripts, I have a post-adventure script. Here is the extent of that script:
    Originally Posted by pl_walker View Post
    Strange, the error seems to be happening after the script ends. I guess...

    Finished ASH script: kmBetween.ash
    Your Jumpsuited Hound Dog can't wear a string of dingle balls
    Autorecovery failed.
    Originally Posted by pl_walker View Post
    Sounds like recovery is happening. Perhaps a checkpoint is being created before the afterAdventureScript, and then restored (unsuccessfully) after recovery? I can check to see what the code's doing.

  4. #14
    Senior Member
    Join Date
    Jun 2016
    Posts
    234

    Default

    afterAdventure scripts are weird anyway: if you enable them on manual adventures, they will run after manual adventures as expected. However total_turns_played() (and possibly other variables like that) doesn't update, so your manual adventure takes a turn and then the afterAdventure script runs based on your turncount before the manual adventure (and you end up looking for a lights out adventure one turn too late, consistently).

  5. #15
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,584

    Default

    BBB explicitly clears checkpoints if it swaps gear or familiars to avoid these problems, which I also seem to recall happening. But I believe that code also predates the split into beforeBattle and afterBattle scripts, so this could be irrelevant information now.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  6. #16
    Junior Member
    Join Date
    Oct 2008
    Posts
    7

    Default

    For reference, I was able to capture the error again with more info from the log.

    DEBUG_20181014.txt

    For reference, my kmFarm script is just adventuring in the Oasis. This issue happens whether I'm running that script or just automating adventures.

    I'm going to try removeing the Post-Adventure script and put the contents in the kmFarm script. If it is indeed related to that particular preference setup.

    Thanks again, everyone for the assistance.

  7. #17
    Junior Member
    Join Date
    Oct 2008
    Posts
    7

    Default

    OK, moving the script to within my Farming script eliminates the error, so something must be happening as part of the Post-Adventure automation.

    At least for now I have a work around that works. I can move the familiar management to a "tools" script and just call it after I adventure somewhere. Not the most elegant solution, but it will work.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •