Best Between Battle Script Ever -- formerly AutoMCD

zarqon

Well-known member
I thought that allowed users to easily handle all the possibilities -- if you want to go to the marketplace while getting nickels, don't specify nickels as a goal. If you want to skip the marketplace until you have X nickels, use a goal.

Per my naming convention, you should use "automcd" (which is non-script-specific... also used by Checklist.ash) in your ascend script rather than a separate setting. I guess I could make it easy for you and move auto_mcd() into ZLib. Yes. I'll do that.
 

dj_d

Member
Cool. How do our scripts cooperate? Ascend.ash has more knowledge of the user's intentions - e.g. it knows where the user is going to adventure next, rather than where s/he adventured last - so when ascend.ash is adventuring it should inhibit B3SE from changing the MCD settings and do it itself. (related note: zlib should accept the location as an argument, as it already does, so ascend.ash can tell it where it will adventure next)
 

zarqon

Well-known member
First, one of us requests that my_adventure() return the target location when calling adventure(), to rid us once and for all of the first-adventure-with-wrong-MCD problem. Next, we wait for one of the devs to change it. Finally, I add auto_mcd() to ZLib.

Fortunately, all but the last one have already happened. :) I'll do the last one when I get home from work today. (Which will be around 10am for all of you North Americans.)
 

Bale

Minion
I just found something else this script should do! If your next adventure is at Sonofa Beach and you have pulverize, then if there is a goatskin umbrella or a wool hat in your inventory, smash it promptly!

The adventures that give these items show up more frequently when you do not have them in inventory. By smashing them, you have a much higher output of yummy elemental wads. I'd prefer the wads to Zerg Rush.

However if you don't have pulverize, then keeping the hat and umbrella will increase your chance of getting yummy limes which are a decent booby prize.

Source
 

dj_d

Member
This could be bad for someone playing in softcore or mushycore (what do you call the thing that's softer than softcore?) and has pulled everything out of hangks' - since "everything" could include a bazillion goatskin umbrellas that they were planning to mallsell.

A good option, though, and maybe you do it if you have exactly 1 of the items.
 

Bale

Minion
Good point! If there is only 1 of them, then it should be assumed that the player doesn't want any and the previous one was just acquired.

Code:
      case $location[wartime sonofa beach]:
         if (have_skill($skill[pulverize])) {
            if (item_amount($item[goatskin umbrella]) == 1)
               cli_execute("pulverize 1 goatskin umbrella");
            if (item_amount($item[wool hat]) == 1)
               cli_execute("pulverize 1 wool hat");
         }
         return;
 
Last edited:

Bale

Minion
I'm suggesting a change to the way that the Cyrpt is handled. This is what my modified version of BestBetweenBattle now looks like:

Code:
      case $location[defiled alcove]:
         if (item_amount($item[half-rotten brain]) < to_int(vars["miniboss_items"])) {
            set_property("choiceAdventure153","3");       // get vars[miniboss_items] brains
          } else if (my_primestat() == $stat[muscle]) {
             set_property("choiceAdventure153","1");    // get stats if mainstat is muscle.
          } else set_property("choiceAdventure153","4");  // Skip adventure
         return;
      case $location[defiled nook]:
         if (item_amount($item[rusty bonesaw]) < to_int(vars["miniboss_items"])) {
            set_property("choiceAdventure155","3");       // get vars[miniboss_items] saws
          } else if (my_primestat() == $stat[moxie]) {
             set_property("choiceAdventure155","1");    // get stats if mainstat is moxie.
          } else set_property("choiceAdventure155","4");  // Skip adventure
         return;
      case $location[defiled niche]:
         if (item_amount($item[plus-sized phylactery]) == 0 && to_int(vars["miniboss_items"]) > 0) {
            set_property("choiceAdventure157","2");       // get a phylactery
          } else if (my_primestat() == $stat[mysticality]) {
             set_property("choiceAdventure157","1");    // get stats if mainstat is mysticality.
          } else set_property("choiceAdventure157","4");  // Skip adventure
         return;
      case $location[defiled cranny]:
         if (item_amount(to_item("Ghuol-B-Gone")) < to_int(vars["miniboss_items"]))
            set_property("choiceAdventure159","3");       // get vars[miniboss_items] ghuol-b-gones
          else set_property("choiceAdventure159","4");    // always skip adventure since stat gain is small.
         return;

Note that I made it possible to choose not to get a phylactery, since I set miniboss_items to 0 and I want it obeyed. Also, there's no point to get off-stat points, so those choice adventures are just a waste of time based on your character class and it now chooses accordingly.
 

zarqon

Well-known member
You guys! Excellent!

@dj_d: I've moved auto_mcd() into ZLib, as well as declaration of automcd and some other settings I expect to be widely-used. The function will return true without doing anything if automcd is false, so you can call it without doing the check yourself. Enjoy!

Also: I call it "extremely-flaccid-core."

@Bale: Great ideas. I've added all of them in with one exception: I always want moxie stats from the Nook, particularly given the safety-threshold-based approach of a lot of my scripts.

Thanks for making this script even bester!

IMPORTANT NOTE FOR USERS OF 1.0: I have been a big jerkface and renamed two of the script settings! The new names are bbb_vampire_hearts and bbb_miniboss_items, replacing the former versions without the "bbb_". I changed my mind about not prefixing them. Sorry!! But not really.
 

Bale

Minion
Glad you like my suggestions. Though it seems weird to maximize for moxie that way when your mainstat isn't moxie. That won't keep you out of danger if you're playing seriously.

Speaking of which I think I'll change it to:

Code:
   if (my_primestat() == $stat[moxie])
      auto_mcd(my_location());
This script is VERY customizable to meet my personal desires. Unfortunately that makes it hard for me to update it easily when you release a new version.

Thanks for telling us about your changing the names of those settings. I can just fix my vars_bale without any trouble.
 

Bale

Minion
I just had a thought... what if there was a setting for bbb_plink_only_moxie that when set TRUE, will auto_mcd for a moxie class or set it to 10 otherwise and also skip moxie in the nook if you're not a moxie class.

That one setting will allow both your play style and my own.

Hmmm... now if only there was a way to detect if I'm running a sauceror as a faux-moxie class. Testing to see if my moxie is my highest stat perhaps? That still wouldn't allow niche stat gains for moxie, but it would allow auto_mcd.
 

zarqon

Well-known member
That would be fine for skilled characters (in particular those with a good CCS running your recovery script), which not everyone is. The threshold setting allows you to do more or less the same thing -- just set it exorbitantly high when you're not a moxie class, and your MCD will sit at 10/11 most of the time.

Or, set automcd to false, and just leave your MCD on full.
 

Bale

Minion
Well, the whole point of automation is to have it detect my settings instead of my needing to reset it every time I switch between moxie and non-moxie classes, right?

I can just customize my version so it works that way, I was suggesting it to you because I'd like to just be able to download this script again if you release a new version without needing to scrutinize the differences.
 

Bale

Minion
Just got to level 10 and suddenly I realized that I needed another bit added to the script:

Code:
      case $location[fantasy airship]:
         if (available_amount($item[bronze breastplate]) == 0 || is_goal($item[bronze breastplate]))
            set_property("choiceAdventure178","1");       // get a breastplate
          else set_property("choiceAdventure178","2");    // skip
         if (available_amount($item[metallic A]) < 1) {
            if (numeric_modifier("Monster Level"). to_int() >= 20)
               set_property("choiceAdventure182","1");       // Get into a fight with a MechaMech
         } else set_property("choiceAdventure182","3");    // Get stats!
         return;
 
Last edited:

zarqon

Well-known member
That's a start. That choice also needs to fight bounty monsters, and consider the possibility of fantasy chests (and/or their contents) as a goal. Further, stats may be unimportant to high-level aftercorers. I left that one out because it seemed too user-preferency and complicated. If we can work out a universally acceptable solution, I'd be happy to add it.

I suppose for now leaving out the "else" part would be an acceptable beginning, because everyone needs the letter.
 

Raven434

Member
Not sure about this one. I do have MCD available to me.

Sending kmail to Zarqon...
Checking for updates (running ZLib ver. : 4)...
_version_zlib => : 4
Checking for updates (running Best Between Battle Script Ever ver. 1.1)...
_version_automcd => 1.1
MCD: unavailable

From my vars file:
automcd true
bbb_adjust_choiceadvs true
bbb_miniboss_items 0
bbb_vampire_hearts 2
defaultoutfit current
is_100_run false
threshold 4
 
Last edited:

zarqon

Well-known member
See the discussion about this on the previous page. No doubt you have untinkered your meatcar, right? It's a known weakness in the script.
 

Raven434

Member
See the discussion about this on the previous page. No doubt you have untinkered your meatcar, right? It's a known weakness in the script.

Yep, yep!

The light bulb just went on about that.

I was thinking "hang on... we just talked about this..."

:)

Yay second cup of coffee.

;-)
 
Last edited:

Rinn

Developer
Here's a few choice adventures changes I use in my quest scripting that you may find useful to add:

Code:
int g_knownAscensions = get_property("knownAscensions").to_int();

void set_library_choices()
{
    // Take a Look, it's in a Book! (Rise): Unlock the second floor, then skip the adventure.
    if (get_property("lastSecondFloorUnlock").to_int() == g_knownAscensions)
        set_property("choiceAdventure80", "4");
    else
        set_property("choiceAdventure80", "99");

    // Take a Look, it's in a Book! (Fall): Unlock the Haunted Gallery first, then unlock the second floor, then skip the adventure.
    if (get_property("lastGalleryUnlock").to_int() == g_knownAscensions)
    {
        if (get_property("lastSecondFloorUnlock").to_int() == g_knownAscensions)
            set_property("choiceAdventure81", "4");
        else
            set_property("choiceAdventure81", "99");
    }
    else
    {
        set_property("choiceAdventure81", "1");
        set_property("choiceAdventure87", "2");
    }
}

void set_bedroom_choices()
{
    // One Nightstand (White): Fight an animated nightstand.
    set_property("choiceAdventure82", "3");

    // One Nightstand (Mahogany): Fight an animated nighstand.
    // Additionally you could check if you have Lord Spookyraven's spectacles equipped, and get your quest item if you don't already have it or the skill.
    set_property("choiceAdventure83", "2");

    // One Nightstand (Ornate): Get Lord Spookyraven's spectacles, else get myst substats.
    if (available_amount($item[Lord Spookyraven's spectacles]) == 0)
        set_property("choiceAdventure84", "3");
    else
        set_property("choiceAdventure84", "2");

    // One Nightstand (Wooden): Fight the remains of a jilted mistress if we already have the ballroom key.
    // Mafia will figure out the ballroom key adventures for us, but not the mirror.
    if (available_amount($item[Spookyraven ballroom key]) == 1)
        set_property("choiceAdventure85", "3");
}

void set_bathroom_choices()
{
    // Having a Medicine Ball: Defeat the guy made of bees, then skip the adventure.
    // I check for whether or not I want to kill him in a differnet script.
    if (get_property("guyMadeOfBeesDefeated").to_boolean() == false)
        set_property("choiceAdventure105", "3");
    else
    {
        set_property("choiceAdventure105", "2");
        set_property("choiceAdventure107", "4");
    }
}

void set_pirate_choices()
{
    // Fucking drunkeness bullshit choice adventure.
    // That Explains All The Eyepatches: Don't get drunk, always get a shot of rotgut instead.
    if (my_primestat() == $stat[mysticality])
        set_property("choiceAdventure184", "2");
    else if (my_primestat() == $stat[muscle])
        set_property("choiceAdventure184", "2");
    else if (my_primestat() == $stat[moxie])
        set_property("choiceAdventure184", "3");
}

void set_wheel_stat_choices()
{
    // Wheel in the Clouds in the Sky, Keep On Turning: Turn to my_primestat().
    if (my_primestat() == $stat[moxie])
    {
        set_property("choiceAdventure9", "2"); 
        set_property("choiceAdventure10", "2");
        set_property("choiceAdventure11", "1"); 
        set_property("choiceAdventure12", "3");    
    }
    else if (my_primestat() == $stat[muscle])
    {
        set_property("choiceAdventure9", "3"); 
        set_property("choiceAdventure10", "2");
        set_property("choiceAdventure11", "1"); 
        set_property("choiceAdventure12", "1");    
    }
    else if (my_primestat() == $stat[mysticality])
    {
        set_property("choiceAdventure9", "1"); 
        set_property("choiceAdventure10", "3");
        set_property("choiceAdventure11", "2"); 
        set_property("choiceAdventure12", "1");    
    }
}

void set_wheel_quest_choices()
{
    // Wheel in the Clouds in the Sky, Keep On Turning: Set to quest position (also to reduce noncombat rate).
    set_property("choiceAdventure9", "2"); 
    set_property("choiceAdventure10", "1");
    set_property("choiceAdventure11", "3"); 
    set_property("choiceAdventure12", "2");
}
Additionally here's the script that utilizes the guy made of bees choices if you think you could pull something from it:
Code:
void SpookyravenUpstairs()
{
    UnlockSpookyraven();

    // Mafia automatically sets the bedroom choice adventures, how nice.
    set_bedroom_choices();
    if (available_amount($item[Lord Spookyraven's spectacles]) == 0)
    {
        cli_execute("conditions clear");
        add_item_condition(1, $item[Lord Spookyraven's spectacles]);
        adventure(request_noncombat(my_adventures()), $location[haunted bedroom]);
        set_bedroom_choices();
    }

    if (available_amount($item[Spookyraven ballroom key]) == 0)
    {
        cli_execute("conditions clear");
        add_item_condition(1, $item[Spookyraven ballroom key]);
        adventure(request_noncombat(my_adventures()), $location[haunted bedroom]);
        set_bedroom_choices();
    }

    boolean guyMadeOfBeesDefeated = get_property("guyMadeOfBeesDefeated").to_boolean();

    if (guyMadeOfBeesDefeated == false)
    {
        if (available_amount($item[Antique Hand Mirror]) == 0)
        {
            set_bedroom_choices();
            cli_execute("conditions clear");
            add_item_condition(1, $item[Antique Hand Mirror]);
            adventure(request_noncombat(my_adventures()), $location[haunted bedroom]);
        }

        int guyMadeOfBeesCount = get_property("guyMadeOfBeesCount").to_int();
        if (guyMadeOfBeesCount < 4)
        {
            if (user_confirm("Would you like to prep the guy made of bees? You have said his name " + guyMadeOfBeesCount + " time(s)."))
            {
                cli_execute("conditions clear;conditions add " + (4-guyMadeOfBeesCount) + " choiceadv");
                adventure(request_noncombat(my_adventures()), $location[haunted bathroom]);
            }
        }
        else
        {
            print("You have already said the Guy Made of Bees' name " + guyMadeOfBeesCount + " times already, he's ready to be summoned.");
        }
    }
    else
    {
        print("You have already defeated the Guy Made of Bees.");
    }
}
 

StormCrow42

Member
I love the idea of automatically opening up the gallery and second floor of spookyraven. I'm against the idea of automatically fighting nightstands though, I frequently unlock the ballroom before I'm ready to fight nightstands.
 
Top