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

mredge73

Member
Thanks
I didn't realize that something broke mafia's pathed run detection, assumed it was due to a recent script update.
Looks like it was fixed right before I posted, my copy was only a day old at the time so I did not think it was mafia.
 
Last edited:

Theraze

Active member
Question... does this mean what I think it does:
PHP:
Checking for updates (running CounterChecker ver. 1.492)...
_version_BaleCC => 1.492
You have a current version of CounterChecker.
Checking counters now.
+offhand +equip continuum transfunctioner
Maximizing...
2 combinations checked, best score 0.0
unlockedLocations => 8-- Knob Goblin Harem Bat Hole Entryway
unlockedLocations => 8-- Knob Goblin Harem Batrat and Ratbat Burrow
unlockedLocations => 8-- Knob Goblin Harem Dark Elbow of the Woods
unlockedLocations => 8-- Knob Goblin Harem Bat Hole Entryway
unlockedLocations => 8-- Knob Goblin Harem Guano Junction
unlockedLocations => 8-- Knob Goblin Harem Haunted Billiards Room
unlockedLocations => 8-- Knob Goblin Harem Pre-Cyrpt Cemetary
Getting a Knob Goblin lunchbox which is currently selling in the mall for 22,222 meat.

Looks to me like it's only potentially adding one new location, and not updating the unlockedLocations string as it adds them to the unlockedLocations preference... I think the problem is that string unlockedLocations is called only once... if it were called at the start of canadv instead, it should update on every possible location, not just the last one examined...

That does explain why, since the change to the homebrew canadv, I've noted some semirare collection I've never seen before. :D
 

Bale

Minion
F** **K!


Released CounterChecker v1.493


This is the "please don't make fun of Bale for being an idiot" release.
 

Theraze

Active member
Question... it's adding to unlockedLocations inside the function, based on the "current" unlockedLocations... does that mean it's going to go back to the original between executions of the function, or does it keep the string between executions of the function as a global variable?
 

Bale

Minion
Question... it's adding to unlockedLocations inside the function, based on the "current" unlockedLocations... does that mean it's going to go back to the original between executions of the function, or does it keep the string between executions of the function as a global variable?

The later. Look at the next line of code. That set_property() matches the get_property() at the beginning of the script.
 

Theraze

Active member
I knew that it did that... but it had set_property there in the prior version. What I wasn't sure about was whether unlockedLocations went back to the way it was outside the functions; if the changes done inside the function stayed private to it or whether they were available to other calls of the function.

Since the handling to make it work with BBB hasn't been added to the main yet, I compare each version/update to see what needs to be done to reconcile them. I value having it work properly, but I also value having it work properly. :)
 

Bale

Minion
The variable unlockedLocations is global to the script. I use set_property("unlockedLocations", unlockedLocations) to make it's value persistent for the next time CounterChecker is called. Note these two lines:

Code:
			unlockedLocations = unlockedLocations+" "+where;
			set_property("unlockedLocations", unlockedLocations);
 

Theraze

Active member
I know... the second line already existed (though without the redefinition of unlockedLocations), the first is the change/addition. As I said, I need to compare the script line by line to make sure that adding the BaleCC_nextSemirareLocation variable works as expected. What I wasn't certain was whether having it defined (as "string unlockedLocations = get_property("unlockedLocations");") outside the function would go back to the original get_property that was pulled when the script was run, or if it would save the updated unlockedLocations as it adds inside the function. Globals in programming languages tend to be somewhat odd, and I was just trying to make sure that it was going to save happily. If globals run implicitly without needing to be defined as such, excellent. Looking forwards to the wider excitement tonight. Heh. :)
 

Bale

Minion
Your answer is that get_property() is run only once at the beginning of the script and never again. After that it only uses the current value of the variable unlockedLocations. The reason that I do a set_property() every time I change the value of unlockedLocations is because I want it to remain persistent for the next time CounterChecker is run. If I didn't do a set_property() at all the script would run fine, but I would have to waste those server hits the next time it ran.

And that is the meaning of how I defined this global variable.
 

Theraze

Active member
Problem with the limerick dungeon. According to the CanAdv code, it's always available. According to KoL, it's only available if you have 21 buffed primestat or more.
 

Theraze

Active member
Spiffy. Thanks for the update. Also, could do something like this to reduce the extra adventure out of place for ImprovePoolSkills if you like... change this:
PHP:
 // If ImprovePoolSkills, then play a game of pool at every opportunity!
 if(ImprovePoolSkills && last_rare != "Haunted Billiards Room") {
  billiard = get_property("choiceAdventure330");
  set_property("choiceAdventure330", "1");
  if(adventure(1, $location[Haunted Billiards Room])) {}
  set_property("choiceAdventure330", billiard);
  eat_cookie();
  return;
 }
to this:
PHP:
 // If ImprovePoolSkills, then play a game of pool at every opportunity!
 if(ImprovePoolSkills && last_rare != "Haunted Billiards Room") {
    locale = $location[Haunted Billiards Room];
  }
and then in the switch(locale) below, change the set_property for the billiards to this:
PHP:
  set_property("choiceAdventure330", (ImprovePoolSkills ? "1" : "2"));

Everything else should flow properly... you already reset the choiceAdventure330 settings back to their default as a part of the normal location handling, it still eats the cookie... just means that it's more integrated.
 

shazbot

Member
So I've been poking into my problem, and it seems to not even happen consistently. For example-
Code:
[276] Stately Pleasure Dome
Encounter: toothless mastiff bitch
Round 0: oh shazbot wins initiative!
(unable to macrofy due to action: consult SmartStasis.ash)
Round 1: oh shazbot executes a macro!
Round 1: oh shazbot attacks!
Round 2: oh shazbot attacks!
Round 3: oh shazbot attacks!
You lose 1 hit point
Round 4: oh shazbot attacks!
Round 5: oh shazbot attacks!
Round 6: oh shazbot wins the fight!
You acquire an item: disintegrating spiky collar
You gain 4 Muscleboundness
You gain 2 Mysteriousness
You gain 2 Sarcasm
Mood swing complete.

[277] Stately Pleasure Dome
Encounter: angry poet
Round 0: oh shazbot loses initiative!
You lose 3 hit points
(unable to macrofy due to action: consult SmartStasis.ash)
Round 1: oh shazbot executes a macro!
Round 1: oh shazbot attacks!
Round 2: oh shazbot attacks!
Round 3: oh shazbot attacks!
Round 4: oh shazbot wins the fight!
You gain 5 Fortitude
You gain 2 Mysteriousness
You gain 1 Smarm
Mood swing complete.

[278] Stately Pleasure Dome
Encounter: Down by the Riverside
You gain 88 Muscularity Points
You acquire an effect: Spirit of Alph (duration: 5 Adventures)
Mood swing complete.

That time it worked fine. However, I also had it fail after the first adventure in the mouldering mansion. from my logs-
Code:
 > Checking counters now. - remain 0
> Goal: not-a-pipe.
> Worm Wood second step...

[250] Mouldering Mansion
Encounter: black cat
Round 0: oh shazbot loses initiative!
You lose 3 hit points
Round 1: oh shazbot executes a macro!
Round 1: oh shazbot attacks!
You lose 1 hit point
Round 2: oh shazbot attacks!
Round 3: oh shazbot attacks!
You lose 4 hit points
Round 4: oh shazbot attacks!
Round 5: oh shazbot wins the fight!
You acquire an item: bottle of black cat tonic
You gain 3 Muscleboundness
You gain 3 Magicalness
You gain 2 Roguishness
You gain a Moxie point!
 > Checking counters now. - remain -1

I had tweaked the code a little bit to get clearer output. And that was when I noticed that it was checking CounterChecker again in the middle of the mood swing (but not always). I'm starting to think that at this point it's no longer a script problem, but perhaps a mafia problem? I didn't start to see this problem until I jumped to nightly 9000 from 8946. What do you think?
 
Last edited:

Theraze

Active member
When it fails, try "condition set". See if there's a condition that's trying to be met, and that's why it thinks that it's time to move maybe?
 

Bale

Minion
Spiffy. Thanks for the update. Also, could do something like this to reduce the extra adventure out of place for ImprovePoolSkills if you like... change this:


Released CounterChecker v1.495


Good idea, so I'll name this the "let's make it pretty" release.
 

Bale

Minion
Released CounterChecker v1.496

Cobb's Knob was revamped. It broke CanAdventure checking for a few locations. I fixed them.
 

shazbot

Member
So far have not been able to recreate it (outside a random special monster interfering with the counter). So it may have been worked out with either CC 1.495 or mafia between mafia 9024 and 9068
 

shazbot

Member
Spoke too soon-
Code:
Request 4 of 95 (Beanstalk: Fantasy Airship) in progress...
Countdown: 1 second...
Waiting completed.
Checking counters now for Wormwood with 0
Goal: not-a-pipe.
Worm Wood second step...

[1311] Mouldering Mansion
Encounter: usher
Round 0: oh shazbot wins initiative!
You acquire an effect: Neuromancy (duration: 13 Adventures)
(unable to macrofy due to action: consult SmartStasis.ash)
Round 1: oh shazbot executes a macro!
Round 1: oh shazbot attacks!
Round 2: oh shazbot attacks!
You lose 15 hit points
Round 3: oh shazbot attacks!
Round 4: oh shazbot wins the fight!
You gain 20 Beefiness
You gain 3 Wizardliness
You gain 12 Chutzpah
Mood swing complete.
(Wormwood counter expired)
Countdown: 1 second...
Waiting completed.
Checking counters now for Wormwood with -1
Time has expired for you to adventure at Wormwood for not-a-pipe.
Mood swing complete.
Wormwood counter expired.

> condition set

metallic A

So I don't know if it's just mafia failing at letting the counter script continue to run or if it's because CC isn't resilient enough. I don't know enough about the mafia counter interface to know.
 
Last edited:

Theraze

Active member
Any chance that Wormwood is one of those counters that needs the lower end of the range to be -1?

Or it could just be mafia setting the counter improperly, but... one of those two would be my snap guess.
 

shazbot

Member
Any chance that Wormwood is one of those counters that needs the lower end of the range to be -1?

Or it could just be mafia setting the counter improperly, but... one of those two would be my snap guess.

The way I've seen baleCC work is that it triggers at the beginning of when you should start hitting a location in WW and it will continue to adventure there until you A. get the effect or B. go outside the window for gaining the effect. It's when something goes wonky and I see mafia consult baleCC to know what to do (counter -1) and then it all craps on itself. AFAIK, the counter is correct, it's -1 turns from the start of that window for the wormwood. So on the one hand, once it triggers baleCC normally takes control until the window is closed. But something is going wrong and mafia is consulting the counter script to determine a course of action (which baleCC seems to be indicating that it should cause an interrupt?). I do not know if/why mafia's counter is interrupting in the middle of baleCC, so that could be the problem (or it could intentionally be by design). And if it IS by design, perhaps baleCC could be a little bit more resilient and consider what the counter number is in regards to certain locations instead of just treating all negative counters as bad (at least that's how I interpreted the script). That way if, lets say we're on WW stage 1, and we see a counter of -2, we know there's still a chance of getting the effect. So if we do not have said effect, then go ahead and spend an adventure there.
 
Top