Best Between Battle Script Ever -- formerly AutoMCD

Theraze

Active member
My copy of that is saved as flavourScript.ash. I then have a file named beforeBattle.ash which has the following:
Code:
import <BestBetweenBattle.ash>;
import <flavourScript.ash>;

void main() {
	bbb(); 
	flavour();
}
I have beforeBattle.ash set as my betweenBattleScript.
 

zarqon

Well-known member
It just seems really odd to use cli_execute("use * evil eye"); instead of use(item_amount($item[evil eye]), $item[evil eye]);

This is a very old habit of mine, since I seem to recall the return value of use() being unpredictable (this may no longer be the case, I have no idea). Thus, you'd also want to put the ASH command behind an if (item_amount() > 0) check to avoid the script stopping if use() returns false. So using ASH, you must type out the $item thrice, and request the item amount twice. The cli_execute call does all that with an asterisk and never stops your script. Again, this may have changed, but if it ain't broke...

In short, that's just me scripting as a linguist again.
 

Bale

Minion
I seem to recall the return value of use() being unpredictable (this may no longer be the case, I have no idea).

Oh dear. That was quite the drama once upon a time. Way back in the past, after you complained about that in a thread, Veracity got irked and insisted that you should have bug reported it properly if the return value was unreliable. (You might have noticed she gets upset when people talk about KoLmafia's failures without ever reporting them as bugs.) After much hullabaloo the bug was fixed. In other words, that is no longer the case and you were responsible for having it fixed.
 

digitrev

Member
Very minor report here: a special case needs to be made for the Machine Elf in the dropfam() section, since their "drop" is a free fight in the DMT.
 

fronobulax

Developer
Staff member
So I just discovered the circumstances under which BBS would pulverize wool hats and goatskin umbrellas. There is a part of me that does not like that and would rather delegate the decision and action to OCD, but my question now is Why? Is there some feature/benefit/game mechanic that makes/made this A Good Thing? Thanks.
 

Crowther

Active member
So I just discovered the circumstances under which BBS would pulverize wool hats and goatskin umbrellas. There is a part of me that does not like that and would rather delegate the decision and action to OCD, but my question now is Why? Is there some feature/benefit/game mechanic that makes/made this A Good Thing? Thanks.
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
 

digitrev

Member
Request: can you check to see if someone is using a familiarScript (get_property("familiarScript") != "") before changing familiar equipment? I've made some changes to allow BBB to keep changing familiars while I'm underwater, but it keeps trying to force my Goth Kid to wear a mannequin. I personally made the following change:
Code:
boolean use_fam(familiar f) {
   use_familiar(f);
   if (to_boolean(vars["bbb_famitems"]) && get_property("familiarScript") == "") switch (my_familiar()) {
      case $familiar[artistic goth kid]:
      case $familiar[astral badger]:     // these equipments speed rewards from fams
      case $familiar[knob goblin organ grinder]: if (!have_equipped(familiar_equipment(my_familiar())) && available_amount(familiar_equipment(my_familiar())) > 0 &&
         retrieve_item(1,familiar_equipment(my_familiar()))) equip(familiar_equipment(my_familiar())); break;
     // TODO: snow suit drops?
   }
   cli_execute("checkpoint clear");
   return (my_familiar() == f);
}
 

VladYvhuce

Member
A simple question that may have a way more complex answer than I expected: Is there some way to make BBB farm familiar items in a priority format, rather than switching to a different familiar after each individual item? For example: "keep the Fist Turkey until you get 5 turkey boozes, then switch to the Adventurous Spelunker until you get 1 Tales of Spelunking", and so on though a list of familiars? I have some familiars that BBB wants to farm items from that I don't want it to switch to (I don't need pies right now), so's to farm the item familiars I wan to farm. Sorry to be a bother if there are settings for this that I'm just not educated enough to figure out... When it comes to scripts and programming, I'm just flailing around hoping not to break something, and often ending up breaking something in such a way as to hurt the heads of those who made it.
 

theo1001

Member
There doesn't seem to be a setting but you can always edit the script to make it do so. The function that decides which familiar to switch to is called dropfam(). It shouldn't be hard to modify it so it does what you want.
 

VladYvhuce

Member
Cool. I'll try playing around with it after I get some sleep this afternoon. Last time I tried editing code without sleep, I kept accidentally deleting an integral part of the script I was modifying... And not being able to fix it, had to keep restoring the script.
 

adeyke

Member
I think this should be added to the choiceadv management for KOLHS:
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","Sit with the Jocks");
else if (have_effect($effect[Nerd is the Word]) > 0) friendlyset(700,"2","Sit with the Nerds");
else if (have_effect($effect[Greaser Lightnin']) > 0) friendlyset(700,"3","Sit with the Greasers");
return;
 

zarqon

Well-known member
Just a note to anyone wondering where I've been with this script. I've been working on a mood script which I'm pretty excited about, and have moved all the choiceadv handling (which has also grown somewhat) there. Choiceadv handling works better as a mood script anyway, since it will always fire in relay play as well. That means as soon as I update BBB, all the choiceadv handling goes away, so I need to have the mood script ready to go before I can update BBB.

And it's not quite ready to go. There are four modifiers I'd like it to handle extremely well: Combat Rate, Monster Level, Initiative, and Item Drop. It's handling all but Item Drop pretty well at the moment, but I have some improvements I'd like to make before releasing it into the wild. So hang on just a bit longer, everyone.

@adeyke: I have added your code to the new mood script. :)

I have attached my current version of BBB below in case anyone would like to use it or stitch the choiceadv handling back in. The changes include:

  • Ghost hunting! Will hunt ghosts whenever you have paranormal activity detected. Requires CCS to handle ghosts, though the next SS/BB update will add Shooting/Trapping ghosts. Toggled by the bbb_huntghosts setting (default true).
  • Since BBB was last updated, half a dozen more monster copying mechanisms have been introduced. BBB now fights those as well in fight_items().
  • Skip physical damage familiars in the broodling grounds.
Enjoy!
 

Attachments

  • BestBetweenBattle.ash
    12.6 KB · Views: 44

lostcalpolydude

Developer
Staff member
Choiceadv handling works better as a mood script anyway, since it will always fire in relay play as well.

There's a setting to control whether moods apply during manual adventuring, just as there is one for running a betweenBattleScript, so I don't understand what this means.
 

Bale

Minion
I agree with lost. I have never once had a problem with my betweenBattleScript not activating before adventuring in the relay browser thanks to setting that preference. As I recall that preference was added to mafia specifically because of this script.

No need for a separate mood script. My personal preBattleScript even does a little bit of mood handling.
 

Bale

Minion
Ghost hunting! Will hunt ghosts whenever you have paranormal activity detected. Requires CCS to handle ghosts, though the next SS/BB update will add Shooting/Trapping ghosts. Toggled by the bbb_huntghosts setting (default true).

There's four bugs with your ghostbusting implementation.
  1. You should trap the error condition from adv1() because if the character has adventuring goals, it will return false causing the script to abort.
  2. You equip the protonic accelerator pack before adv1(), but if the character was wearing something else on his back you don't re-equip it after adv1().
  3. If the ghost is in the Palindome you try to adventure without the talisman o namsilat.
  4. If the ghost is in one of the three starter locations (The Skeleton Store, The Overgrown Lot, Madness Bakery) it might not have been opened by the player yet which would cause an abort when you try to adventure there.

Here's the function that I use which deals with all these issues. (it also removes a combat familiar to keep from accidentally killing ghosts through a method other than trap ghost.

Code:
void bustGhost() {
	item acc3;
	familiar fam;
	location ghostLocation = to_location(get_property("ghostLocation"));
	if(my_inebriety() <= inebriety_limit() && to_boolean(get_property("kingLiberated")) && ghostLocation != $location[none]) { # && my_location() != ghostLocation) {
		switch(ghostLocation) {
		case $location[Inside the Palindome]:
			acc3 = equipped_item($slot[acc3]);
			equip($slot[acc3], $item[Talisman o' Namsilat]);
			break;
		case $location[The Skeleton Store]:
			if(get_property("questM23Meatsmith") == "unstarted") {
				visit_url("shop.php?whichshop=meatsmith&action=talk");
				run_choice(1);
			}
			break;
		case $location[The Overgrown Lot]:
			if(get_property("questM24Doc") == "unstarted") {
				visit_url("shop.php?whichshop=doc&action=talk");
				run_choice(1);
			}
			break;
		case $location[Madness Bakery]:
			if(get_property("questM25Armorer") == "unstarted") {
				visit_url("shop.php?whichshop=armory&action=talk");
				run_choice(1);
			}
			break;
		}
		item back;
		if(!have_equipped($item[protonic accelerator pack])) {
			back = equipped_item($slot[back]);
			equip($item[protonic accelerator pack]);
		}
		if(my_familiar().combat) {
			fam = my_familiar();
			use_familiar($familiar[none]);
		}
		(!adv1(ghostLocation, -1, "while hasskill Shoot Ghost; skill Shoot Ghost; if hasskill Trap Ghost; skill Trap Ghost; endif; endwhile;")); // Trap error condition in case I'm adventuring with goals
		if(acc3 != $item[none])
			equip($slot[acc3], acc3);
		if(fam != $familiar[none])
			use_familiar(fam);
		if(back != $item[none])
			equip(back);
	}
}
 

fronobulax

Developer
Staff member
from the SVN version... r21?

Multiple matches for "spookyraven library key"; using "[7302]Spookyraven library key". (BestBetweenBattle.ash, line 293) Clarify by using one of:
$item[[1764]Spookyraven library key]
$item[[7302]Spookyraven library key]
 
When using famitems, if it gets to stomping boots it'll never get past it because it requires you to use release the boots. Could it do so? (or just allow you to blacklist certain drop familiars).
 
Appending "release the boots + siphon spirits + etc" to my combat macro solves the first problem, but it's still going through familiars I'd rather not use turns on.
 
Top