Best Between Battle Script Ever -- formerly AutoMCD

Theraze

Active member
Well, you could turn them into records if you'd like them to be configurable into a custom order and have it actually get respected...

Also noticing (as I'm working through making it into records) that green pixie is double listed... once with a check for absinthe-minded and once later without.
 
Last edited:

Theraze

Active member
Anyways, here is some replacement code for fam_check that uses a record field, so you can include whatever you want. This version adds the familiars in the order you had them (minus the extra pixie) in the above script:
Code:
record fspecials {
   familiar fam;     // which familiar causes the event
   int count;        // how many times it happens daily
};  

fspecials[int] init_familiar_events() {
   int nextchoice;
   fspecials[int] listing;

   foreach fam in $familiars[green pixie, li'l xenomorph, baby sandworm, astral badger, llama lama, mini-hipster, bloovian groose, blavious kloop, pair of stomping boots, rogue program]
   {
      if (!have_familiar(fam)) continue;
      nextchoice = count(listing);
      switch(fam)
      {
         case $familiar[green pixie]:
            if (have_effect($effect[absinthe-minded]) > 0) continue;
            listing[nextchoice].count = to_int(get_property("_absintheDrops"));
            break;
         case $familiar[li'l xenomorph]:
            listing[nextchoice].count = to_int(get_property("_transponderDrops"));
            break;
         case $familiar[baby sandworm]:
            listing[nextchoice].count = to_int(get_property("_aguaDrops"));
            break;
         case $familiar[astral badger]:
            listing[nextchoice].count = to_int(get_property("_astralDrops"));
            break;
         case $familiar[llama lama]:
            listing[nextchoice].count = to_int(get_property("_gongDrops"));
            break;
         case $familiar[mini-hipster]:
            listing[nextchoice].count = to_int(get_property("_hipsterAdv")) - 2;
            break;
         case $familiar[bloovian groose]:
            listing[nextchoice].count = to_int(get_property("_grooseDrops"));
            break;
         case $familiar[blavious kloop]:
            listing[nextchoice].count = to_int(get_property("_kloopDrops"));
            break;
         case $familiar[pair of stomping boots]:
            listing[nextchoice].count = to_int(get_property("_pasteDrops"));
            break;
         case $familiar[rogue program]:
            listing[nextchoice].count = to_int(get_property("_tokenDrops"));
            break;
         default:
            break;
      }
      listing[nextchoice].fam = fam;
   }
   return listing;
}

boolean fam_check() {
  // first, enforce 100% runs
   if (to_familiar(vars["is_100_run"]) != $familiar[none]) {
      if (my_familiar() != to_familiar(vars["is_100_run"])) return use_fam(to_familiar(vars["is_100_run"]));
      return vprint("Not swapping familiar; is_100_run setting is set to "+my_familiar(),9);
   }
  // farm familiar items if set (and not auto-taming)
   if (!to_boolean(vars["bbb_famitems"]) || to_familiar(excise(get_property("taming"),"|","")) != $familiar[none]) return true;
   fspecials[int] dfams = init_familiar_events();
   foreach f,d in dfams if (my_familiar() == d.fam && d.count < 5) return use_fam(d.fam);
   foreach f,d in dfams if (d.count < 5) return use_fam(d.fam);
   return true;
}
Familiars displayed in order, with the !have_familiar check commented out so it shows them all:
> ashq import <bestbetweenbattle.ash> fspecials[int] testing = init_familiar_events(); foreach f,d in testing print_html(d.fam)

Green Pixie
Li'l Xenomorph
Baby Sandworm
Astral Badger
Llama Lama
Mini-Hipster
Bloovian Groose
Blavious Kloop
Pair of Stomping Boots
Rogue Program

The main benefit of using something like this is that you can add more familiars to init_familiar_events and have them as preferred/final options. Anything besides those familiars that get added to the list will automatically get swapped to after your familiar events are done, but not until then. Well, as long as they're added to the end... :)
 
Last edited:

jwylot

Member
Works exactly as expected, nice job Theraze :)

So without further ado, ladies and gentlemen, here is the amended script. Not only does it include all dropping familiars (plus the hipster) but you can now mess around with the order in which the familiars are used to your heart's content. Enjoy.
 

Attachments

  • BestBetweenBattle.ash
    33.4 KB · Views: 97

Theraze

Active member
Thanks. I initially had it parsing through the whole familiar table and only keeping the ones that are defined as droppers in the switch set, but decided that being able to optionally include a non-dropping familiar as your last option, after the others were done, was probably preferable, as well as definitely faster, because it only looks through the 10 currently defined instead of all 100+ options.

Edit: Bah... lost my fix for validating that there weren't an impossible number of counters before eating fortune cookies, to keep from eating 6 fortune cookies if you had always 1 set and crafted through your SR turn. I'll need to try to replicate that code eventually.
 
Last edited:

Theraze

Active member
Another fix, this time for Avatar of Boris. If you're in a Boris run, you can't change your familiar. As such, fam_check should return true on all checks if you're Boris.
Code:
boolean fam_check() {
	// first, enforce 100% runs
   if (my_class() == $class[Avatar of Boris]) return true;
   if (to_familiar(vars["is_100_run"]) != $familiar[none]) {
 

roippi

Developer
Possible feature request: unequip the mega gem once you've beaten dr. awkward, replacing it with.. anything better. Conveniently, someone already added quest tracking to mafia for this (questL11Palindome=="finished").

Understandably, if determining what to replace it with is too much of a chore, feel free to reject.
 

Theraze

Active member
Another suggested tweak... if you're on a BI run, you need the Gallery, regardless of primestat.
Code:
             (my_primestat() == $stat[muscle] || my_level() > 13 || to_item(get_property("currentBountyItem")) == $item[non-euclidean hoof] || my_path() == "Bugbear Invasion")) {
 

Rinn

Developer
Stomping boots probably shouldn't be a default in the familiar list because that would also require a ccs change for the drops to ever get acquired (same would hold true for the happy medium if you had added it).
 

Guimoiun

New member
Is there a way to configure the script to get spleen items and then return to turtle taming, for HCO turtle tamers who want to make sure they're getting the most out of the most possible adventures?
 
Another suggested tweak... if you're on a BI run, you need the Gallery, regardless of primestat.
Code:
             (my_primestat() == $stat[muscle] || my_level() > 13 || to_item(get_property("currentBountyItem")) == $item[non-euclidean hoof] || my_path() == "Bugbear Invasion")) {

Thanks, I was going to complain about Bugbear Invasion and Moxie classes, then I saw this. I have been manually adventuring in the library because BBB was changing my choice adventure selections on me. ;)
 

Theraze

Active member
Same problem for myst classes... it's anyone non-muscle, below level 13, without a gallery bounty (which you would have had to manually get, since the bounty scripts check for unlocked zones first). :) But yeah, that made me much less sad. Heh.
 

jwylot

Member
Stomping boots probably shouldn't be a default in the familiar list because that would also require a ccs change for the drops to ever get acquired (same would hold true for the happy medium if you had added it).

I tend to include the lines below in my CCS as a matter of course which take care of both the boots and the happy medium.

Code:
skill release the boots
if happymediumglow red
    skill siphon spirit
endif
 

Theraze

Active member
Most people have probably already noticed this and changed it, but... cookiecheck needs to be updated for Zombie Masters. I've changed the first line like so:
Code:
boolean cookiecheck() {
   if (my_fullness() >= fullness_limit() || !can_eat() || my_class() == $class[Zombie Master]) return true;
   matcher cooks = create_matcher("(timely|always|true|never|false) ?([1-3]?)",vars["auto_semirare"]);
This makes it not try to eat cookies if I'm a ZM.
 
Most people have probably already noticed this and changed it, but... cookiecheck needs to be updated for Zombie Masters. I've changed the first line like so:
Code:
boolean cookiecheck() {
   if (my_fullness() >= fullness_limit() || !can_eat() || my_class() == $class[Zombie Master]) return true;
   matcher cooks = create_matcher("(timely|always|true|never|false) ?([1-3]?)",vars["auto_semirare"]);
This makes it not try to eat cookies if I'm a ZM.

:)
 
Would it be possible to add something to this script to abort other scripts and adventuring if you have a hunter brain and fullness to eat it?
 
Top