From d0df789eb62fde8f76cf6edef00bbd00325c1847 Mon Sep 17 00:00:00 2001 From: taltamir <7625366+taltamir@users.noreply.github.com> Date: Mon, 4 Sep 2023 11:30:42 -0500 Subject: [PATCH] catch changes to last monster and reset counter when it changes. --- RELEASE/scripts/autoscend/auto_post_adv.ash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE/scripts/autoscend/auto_post_adv.ash b/RELEASE/scripts/autoscend/auto_post_adv.ash index 37444186c6..f5ae6bdaad 100644 --- a/RELEASE/scripts/autoscend/auto_post_adv.ash +++ b/RELEASE/scripts/autoscend/auto_post_adv.ash @@ -1077,11 +1077,18 @@ boolean auto_post_adventure() //works with code found in auto_pre_adv.ash if(my_session_adv() == get_property("_auto_inf_session_adv").to_int()) { - auto_log_debug("auto_post_adv.ash detected that no adventure was spent"); + auto_log_debug("auto_post_adv.ash detected that no adventure was spent since last auto_pre_adv.ash"); //count how many times in a row we went with no adv spent set_property("_auto_inf_counter", get_property("_auto_inf_counter").to_int()+1); + //if last monster changed it means we are doing free combats + if(get_property("_auto_inf_last_monster").to_monster() != last_monster()) + { + remove_property("_auto_inf_counter"); //reset counter + } + set_property("_auto_inf_last_monster", last_monster()); + if(get_property("_auto_inf_counter").to_int() >= 30) { auto_log_error("no adventure was spent " +get_property("_auto_inf_counter")+ " times in a row which suggests we are stuck in an infinite loop. Stopping autoscend");