hugsnotdrugs
New member
Update to a newer version of mafia:
builds.kolmafia.us
Fixed it! Fantastic, thanks a lot.
Update to a newer version of mafia:
builds.kolmafia.us
Visit to Woods: Hidden City in progress...
[790] Hidden City (Square 24)
Encounter: Altared Perceptions
Visit to Woods: Hidden City in progress...
[790] Hidden City (Square 24)
Encounter: Altared Perceptions
Visit to Woods: Hidden City in progress...
[790] Hidden City (Square 24)
Encounter: Altared Perceptions
Visit to Woods: Hidden City in progress...
[790] Hidden City (Square 24)
Encounter: Altared Perceptions
set_property("hiddenCitySquare",get_first(hunt));
if (!adventure(1,$location[hidden city])) return error("adventure returned false");
prop = to_lower_case(get_property("hiddenCityLayout"));
hiddencity square [temple|altar itemId] - set Hidden City square [and perform an action there].
[2174] has no matches.
Unexpected error, debug log printed.
If it doesn't take an adventure to reveal an alter, then it isn't surprising that this will loop. It's trying REALLY hard to spend that 1 adventure. You'll have to use a version of Alhifar's run_adv(). Something likeAnd so forth. With debugging print statements I've tracked down the problem to these lines (specifically the middle one):
Code:set_property("hiddenCitySquare",get_first(hunt)); if (!adventure(1,$location[hidden city])) return error("adventure returned false"); prop = to_lower_case(get_property("hiddenCityLayout"));
The first line executes fine, setting the property to the value of the next unexplored square. Then the line containing adventure() loops -- wtf! The error message is never displayed, and the next line never gets executed.
boolean explore_square() {
page_text = visit_url(to_url($location[Hidden City]));
matcher m_choice = create_matcher("whichchoice value=(\\d+)", page_text);
while(contains_text(page_text, "choice.php") {
m_choice.reset(page_text);
m_choice.find();
string choice_adv_num = m_choice.group(1);
string choice_num = get_property("choiceAdventure" + choice_adv_num);
if(choice_num == "0") return error("Manual control requested for choice #" + choice_adv_num);
if(choice_num == "") return error("Unsupported Choice Adventure!");
page_text = visit_url("choice.php?pwd&whichchoice=" + choice_adv_num + "&option=" + choice_num);
}
if(contains_text(page_text , "Combat")) run_combat();
return true;
}
I think instead of using adventure() ... you could use boolean adv1( location, int, string ), which tries to spend 1 turn 1 time in a given location.
cli_execute("hiddencity " + square + " altar \u00B6" + itemID)(Important: no space between the \u00B6 and the ID.)
I do think I'll end up making the combat CCS more all-purpose, rather than just for physically resistant monsters. As I've been developing it, it has evolved into a bunch of more general-purpose combat functions. The hardest part will actually be estimating damage dealt and received -- it will have to consider monster elements and resistances, spell damage modifiers, your current resistance levels, etc. I need to develop functions that handle a "damage" type, which will be a bit more complicated than just an int.