CounterChecker: Wormwood, Semi-rares, Dance Cards and more

There seems to be a small problem with ImprovePoolSkills, in that it seems to always adventure at the Haunted Billiards Room when enabled despite that one can not get A Shark's Chum on consecutive occasions (I attempted this on 4 separate counter expirations, but yeah, playing "at every opportunity" does not seem to work).

I suspect that the whole option may be reworked, because the locale in "if(ImprovePoolSkills && locale != $location[Haunted Billiards Room])" references expensive_semi(), which will not return the Haunted Billiards Room on most occasions (or ever, if it was the last semi-rare obtained). Perhaps another check in expensive_semi() along the lines of the PLD check? If last != HBR && ImprovePoolSkills, always return HBR, otherwise perform the normal check for most expensive?

I was just trying this option out and noticed this, but great work as always.
 
Oh heck. You're quite right! It was actually easier to fix than you suggest.

I've been meaning to rewrite it to take advantage of zlib's new ability to set variables. As soon as I can do that, I'll update the first post. For now you can use the version I'm attaching right here.
 
Last edited:
Hey Bale
I need a little help improving this function:
http://kolmafia.us/showthread.php?t=2039&highlight=semirare&page=2
due to this update:
http://kolmafia.us/showthread.php?t=2621&highlight=relaycounters

I noticed that your script checks the "semirareCounter" property, this property did not exist when I created my original script. Is this a user created property that you put in or is it a new mafia feature?

Do you know how to use the ash string get_counters(string, int, int) function? I cannot find an explanation of its use to know what parameters to pass to it.

thanks
 
get_property("semirareCounter") will return the turn on which you got your last semi-rare. This is a mafia feature, not something I did.

Information on get_counters() is in the changelog for r7511.

string get_counters(string label, int minTurns, int maxTurns)

label: counter to test for. An empty string will match any counter that takes an action. In other words, "" will match everything except for Communications Windchimes, PADL Phone or a user created non-action counter.

minTurns and maxTurns specify the endpoints (inclusive) of the range to be
checked. Passing the same value for both checks for an expiration on that
specific turn.

The function will test to see if any active counters match label. Return value is an empty string if no matching counters were found. If counters are found it returns a tab-delimited list.​

If you need any more help on your script, rest assured that I'll notice it if you post in your thread.
 
Bale
Back to your script...

Is there a way to have counterchecker.ash abort if it encounters a counter that your script does not directly support.

For example:

Code:
Request 20 of 25 (BatHole: Boss Bat's Lair) in progress...
(Harold's Bell counter expired)
Checking for updates (running CounterChecker ver. 1.2)...
_version_BaleCC => 1.2
Checking counters now.
It is time to do something because your Harold's Bell counter is up.

[577] Boss Bat's Lair
Encounter: The Boss Bat
Strategy: d:\Data\My Stuff\kol\Kol Mafia\ccs\pastaman.ccs [default]
Round 0: mredge73 wins initiative!
Running Zarqon's FTF
Round 1: mredge73 casts ENTANGLING NOODLES!
Casual Combat, re-revamped.
Round 2: mredge73 casts RAVIOLI SHURIKENS!
Round 2: the boss bat takes 38 damage.
Round 3: mredge73 casts RAVIOLI SHURIKENS!
Round 3: 6 Months Off Work dances the bossa-gnova, tipping you a wignk as he finishes with a flourish.
Round 3: the boss bat takes 38 damage.
You acquire an item: dense meat stack
You acquire an item: Boss Bat bandana
You gain 1 Strongness
You gain 5 Magicalness
You gain 2 Sarcasm
Combat finished!

Request 21 of 25 (BatHole: Boss Bat's Lair) in progress...
You can't get to that area.
In the above case I did not have my ML adjusted properly to get the reward from Boss Bat. The counterchecker.ash came up but did not stop the auto-adventuring.

Is there a way to throw an abort that would stop adventuring in this case?
Or would the abort just abort your script?
This could also be useful is someone would make their own counters and wanted to do something when they expired.
 
harold's bell is an informational counter. That means mafia won't automatically stop adventuring there. However if you're writing your own counterScript you have all kinds of options. The simplest is to throw an abort which would stop autoadventuring. However, if you know that you always use the bell in the batcave, you can have it automatically adjust the MCD for you when the counter is done.

I think in this case, you should just check the length of the counter and only adventure that many turns.

If you make your own counters, then unless you specifically made them a no-action informational counter, all you have to do to have them stop autoadventure is to return false. This script returns false for all unknown counters, so it would stop on such things, unless they are like Harold's Bell.
 
damn

the counter choose the dance card over the semi rare counter again
Code:
Request 129 of 150 (Hobopolis: Hobopolis Town Square) in progress...
Checking counters now.

Visit to Hobopolis: The Purple Light District in progress...
Checking counters now.

Visit to Manor2: Haunted Ballroom in progress...

[7552] Haunted Ballroom
Encounter: Rotting Matilda
You gain 307 Roguishness

Using 1 dance card...
Finished using 1 dance card.

[7553] The Purple Light District
Encounter: Van, Damn
Manual control requested for choice #205
 
Wait, that doesn't seem possible if you're using a version downloaded since I made the change. Please check the first line of your copy of my script for the version number. Let me know what it says.
 
Oh. Of course. I don't know what I was thinking about. Of course my script cannot control the order that counters are checked. Mafia decides what counter is being checked when it calls the counterScript.

Please report this as a suggestion in the bug report forum here.
 
Hey Bale, just a note....

I used this script tonight for first time to collect some !pipes while farming castle. I noticed it takes 11 turns instead of 10... is this because of some limitation in mafia that a new absinthe bottle can't be used right after collecting the pipe? Also, it's giving me little "Time has expired for you to adventure in Wormwood for !pipe" messages.... I think this is due to the change in how the counter itself is handled... but this is just cosmetic... the script rocks for collecting pipes though, so thanks :D If there's a fix to get it to be 10 turns rather than 11, that would be cool too ;)
 
Thanks for this script Bale! Now I almost never miss a semi-rare. :D One thing though. I have a script that gets the steel organ item for me and I was adventuring at the gate in an attempt to get the steel organ item when CounterChecker aborted my script because the steel organ counter expired. Maybe you could set it up so that if the steel organ counter expires and someone is already adventuring at Friar's Gate it doesn't abort?

Edit: Never mind. Sorry, CounterChecker didn't abort the script I just thought it did. My bad.
 
Last edited:
I used this script tonight for first time to collect some !pipes while farming castle. I noticed it takes 11 turns instead of 10... is this because of some limitation in mafia that a new absinthe bottle can't be used right after collecting the pipe?
I seem to remember someone making a complaint about that, but I cannot remember what Jason said in response...
 
Hi Bale,

Thanks for a great addon. It used to work flawlessly for me but lately I have been getting this error where the script checks for the counter then decides to carry on farming in the last location I was farming in (in this case, castle):

"Visit to Beanstalk: Giant's Castle in progress...
Checking for updates (running CounterChecker ver. 1.2)...
_version_BaleCC => 1.2
Checking counters now.
Searching for "cube of billiard chalk"...
Searching for "irradiated pet snacks"...
Searching for "knob goblin lunchbox"...
1 none does not exist in the adventure database.
Oops, that wasn't the right number!

[79181] Giant's Castle
Encounter: All The Rave
You acquire an item: Mick's IcyVapoHotness Inhaler"

Any idea what I did wrong?

thanks again.
 
That looks like I did something wrong, not you... It's tough to figure out what went wrong, so bereft of any other choice I've added some debugging code to the program. Please switch to the new version and if it goes bad again it will abort rather than let you get screwed up. It will also print some data for you to report to me.

Good luck.
 
Oh ok thanks!

Tried the new version out. Got this message:

"Request 110 of 227 (Beanstalk: Giant's Castle) in progress...
Checking for updates (running CounterChecker ver. 1.25)...
_version_BaleCC => 1.25
Checking counters now.
Searching for "cube of billiard chalk"...
Searching for "cyclops eyedrops"...
Searching for "knob goblin lunchbox"...
Something went wrong determing the best semi-rare. Please copy-paste this output to http://kolmafia.us/showthread.php?t=2519
cube of billiard chalk sells for 7800 meat.
cyclops eyedrops sells for 22899 meat.
Knob Goblin lunchbox sells for 25549 meat.
Please continue manually. Sorry for the bug."

Hope that helps!
 
That actually did help. Found the blasted bug and uploaded a fixed version in the first post. Thanks for your patience.
 
I have recently started to have these kinds of 'negative' counter counts.

The build is 7889. Using the CounterChecker.

Last semirare found -1751 turns ago (on turn 64403) in Giant's Castle

No active counters.

> eat fortu

Purchasing fortune cookie (1 @ 40)...
You acquire an item: fortune cookie
You spent 40 Meat
Purchases complete.
Eating 1 fortune cookie...
You gain 1 Adventure
Lucky numbers: 65, 288, 147
Lucky number 65 ignored - too soon to be a semirare.
Lucky number 288 ignored - too soon to be a semirare.
Lucky number 147 ignored - too soon to be a semirare.
Finished eating 1 fortune cookie.

How do I reset the internal counters or how do I fix this error? Mod the prefs.txt file?

Thanks.
 
Last edited:
The value you need to change is semirareCounter which is the turncount of your last semirare that mafia knows about. Setting it to blank is probably the best option.
 
Back
Top