Best Between Battle Script Ever -- formerly AutoMCD

Did you manually update your zlib.ash to remove the typical tavern error message? Every time I try to do that it errors out... and that's about where the import zlib line is in the code.

Yeah! Exactly what I tried to do, how would I fix this? (And other messages that say replace x with y in the future?)
 

Theraze

Active member
To fix it, you'll need to get the original working zlib back... svn dec zlib, svn inc zlib. That should make it start working again.
 

fronobulax

Developer
Staff member
Question/FR.

I have a few CCS entries that use specific items that are consumable. Several times my combat has failed because I was calling out an item that I did not have. Is it possible to script something that looks at my CCS, determines whether there are items used in the CCS, checks for at least one of that item in inventory and then takes some action if there are no such items? If this is feasible, then it is reasonable to ask for it to be part of BBS, or am I the only person who would use it?

If it is not easily done, a partial solution would be to have BBS read a file that had items and counts and take some action if the appropriate number of each item was not available for use. UR is already doing something similar for combat restores.
 

Rinn

Developer
I did something like this by setting my own script to be the betweenBattleScript, and imported bbb and called it manually after my work was done.
 

Razorsoup

Member
I would like to formally request that the Grimstone Golem and Grim Brother be added to the familiar drop farming function. Mafia tracks the Grimstone Golem drops in "_grimstoneMaskDrops" and they are limited to one drop per day. Grim Brother drops are tracked in "_grimFairyTaleDrops" and are limited to 5 drops per day.
 

Crowther

Active member
I'll admit, I'm totally new to this script, so I might be way off base, again. And I don't really understand turtle taming.

I had things set up as the defaults for (bbb_turtles = 1, bbb_turtlegear = false) and BBB took off my UV compass when I adventure in the desert (to equip a turtling rod). Up until now, I enjoyed it picking up turtle stuff for me, but this is not what I want. Since the UV compass is new, I figured it might help to warn people before they get there.
 

Rinn

Developer
This should add the yearly familiars (untested).
Code:
familiar dropfam() {
   if (my_location().zone == "The Sea" || $locations[none, the slime tube] contains my_location()) return my_familiar();
   boolean has_more_drop(familiar f, int soft) {
      boolean clim(string prop, int hard) { return to_int(get_property(prop)) < min(soft,hard); }
      switch(f) {
         case $familiar[grimstone golem]: return clim("_grimstoneMaskDrops",1);
         case $familiar[angry jung man]: return clim("_jungDrops",1);
         case $familiar[astral badger]: return clim("_astralDrops",5);
         case $familiar[baby sandworm]: return clim("_aguaDrops",5);
         case $familiar[blavious kloop]: return clim("_kloopDrops",5);
         case $familiar[bloovian groose]: return clim("_grooseDrops",5);
         case $familiar[grim brother]: return clim("_grimFairyTaleDrops",5);
         case $familiar[gelatinous cubeling]: return (available_amount($item[eleven-foot pole]) == 0 || 
            available_amount($item[ring of detect boring doors]) == 0 || available_amount($item[pick-o-matic lockpicks]) == 0);
         case $familiar[green pixie]: if (have_effect($effect[absinthe-minded]) > 0) return false; return clim("_absintheDrops",5);
         case $familiar[happy medium]: return clim("_mediumSiphons",20);
         case $familiar[knob goblin organ grinder]: return clim("_pieDrops",5);
         case $familiar[li'l xenomorph]: return clim("_transponderDrops",5);
         case $familiar[llama lama]: return clim("_gongDrops",5);
         case $familiar[artistic goth kid]: if (!hippy_stone_broken() && have_familiar($familiar[mini-hipster])) return false;
         case $familiar[mini-hipster]: if (!contains_text(to_url(my_location()),"adventure.php")) return false; return clim("_hipsterAdv",7);
         case $familiar[pair of stomping boots]: foreach i,m in get_monsters(my_location()) if (!($phyla[dude,none] contains m.phylum)) return clim("_pasteDrops",7); return false;
         case $familiar[rogue program]: return clim("_tokenDrops",5);
         case $familiar[unconscious collective]: return clim("_dreamJarDrops",5);
      } return false;
   }
   for i from 1 upto 10
    foreach f in $familiars[green pixie, li'l xenomorph, baby sandworm, astral badger, llama lama, bloovian groose, 
       rogue program, blavious kloop, grim brother, unconscious collective, angry jung man, grimstone golem, happy medium, 
       knob goblin organ grinder, pair of stomping boots, artistic goth kid, mini-hipster, gelatinous cubeling]
      if (have_familiar(f) && has_more_drop(f,i)) return f;
   return my_familiar();
}
 
Last edited:

Crowther

Active member
I found another oddity. I'm doing big runs and BBB tests to see if I should open the gallery by looking at my level. My fix:
Code:
Index: BestBetweenBattle.ash
===================================================================
--- BestBetweenBattle.ash       (revision 13)
+++ BestBetweenBattle.ash       (working copy)
@@ -261,7 +261,7 @@
           else if (get_property("choiceAdventure80") != "3") friendlyset(80,"4","Skip Rise of Spookyraven.");
          if (get_property("lastGalleryUnlock").to_int() != my_ascensions() &&    // Fall
              (my_primestat() == $stat[muscle] || to_item(get_property("currentBountyItem")) == $item[non-euclidean hoof] ||
-              my_level() > 13 || to_int(get_property("fistSkillsKnown")) > 0) || my_path() == "Bugbear Invasion") {
+              (my_level() > 13 && my_path() != "BIG!") || to_int(get_property("fistSkillsKnown")) > 0) || my_path() == "Bugbear Invasion") {
             friendlyset(81,"1","Read stuff about pet alligators or something.");
             set_property("choiceAdventure87","2");
          } else {
 

zarqon

Well-known member
r14 Update

  • I added support for auto-adventuring in the Shore. You can now specify a tower item or dinghy plans or what have you as a goal there, and BBB will use your scrip to buy it (or its container) when you can afford it. I haven't been able to follow everything so well as I used to recently so correct me if this is no longer correct, but I believe since this is a betweenBattleScript rather than a beforeAdventureScript, mafia will spend one more very costly visit to the Shore even after buying your goal item, making this feature more than a little suboptimal until it can be split into an afterAdventureScript, but it's a step in the right direction. :)
  • Don't call the Hacienda tracking function anymore, now that Darzil has committed his tracking for it to mafia. Haven't tested to see if they work together though. Once I do, all that lovely code will be deleted.

After that, we have a number of fixes to things mentioned above.

@Theraze: Made the changes you suggested to the Hidden Park/Bowling Alley.

@BladeLight: Your question was previously answered. I'm not sure what I said exactly, but I recall it being brilliant and sagacious.

@jbouzanquet: I didn't go quite so far as that -- which would have the unfortunate result of leaving your choice on bonesaws even if you had more than enough -- but I adhered to the spirit of the request. BBB will get your required bonesaws and then change it away from bonesaws, but not away from anything else. So if you set it to skip (or any choice other than bonesaws) and have bbb_miniboss_items bonesaws already, it will keep skipping.

@Razorsoup: You found a copy/paste error! Fixed. Now Raver Giants will be appropriately fought. Also, new yearly familiars have been added to the drop rotation (thanks to Rinn for making it easy).

@Crowther: I added special handling for the compass so that BBB won't attempt to auto-tame if you have that equipped in the desert. Also, regarding your second issue, if you're already BIG!, why do you want the Gallery? Stats are needed to unlock quests/zones, but when you start out BIG everything's already unlocked. Am I missing something?​


That should bring the script up to date with this thread, if not the game. Enjoy!
 

Crowther

Active member
Also, regarding your second issue, if you're already BIG!, why do you want the Gallery? Stats are needed to unlock quests/zones, but when you start out BIG everything's already unlocked. Am I missing something?
Probably just my poor wording. If your level is greater than 13, BBB will open the gallery. I'm not sure why that is, but as you say, it's not what you want during a BIG! run. I rewrote it to exclude BIG!, but maybe the level 13 test is just a bad idea or maybe the test should be level 13 and can interact. I can't really say, because I don't understand why the level 13 test was put there in the first place. I mostly included my patch so you could find the line in question easily.

Thanks for the other fix. I'd entirely forgotten about that.
 

Theraze

Active member
The reason to unlock the gallery for aftercore is for bounties. Or if you're a TT who wants to level up for the Basement without using magazines. But mostly bounties.
 

zarqon

Well-known member
And right you all are. I misunderstood what you were reporting, Crowther, and have edited the script as you suggested.

While staring at that particular bit of code trying to figure out what I was thinking, I also noted that the bounty check already existed but was no longer functional as of the recent change to bounties. So I've fixed both of those.

And since I was fixing, I added handling for the ornate dowsing rod as lost mentioned, and we have ourselves r15.
 

Bale

Minion
Why should it need to? KoLmafia knows that for Sneaky Pete my_primestat() is moxie. Since KoLmafia knows it, BBB follows its lead.

Perhaps if you explained the specific problem it would shed some light on the situation.
 

Theraze

Active member
Suggestion: Change the gallery unlock level > 13 check to king liberated. This line:
Code:
              (my_level() > 13 && my_path() != "BIG!") || to_int(get_property("fistSkillsKnown")) > 0) || my_path() == "Bugbear Invasion") {
to this:
Code:
              get_property("kingLiberated").to_boolean() || to_int(get_property("fistSkillsKnown")) > 0) || my_path() == "Bugbear Invasion") {
It also means we don't need to check for BIG! paths anymore, since once we liberate the king, we're no longer in the path. Slow backfarmers trying to get the inkpot won't end up trying to unlock the gallery, and other good things. Yay.
 
This script now fails to run due to a KoLmafia location change:
Bad location value: "the spooky gravy barrow" (BestBetweenBattle.ash, line 470) <- This should be "the spooky gravy burrow"

Also worth noting while I'm at it:
Changing "the palindome" to "Inside the Palindome" would get rid of this message (BestBetweenBattle.ash, line 394)
 

fronobulax

Developer
Staff member
I just edited locally and I think there were three places to change. My version attached for people who would rather trust me than use a text editor, while we all wait for an sanctioned fix.
 

Attachments

  • BestBetweenBattle.ash
    55.3 KB · Views: 68
Top