The code is behaving precisely as you requested it to. You told it "when I encounter choice adventure #504, take choice #3", and that is what it does. The problem is, unlike any previous choice adventures, when you take the choice, you are given the same choice again. (Well, some Game Grid games are coded like that, but we don't provide choice adventure settings for those.)
I am really, really tired of people describing Feature Requests as "bugs". Heck, isn't it obvious that if you want "buy a spooky sapling if I don't have one and I haven't done the temple quest", that requires special code?
And, gee, I am really, really sorry that the current behavior is "annoying, of course". We obviously worked hard to write code that would "annoy" you. I mean, that's the purpose of KoLmafia and the end-goal of all our hard work: to "annoy" users.
Edit: You say in post one that you had "options set to buy a spooky sapling". Here is your code:
Code:
if (item_amount($item[spooky sapling]) == 0) {
set_property("choiceAdventure502", "1");
set_property("choiceAdventure503", "3");
set_property("choiceAdventure504", "3");
cli_execute("goal clear");
cli_execute("goal add 1 choiceadv");
print("BCC: Let's get the sapling", "purple");
bumAdv($location[Spooky Forest]);
}
Yes, a side effect of setting the choice adventures like that is to acquire a spooky sapling, but you did not tell KoLmafia to "acquire a spooky sapling". You told it to respond to specific choice adventures in specific ways, and to adventure in the Spooky Forest until it sees a choice adventure, passes through a chain of choices, and exits from the choice.
KoLmafia does not have the FEATURE that you desire, which is that the Spooky Forest mega-choice behave more like the Louvre, with an associated "goal" preference to determine how to navigate through it.