Experiencing odd problems with auto-stops/hard stops

wiffleballbat

New member
Hello all,

I'm experiencing a number of odd problems in the ascension script I've been working on for a while (yes, I am aware of the alternatives, but I wanted to make my own to learn how ASH works and to better tune it for my character's items, permed skills, and play-style). I've tried googling for solutions to these problems but haven't found anything that works yet, except that my problem seems to be related to a feature called auto-stops and hard stops (not sure if they're necessarily the same thing).

My first problem is that I can't work around my script aborting after Drawn Onward. I know I'm going to be beaten up at that point, so I have my script set up to use the hot tub if it's available, or use tongue of the walrus if not, but the script aborts before I get the chance to use them. Should I be setting an auto-recovery script instead? Or is there some other way around this?

My second problem is the worst one. My script will be chugging along, and suddenly I'll get a red-colored message about something like the SR window expiring. My script will then jump to a different ascension task without aborting, which usually leads to many turns being wasted leveling if I'm not paying attention. I'd like to disable whatever feature causes this to happen.

Here's the main loop:
Code:
while (my_adventures() > 0 && my_inebriety() <= inebriety_limit()) {
	learn_class_skills();
	if (fill_stomach()) continue;
	if (fill_liver()) continue;
	if (fill_spleen()) continue;

	// quests
	council();
	if (do_guild_challenge()) continue;
	if (start_epic_weapon_quest()) continue;
	if (do_l2_quest()) continue;
	if (unlock_spooky_temple()) continue;
	if (do_untinker_quest()) continue;
	if (unlock_8bit_realm()) continue;
	if (do_l3_quest()) continue;
	if (do_l4_quest()) continue;
	if (do_l5_quest()) continue;
	if (do_l6_quest()) continue;
	if (do_daily_dungeon()) continue;
	if (do_pandamonium_quest()) continue;
	if (get_digital_key()) continue;
	if (get_dinghy()) continue;
	if (get_hippy_outfit()) continue;
	if (do_l7_quest()) continue;
	if (unlock_spookyraven_manor()) continue;
	if (unlock_spookyraven_library()) continue;
	if (unlock_spookyraven_floor_2()) continue;
	if (unlock_spookyraven_gallery()) continue;
	if (unlock_spookyraven_ballroom()) continue;
	if (do_l8_quest()) continue;
	if (do_leaflet_quest()) continue;
	if (do_l9_quest()) continue;
	if (do_l10_quest()) continue;
	if (get_star_key()) continue;
	if (do_l11_start_quest()) continue;
	if (unlock_palindrome()) continue;
	if (get_war_frat_outfit()) continue;
	if (start_l12_quest()) continue;
	if (do_l12_lighthouse_quest()) continue;
	if (do_l11_spookyraven_quest()) continue;
	if (do_l11_palindrome_quest()) continue;
	if (do_l11_temple_quest()) continue;
	if (do_l11_pyramid_quest()) continue;
	if (do_l12_junkyard_quest()) continue;
	if (do_l12_arena_quest()) continue;
	if (do_l12_orchard_quest()) continue;
	if (do_l12_nunnery_quest()) continue;
	if (finish_l12_quest()) continue;
	if (do_l13_quest()) break;

	// If we hit this point, we need to level up more
	level_up();
}

Each function being used as a conditional in the ifs follows this format:
Code:
boolean task() {
  if (conditions) {
    // complete task here

    return true;
  } else {
    return false;
  }
}

And here's the wrapper function I use for adventures:
Code:
void custom_adventure(int num, location l, int buff_flags) {
	if (my_adventures() > num || (my_adventures() >= num && !can_vamp_out_stats())) {
		pre_adventure_buffs(buff_flags);
		adventure(num, l, "combat_consult");
		sell_junk();
	} else if (can_vamp_out_stats()) {
		vamp_out_stats();
	} else {
		abort("Out of adventures... :(");
	}
}

EDIT: I forgot to post my OS/version/Java version. Sorry about that:

KoLmafia v15.4 r11370, Windows 7, Java 1.7.0_09

I realize this version is a bit out of date, but I tried upgrading to a newer one about 3 weeks ago and it was causing even more bugs in my script*, so I've been sticking with 15.4 for compatibility reasons.

For example, it would sometimes complain that the skill "Throw Shield" didn't exist when using
Code:
if (have_skill($skill[throw shield])) {
  use_skill($skill[throw shield]);
}
Then it would jump to another task in my ascension script without finishing the first after the combat was over, similar to what happens with the SR window error.
 
Last edited:

Catch-22

Active member
I'll get a red-colored message about something like the SR window expiring. My script will then jump to a different ascension task without aborting, which usually leads to many turns being wasted leveling if I'm not paying attention. I'd like to disable whatever feature causes this to happen.

If you're using Bale's CounterChecker, I believe the preference you're after is zlib BaleCC_SemirareWindowContinue = true.

I'm sure there are others here more experienced than I am in writing ascension scripts, so hopefully they can help you with the rest.

As for your issues with using the latest version of KoLmafia, I suggest that you do use it and whatever issues crop up as a result, you post about in Community Support to work through it. There's rarely a change in KoLmafia that breaks backwards compatibility, so it possibly indicates something wrong with the script.
 

wiffleballbat

New member
Thanks for the quick response. I'll try to update my KolMafia version and debug my script for it once the world event is over.

Is using Bale's script with that setting the only way to disable the counters? If so, I might go that route.

I was lucky enough to observe the bug happening as I glanced at the CLI window. What seems to be happening is that the function seems to exit with a dummy value (false/0/""/$item[none]) when an error that doesn't cause a hard stop is encountered (in this case, the SR window, or the "skill does not exist" bug in the other version of KM that I tried). My script seems to be catching that dummy value in the if conditional of the main ascension loop, and then not continuing to the beginning of the loop as a result [I guess this would explain the odd "if (...) {}" pattern I noticed in some other scripts?].
 

Winterbay

Active member
Is using Bale's script with that setting the only way to disable the counters? If so, I might go that route.

Nope, you can define any kind of counter script of your own, possibly if you do not care at all, one that just ignores all counters that expires.
 
Top