Best Between Battle Script Ever -- formerly AutoMCD

For the convention hall, the slimeform potion will always be a 3-color potion. Using up vials just to identify 1-color potions or 2-potions is a waste when the goal is just the slimeform effect.
 
For the convention hall, the slimeform potion will always be a 3-color potion. Using up vials just to identify 1-color potions or 2-potions is a waste when the goal is just the slimeform effect.

You can change the first integer in line 161 to for i from 3891 to 3896 { and if you do it according to these instructions the change will persist (thanks to SVN merging) even after zarqon updates BBB again.
 
I thought I might not be the only one to want the change. If the implementation runs contrary to the stated goal, that might just be a bug that should be fixed in the official version.

However, I do also have my own modification for the script. Maybe I'll try that SVN merge thing to avoid having to add it back in after each update.
 
Maybe I'll try that SVN merge thing to avoid having to add it back in after each update.

I adore the SVN merge thing. I used to avoid modifying scripts because it would mean I'd have to do some work every single time it got updated. Now I fiddle with other people's scripts without hesitation since I won't be making trouble for myself.
 
I adore the SVN merge thing. I used to avoid modifying scripts because it would mean I'd have to do some work every single time it got updated. Now I fiddle with other people's scripts without hesitation since I won't be making trouble for myself.

Unless Bale goes and does a total code revamp everytime so the SVN-merge thing goes into "'ey there's a conflict here. Fix plz!" :)
(has happened the last 4 updates or so for topmenu)
 
Unless Bale goes and does a total code revamp everytime so the SVN-merge thing goes into "'ey there's a conflict here. Fix plz!" :)
(has happened the last 4 updates or so for topmenu)

The last time was your fault! You inspired me to make different changes to the exact code you had already changed.

Before that... well, I was experimenting with how much I can completely re-factor a really tiny script just to screw with you. My bad. I was aware when I was doing it that it might be bad for folks who modified topmenu, but it was so disorderly that I felt an inescapable compulsion to straighten it out. Are you still using a personalized variant of topmenu or did my last fix actually incorporate everything you needed?
 
Last edited:
I only have one small change left now which is to shrink the clan-hopping dropdown to 100 pixels or so since it overlapped with the friar and clanlog images before that which is probably an effect of my resolution rather than anything else.
 
:Feature Request:
Zlib setting or general functionality for switching back to originally equipped familiar after BBB has switched in all familiars with farmable items.
 
I'm back, and I'm having issues w/ dolphins again.
I'm manually adventuring, and running a semi-costly set of buffs to minimize turn count underwater. But I keep running out sooner than I expect, and I realized that was the fault of BBB. Every time a dolphin steals something it deems worthy, it stops me from adventuring so it can fight the thief. I appreciate this when it's my goal and I'm auto-running, but the cost of that turn of those buffs is > the cost of the killscroll it just grabbed. If the item is that important, I'll go grab it myself while manually adventuring.

I guess what I'm asking in a round about TL: DR method is "Is there an option to stop hunting dolphins? And if not, could one be added?"
 
Last edited:
Or you could just comment out lines 428-435. It seems like a better solution:

Code:
[B][COLOR="#FF0000"]#[/COLOR][/B]   if (to_item(get_property("dolphinItem")) != $item[none]) {
[B][COLOR="#FF0000"]#[/COLOR][/B]      if ((has_goal(to_item(get_property("dolphinItem"))) > 0 && get_property("dolphinItem") != "sand dollar") || (count(get_goals()) == 0 &&
[B][COLOR="#FF0000"]#[/COLOR][/B]           mall_price(to_item(get_property("dolphinItem"))) > 2*(min(mall_price($item[sand dollar]),mall_price($item[dolphin whistle])) + get_property("valueOfAdventure").to_int()))) {
[B][COLOR="#FF0000"]#[/COLOR][/B]         vprint("Whistling for a "+get_property("dolphinItem")+"...","blue",2);
[B][COLOR="#FF0000"]#[/COLOR][/B]         restore_hp(0);     // recover here since recovery is not triggered normally
[B][COLOR="#FF0000"]#[/COLOR][/B]         if (retrieve_item(1,$item[dolphin whistle])) use(1,$item[dolphin whistle]);
[B][COLOR="#FF0000"]#[/COLOR][/B]      }
[B][COLOR="#FF0000"]#[/COLOR][/B]   }

Or maybe it would be easier and simpler just to make a quirky change to line 428:

Code:
   if ([COLOR="#FF0000"][B]false &&[/B][/COLOR] to_item(get_property("dolphinItem")) != $item[none]) {
      if ((has_goal(to_item(get_property("dolphinItem"))) > 0 && get_property("dolphinItem") != "sand dollar") || (count(get_goals()) == 0 &&
           mall_price(to_item(get_property("dolphinItem"))) > 2*(min(mall_price($item[sand dollar]),mall_price($item[dolphin whistle])) + get_property("valueOfAdventure").to_int()))) {
         vprint("Whistling for a "+get_property("dolphinItem")+"...","blue",2);
         restore_hp(0);     // recover here since recovery is not triggered normally
         if (retrieve_item(1,$item[dolphin whistle])) use(1,$item[dolphin whistle]);
      }
   }

Useful reading.
 
Last edited:
Code:
[B][COLOR="#FF0000"]/*[/COLOR][/B]
   if (to_item(get_property("dolphinItem")) != $item[none]) {
      if ((has_goal(to_item(get_property("dolphinItem"))) > 0 && get_property("dolphinItem") != "sand dollar") || (count(get_goals()) == 0 &&
           mall_price(to_item(get_property("dolphinItem"))) > 2*(min(mall_price($item[sand dollar]),mall_price($item[dolphin whistle])) + get_property("valueOfAdventure").to_int()))) {
         vprint("Whistling for a "+get_property("dolphinItem")+"...","blue",2);
         restore_hp(0);     // recover here since recovery is not triggered normally
         if (retrieve_item(1,$item[dolphin whistle])) use(1,$item[dolphin whistle]);
      }
   }
[B][COLOR="#FF0000"]*/[/COLOR][/B]
?
 
So many ways to do this, but a zlib variable to control the behavior would be a good feature to add.
 
Here's a recent update to my own variant:

Code:
	case $location[The Hallowed Halls]:
	case $location[Shop Class]:
	case $location[Chemistry Class]:
	case $location[Art Class]:
		if(have_effect($effect[Jamming with the Jocks]) > 0)
			friendlyset(700, 1,"KOLHS: Sit with the Jocks");
		else if(have_effect($effect[Nerd is the Word]) > 0)
			friendlyset(700, 2,"KOLHS: Sit with the Nerds");
		else if(have_effect($effect[Greaser Lightnin']) > 0)
			friendlyset(700, 3,"KOLHS: Sit with the Greasers");
		else
			friendlyset(700, 0,"KOLHS: Nowhere to sit during luch");
		return;
 
Well yeah that works. But I'm not running tons of buffs when I farm for crafting ingredients or go to madness reef, so a variable to change it depending on what I'm doing would be nice.
 
BBB used to work, but lately I've been getting errors. I don't recall changing anything...

Code:
 Function 'is_goal( stat )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (BestBetweenBattle.ash, line 121)

using the latest version of mafia (r12538) and I svn update every log-in.

Removing all instances of is_goal($stat[]) works, but I don't understand what changed..
 
r8 Update

First off, this revision adds a lot of little tweaks suggested in this thread:

  • There is now a setting named bbb_dolphin_goodies (default true) which controls whether or not to automatically whistle for non-goal items. Goal items will always be whistled for, regardless of setting, but if this setting is false, BBB will never whistle for items which are not goals, even if it believes that to be profitable.
  • I finally found what broke when we removed the "bounties are automatically goals" code from ZLib's has_goal(). When SS copies a bounty monster, this script is what ought to keep fighting them, until you're out of copies. However, after that ZLib change, this script wouldn't fight copies of bounty monsters anymore when the bounty wasn't explicitly set as a goal. Fixed that.
  • Theraze pointed out that running contains_text() on run_combat() every turn is expensive, so now that's after a much less expensive have_equipped() check.
  • And a few more improvements to familiar drop farming. First, I added two more familiars: the Gelatinous Cubeling and the Artistic Goth Kid. The Cubeling will be used if you lack any of its three special drops. The Kid will only be used if you've broken your stone or if you don't have a Hipster. Note that the Kid enters regular rotation, so both your Hipster and your Kid will be used unless you manually edit out the Hipster. Next, we automatically equip familiar-specific gear where possible for the Goth Kid, Astral Badger, and Knob Goblin Organ Grinder, since equipping those helps you get more drops.

Second, we have support for a couple more zones:

  • Bale's Chinatown Tenement code. More of his suggestions will likely be added as I understand/evaluate them. Thanks for all your contributions to this script Bale!

  • Initial support for the Daily Dungeon!
    • Chests 5 and 10: If any of the possible items are goals, open the chest. Otherwise, if you have the ring of detect boring doors equipped, skip ahead. Otherwise, skip the chest.
    • Doors: Open the door for free when possible (with PYEC, Lockpicks, or skeleton key). Otherwise, open the door with your primestat.
    • Traps: Use your 11-ft. pole if you have one. Otherwise, just take the trap in the face. For now, there is no special handling for getting stats from the traps, though this may be added later.

Enjoy!

@PartyBasher: It seems that you have an old version of ZLib lurking somewhere in your KoLmafia directory.

@halfvoid: Add this to your mood:

Code:
Trigger: unconditional
Command: ashq if (get_property("_lastDropPref").to_int() == 5 && my_familiar() == $familiar[lastdropfamiliar]) use_familiar($familiar[familiariwanttogobackto])

You'd want to set _lastDropPref, lastdropfamiliar, and familiariwanttogobackto to whatever those values should actually be for you (and maybe the '5' as well), but that will do what you requested.
 
@halfvoid: Add this to your mood:

Code:
Trigger: unconditional
Command: ashq if (get_property("_lastDropPref").to_int() == 5 && my_familiar() == $familiar[lastdropfamiliar]) use_familiar($familiar[familiariwanttogobackto])

You'd want to set _lastDropPref, lastdropfamiliar, and familiariwanttogobackto to whatever those values should actually be for you (and maybe the '5' as well), but that will do what you requested.

Awesome, Thanks!
 
You're welcome! Depending on your familiar equipment situation you may also need a "checkpoint clear", since moods are checkpointed and mafia may attempt to equip the item you had on your previous familiar after your mood swaps familiars.
 
Back
Top