Feature - Implemented counters warn/nowarn

fredg1

Member
Currently, counters nowarn <label> doesn't work if the counter already has exception locations. One of the counters which has that is the Wormwood counter.

On top of that, the Wormwood counter is re-built if absent at every page load, so you can guess that it was... uh... quite a handful to adventure uninterrupted when you had absinthe-minded...

This patch makes it possible to add or remove " loc=*" from a counter's label, no matter the current state of the counter: View attachment TurnCounter.java.patch


Only thing I couldn't test was if the exceptions were properly re-loaded when you removed " loc=*" from a counter.
 

Veracity

Developer
Staff member
Currently, counters nowarn <label> doesn't work if the counter already has exception locations. One of the counters which has that is the Wormwood counter.
What is an "exception location"?

The Wormwood counter is re-built if absent at every page load, so you can guess that it was... uh... quite a handful to adventure uninterrupted when you had absinthe-minded...
I have no idea what this means.

You're going to have to explain better what, exactly, your problem is.
 

fredg1

Member
"exception locations" are the locations that mafia will not stop you at if you go there while you "that" counter expires
 

Veracity

Developer
Staff member
Use the standard bug report format.

What did I do?
What did I expect to happen?
What actually happened?

Thanks.
 

fredg1

Member
for example, the wormwood counter is, normally, like this:

<number>:Wormwood loc=151 loc=152 loc=153 place.php?whichplace=wormwood:tinybottle.gif

(reminder that location 151, 152 and 153 are The Stately Pleasure Dome, The Mouldering Mansion and The Rogue Windmill, respectively)

This means that, when your turncount == the <number>, if you are about to adventure anywhere other than The Stately Pleasure Dome, The Mouldering Mansion or The Rogue Windmill, mafia will abort automation / will display a message in the relay browser

"loc=151 loc=152 loc=153" are the exception locations
 

fredg1

Member
Use the standard bug report format.

What did I do?
What did I expect to happen?
What actually happened?

Thanks.

counters nowarn <label> is supposed to make it so that "this" counter no longer warns you when it expires.

However, if that counter already has exception locations (the " loc=#"), it does not work (nothing happens).

This makes it work.
 

Veracity

Developer
Staff member
I'll think about this later.

Consider that The Wormwood was, literally, the reason KoLmafia originally introduced counters. I believe the expectation was that if you chose to get Absinthe Minded, you intended to adventure in The Wormwood. Because, after all, why would you bother to consume the tiny bottle of absinthe if you WEREN'T going to adventure there?

Do I understand that you consumed a tiny bottle of absinthe and decided to adventure somewhere else on the "trigger" adventures?
Why? You got bored? And "counters clear" or "uneffect Absinthe Minded" did not cure your boredom?
 

fredg1

Member
It's not for me actually, but I can still relate
One word. Guzzlr.
(also, there's the fact that you may want to do free fights meanwhile, and mafia will still stop you then.)
 

fredg1

Member
Also also, as I said, "counters clear" does not work, as mafia adds this counter back any time it sees absinthe-minded without that counter active.
 

Veracity

Developer
Staff member
OK, you are adventuring in The Wormwood looking for a Guzzlr client or until you get a lathe ingredient.
Once you get it, you want to stop adventuring there, but KoLmafia wants to remind you of the special trigger locations, as it should, had you been planning on spending the full 10 turns there to get a reward.
But, you claim, "counters clear" doesn't stop the wormwood counter?

I'll think about this tomorrow.
 

fronobulax

Developer
Staff member
FWIW I just finished doing a bunch of bounties. There were a couple of cases where I would use a potion (or similar) adventure until I got the bounty and then mafia or KoL was pretty aggressive at having me adventure in the area I had "unlocked" until the unlocking effect wore off. I was not deliberately running counters but that is not to say counters were off or inactive. It never occurred to me to try and uneffect something so I just sucked up a few adventures until things expired.

If I were going to burn some turns checking this out I think I recall Wormwood, astral mushrooms. llama gongs, and agua de vida as being associated with being "forced" to burn turns.
 
OK, you are adventuring in The Wormwood looking for a Guzzlr client or until you get a lathe ingredient.
Once you get it, you want to stop adventuring there, but KoLmafia wants to remind you of the special trigger locations, as it should, had you been planning on spending the full 10 turns there to get a reward.
But, you claim, "counters clear" doesn't stop the wormwood counter?

I'll think about this tomorrow.

Yes. My wanderer handling will go to the wormwood if there's a guzzlr quest there (and probably professor relativity the crap out of that one wanderer so I'm done wthin a single absinthe), but then the counters will stop the rest of my automation.
And just can't find a way to make the counter go away, or make it not warn me, aside from the nuclear option (which would be to set dontStopForCounters to true and not get warned by anything).
"counters clear" and stop_counter() both successfully remove the counter, but only until mafia reparses the character pane and realizes that I have the wormwood buff without a matching counter.
 
I got another guzzlr quest in the wormwood today, and I made a couple of observations: if I use stop_counter() to remove the wormwood counter when it's at 0 turns, mafia will make a new one, but it will be the NEXT one (probably because it assumes I already got this one?). So if I can get my script to time that right, I should be able to avoid this problem. Lets see how often the following snippet tossed into my afterAdventure script will fail.
Code:
 	if ( get_counters("Wormwood",0,0) == "Wormwood" && get_property_loc("guzzlrQuestLocation").zone == "Wormwood" ) {
		stop_counter("Wormwood");

And option B: Maybe I just need to learn how to make a counterScript.
 
Last edited:

Veracity

Developer
Staff member
I will consider your TurnCounter patch by itself, eventually. The use-case I want to address is this:

How can I adventure in (or out) of the Wormwood without being nagged by Wormwood counters? I'm I am not planning on cycling through a sequence of 3 non-combats in different zones, but simply want to adventure in location W for a set-number of turns - or until a condition is satisfied - the counters are irrelevant.

I reminded myself how the zone works from the WIki:

There is a way to spend the least possible number of turns yet still gain your prize. You only need to adventure in the appropriate area for the first choice adventure with 9-7 turns of Absinthe-Minded until it comes up. Then you only need to adventure in the second area with 5-4 turns of Absinthe-Minded until it comes up. Finally, adventure there with 1 turn of Absinthe-Minded for the last choice adventure. You may adventure outside of the Worm Wood zones until the Absinthe-Minded effect reaches 9, 5, or 1 turn remaining; and then as soon as you get the appropriate choice adventure you can leave again. Just make sure that you adventure in the right area during the right interval.

Looking at how we maintain our counters, we mainain exactly one wormwood counter at a time: when we refresh the charpane, we start the NEXT Wormwood counter based on number of turns of Absinthe-Minded we currently have. In particular, either 9 turns left of the effect, 5 turns left of the effect, and 1 turn left of the effect. We will automatically create the next counter for you each time the charpane refreshes.

I propose we handle the counters in a different way: when you get Absinthe-Minded, start THREE counters - turn 9, 5, and 1. If you leave the counters active, you'll get a nag at each of those turns, and the counter will go away. If cou clear one or all of the counters, they go away and are not recreated.

I'll try this out. How hard can it be?
 

Veracity

Developer
Staff member
Revision 20451 includes your patch and also creates 3 Wormwood counters when you use a tiny bottle of absinthe. These counters are no longer re-created when charpane.php or api.php notices you are Absinthe-Minded. I tested the following:

Getting absinthe-mined and adventuring in the Relay Browser out of the Wormwood. The counters worked as before.
counters clear
ash stop_counters( "Wormwood" )
counters nowarn Wormwood
clicking on each counter in turn in the Relay Browser to remove that counter.

All of those allowed me to adventure out of the Wormwood with no nag. The "nowarn" case still logged that the counter expired, but it did not stop adventuring..
 

Veracity

Developer
Staff member
Revision 20452 adds "counters stop LABEL", which is the same as "ash stop_counter) LABEL )"

Code:
[color=green]> counters[/color]

Last semirare found 43 turns ago (on turn 10992) in The Castle in the Clouds in the Sky (Top Floor)

Unexpired counters:
Fortune Cookie (140)

[color=green]> counters add 10[/color]

Last semirare found 43 turns ago (on turn 10992) in The Castle in the Clouds in the Sky (Top Floor)

Unexpired counters:
Fortune Cookie (140)
Manual (10)

[color=green]> counters stop Manual[/color]

Last semirare found 43 turns ago (on turn 10992) in The Castle in the Clouds in the Sky (Top Floor)

Unexpired counters:
Fortune Cookie (140)
 

PeKaJe

Member
It appears that something in 20451 broke "counters warn". The "relayCounters" preference is updated, but something in the internal state doesn't see the change.
 
Top