Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Bug: Doctor Bag quest NC isnt being handled as part of combat

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    2

    Default Bug: Doctor Bag quest NC isnt being handled as part of combat

    Version r19136

    If your script does something like the following, mafia will abort once it gets the doctor bag quest start NC. Instead of eating, it will print "you are currently in a choice." This happens even if you have the choice set. It doesn't matter if mafia is set it to accept the quest, reject the quest, or turn off the phone.

    adv1($location[someplace], -1, "");
    eat(1, $item[thing]);

    Just run the above until the phone rings, it will abort instead of eating.

  2. #2
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    878

    Default

    I don't think this is a bug - this is expected behavior.
    If you want Mafia to handle all choices and such to completion before moving on, use adventure()

  3. #3
    Developer
    Join Date
    Jan 2007
    Posts
    77

    Default

    Nonetheless, it would be nice to be able to recover from a doctor NC if you have initiated the adventure with adv1().

  4. #4
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    878

    Default

    Nonetheless, it would be nice to be able to recover from a doctor NC if you have initiated the adventure with adv1().
    Originally Posted by gausie View Post
    You can, you just have to understand what adv1() does, and script around it. It does not do what adventure() does.

    Why are you using adv1() by itself, without any other handling? What are you trying to accomplish?

    This would be a workaround (though probably not a good one):
    Code:
    adv1($location[someplace], -1, "");
    if (get_property("lastEncounter")=="Is There A Doctor In The House?") run_choice(-1);
    eat(1, $item[thing]);
    There are a lot of choiceadventure things that pop up that adv1() will not handle... including doctor bag (also, Halloweener, and probably other stuff I can't think of now)

  5. #5
    Junior Member
    Join Date
    Mar 2019
    Posts
    2

    Default

    CKB, that's just an easy way to reproduce it. What is happening is that I'm using a photocopied monster, YRing it, then trying to drink.

    The bag is triggering on the photocopied monster, and preventing me from drinking.

  6. #6
    Senior Member
    Join Date
    Aug 2015
    Posts
    231

    Default

    You can, you just have to understand what adv1() does, and script around it. It does not do what adventure() does.

    Why are you using adv1() by itself, without any other handling? What are you trying to accomplish?

    This would be a workaround (though probably not a good one):
    Code:
    adv1($location[someplace], -1, "");
    if (get_property("lastEncounter")=="Is There A Doctor In The House?") run_choice(-1);
    eat(1, $item[thing]);
    There are a lot of choiceadventure things that pop up that adv1() will not handle... including doctor bag (also, Halloweener, and probably other stuff I can't think of now)
    Originally Posted by ckb View Post
    This will adventure exactly once in the specified place (even if it took no turns), although it will follow chained choice adventures for as long as you have preset options.
    Originally Posted by adv1
    From https://wiki.kolmafia.us/index.php?title=Adv1

    I raised this in the Doc bag thread over 2 weeks ago but it appears to have gone unanswered. With choiceAdventure1340 set to anything other than 0, it should not abort according to the documentation above but it does. So either the documentation is wrong or it's a bug in the handling of this.

    Also the main difference I can see between adv1() and adventure() is

    Note that adventures is the number of adventures to spend in the specified location place. Any "free" turns (choiceadventures that don't consume an adventure, usually) or adventures spend in other locations (by a counterScript or a betweenBattleScript for example) will not count towards this total.
    Originally Posted by adventure
    so if you want to automate free fight wanderers you either use adv1() or unnecessarily burn an adventure every time by using adventure(). If that's not the case then we have unearthed yet another documentation discrepancy.
    Last edited by Malibu Stacey; 03-19-2019 at 07:01 AM.

  7. #7

    Default

    If you're using adv1 and it hits the doctor bag in the middle of adventures, it carries it out (presumably by the next adv1). It's only when you hit the doctor bag at the end that you need the extra handling.

    I also found that the choice didn't trigger until I hit another URL, so my workaround goes
    Code:
    while (to_int(get_property("_snojoFreeFights")) < 10) {
      heal_if_necessary();
      adv1($location[The X-32-F Combat Training Snowman], -1, "");
    }
    visit_url("main.php", false);
    run_choice(-1);
    where the last two statements do nothing in the case that a choice adventure wasn't hit.

  8. #8
    Senior Member
    Join Date
    Jun 2016
    Posts
    321

    Default

    adv1() doesn't play nice with fights that are followed by other fights or choice adventures, but in_multi_fight() and choice_follows_fight() can be used to test for this.
    My free fight script has a lot of "while ( in_multi_fight() ) run_combat();", to get those eldritch tentacles out of the way (and as a bonus, stuff didn't break when I had some clingy going from OCRS modifiers).

  9. #9
    Senior Member
    Join Date
    Oct 2014
    Posts
    194

    Default

    I use an afterAdventure script to handle these in my automation. But that may be more heavy-handed than you want.

  10. #10
    Senior Member
    Join Date
    Jun 2016
    Posts
    321

    Default

    Yeah, I don't even think it's a problem with adv1() specifically, even using mafia's built-in automated adventuring stalls out when I try to automate turns in the haunted bedroom (with all the nightstand noncombats).
    Last edited by the dictator; 03-20-2019 at 03:19 AM.

Posting Permissions

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