New Content - Implemented Pokefam

Malibu Stacey

Active member
Smoke Ball breaks free runaway tracking. I've only seen this on the Stomping Boots as it's the only familiar I have which gives free runaways but the Bandersnatch may also have the same issue.

Equip the Smoke Ball on a Stomping Boots (or possibly Frumious Bandersnatch) & use a free runaway to replicate.
 

zarqon

Well-known member
It seems like mafia's combat tracking gets thrown off for non-Pokefam fights in Pocket Familiars (which is possible in the Fantasy Realm, which may be a KoL bug?). Today mafia kept appending the "Found in this fight" message from the previous fight at the bottom of my current fight against bandits, and when my fight was over, mafia kept insisting that I was currently in a fight, though multiple visits to various pages in the relay browser assured me I wasn't.

Relatedly, how can I convince mafia I'm not in a fight anymore?

> outfit current

You are currently in a fight.

> refresh all

Loading character status...
Refreshing session data...
Synchronizing moon data...
Retrieving character data...
Updating inventory...
Examining Meat in closet...
Updating closet...
Retrieving quest data...
You are currently in a fight.
Retrieving campground data...
Examining Meat and pulls in storage...
Updating storage...
You are currently a member of Storm Knights
Session data refreshed.
You are currently in a fight.

> outfit current pretty please?

No outfit found matching: current pretty please?
 

zarqon

Well-known member
Can confirm that this happened again today when fighting bandits for the loot token. Mafia never detected the fight was over for any of the five fights and treated them as being all one fight. I had to restart mafia to convince it that I wasn't currently in a fight.
 
Last edited:

Darzil

Developer
Try r18726 - Doesn't break fambattle.php parsing, but my pokefam character doesn't have FantasyRealm, so can't test.
 

zarqon

Well-known member
Question: Outside of Pocket Familiars, have_familiar() returns false for Pokefam that you do, in fact, have -- they just aren't visible in the Terrarium. Might I suggest instead making have_familiar() return true and making is_unrestricted(<familiar>) return false for those cases?

EDIT: I noticed this because I wasted some meat on hatchlings due to an informative script telling me I lacked certain Pokefam (about to ascend to another Pokefam run to test your previous fix). No big loss (I can just sell them again) but would be nice for the function to return technically correct information.
 
Last edited:

lostcalpolydude

Developer
Staff member
Interestingly, mafia doesn't really know which familiars can't be used. It's a mere coincidence that familiars too old to use in your terrarium are formatted differently, so the regex for parsing that page fails to see them. The Pokefam familiars only show up on the familiar renaming page if you're not in the path, and mafia never checks there.

So, any change to how all of that is handled would require a lot of work, and would probably require multiple iterations as bugs are found in the code.

In the mean time, any script that tries to tell you about Pokefam familiars that you don't have, and doesn't check the familiar renaming page on its own, is a poorly written script.
 

zarqon

Well-known member
Yes, 45 Pokefam familiars simply don't show up on familiar.php. For them, the return value of have_familiar() will be true if you've successfully used a hatchling this session, or false if you haven't.

My understanding is that making this return value meaningful again in KoLmafia would entail checking familiarnames.php once when logging in, caching the qualifying Pokefam you have there (range 215-259) in a user property, and updating that property any time a qualifying hatchling is used. If all 45 familiars are present in the property we can even skip visiting the names page. Then, adjust have_familiar() to include a check for those cached familiars. And all of this would only be needed outside of Pocket Familiars runs. That strikes me as carrying less baggage both intrinsically and extrinsically than the methods we'd need to properly implement really_have_familiar() in ASH, in addition to reducing confusion as to why the function returns false for familiars you actually have, which is why I requested the fix to the ASH function itself rather than fix my poorly, poorly written script.

Oh, who am I kidding? The real reason is linguistic -- the function is called have_familiar(). It presently functions as in_terrarium(), which unfortunately is no longer synonymous.
 

lostcalpolydude

Developer
Staff member
I guess you failed to notice how many of your familiars don't show up with have_familiar() when in a restricted path such as Standard. I agree that the function has been lying for 4+ years now, but for practical purposes the returned value works pretty well, and "fixing" it would likely break a decent number of scripts.
 

zarqon

Well-known member
I've been writing a little consult script to handle Pokefam battles, but have been running into an error before mafia even calls my consult script:

> adv 1 goatlet

Urchin Urchin, I choose you for slot 1!
--------------------
Gazelleton 2/2 3/2 3/3 Bite Howl Violent Shred None
--------------------
Autonomous Disco Ball, I choose you for slot 2!
Recommended Combat Rate: +0 (now: -20)
Recommended Initiative: +0 (now: 45)
Recommended Item Drop: +150 (now: 265)
Recommended Monster Level: +48 (now: 80)
In a Mercenary Mood.

Visit to McLarge: The Goatlet in progress...
fight.php: redirected to a fight page.

The first command in the consult script is a print() statement, yet nothing is being printed.

The "I choose you!" messages are from a team manager mood script. The Gazelleton message actually showed up just as I was testing this (are those messages meant to be informational for users or are they spading to be entered into a data file?). Then the modifier recommendations are from Mercenary Mood, so beforeBattle/mood scripts are firing as normal.

"ash run_combat()" at this point is still ineffectual. Loading the fight in the relay browser (by clicking the "crafting" menu item, which redirects to the fight) and then entering "ash run_combat()" in the CLI works as expected, and my script then handles the fight through to the end. But the error prevents automation, which was rather the point of writing the consult script in the first place.

Would a debug log be helpful here?
 

Darzil

Developer
Yeah, there is no support for run_combat() in Pokefam.

It doesn't use skills, it uses famactions, there is no KOL support for macros, and the famaction varies (sometimes) by familiar.

I wouldn't expect it to work.
 

zarqon

Well-known member
Can we pass the expected parameters to a consult script without aborting, at least? Tracking of anything beyond that is unnecessary for my purposes, and mafia could feel free to abort if anything other than "consult" is present in the CCS. With my consult script run_combat() works just fine once we get past the redirect error.
 

zarqon

Well-known member
Thanks Darzil. I would very much appreciate being able to automate during Pocket Familiars runs now that I'm just doing them for 1) factoids, and b) writing this consult script. :)
 

Attachments

  • DEBUG_20180829.txt
    8 KB · Views: 9

zarqon

Well-known member
> adv 1 a-boo peak

Autoselling items to NPCs...
You gain 1,000 Meat
Items sold.
Recommended Combat Rate: +0 (now: -25)
Recommended Initiative: +0 (now: 45)
Recommended Item Drop: +0 (now: 215)
Recommended Monster Level: +61 (now: 60)

In a Mercenary Mood.

Visit to Highlands: A-Boo Peak in progress...

[290] A-Boo Peak
Encounter: Claybender Sorcerer Ghost
stopping macrofication due to action: consult SimplePoke.ash
0: Evil Gluttonous Green Ghost Power: 2; Health: 4 / 4 ULTIMATE in the BACK
1: Evil Mini-Skulldozer Power: 2; Health: 4 / 4 SMART ULTIMATE MOVES: Frighten
2: Evil Reconstituted Crow Power: 3; Health: 3 / 3 ULTIMATE in the FRONT
3: Good Stab Bat Power: 5; Health: 2 / 2 SPIKES ULTIMATE in the FRONT MOVES: Sting, Embarrass
Total for Sting: 5
Total for Embarrass: 1
4: Good Mosquito Power: 1; Health: 2 / 2 MOVES: Lick
Total for Lick: -0.5
5: Good Slotter Power: 3; Health: 4 / 4 ULTIMATE in the BACK MOVES: Howl, ULTIMATE: Blood Bath
Total for Howl: 2.5
Total for ULTIMATE: Blood Bath: 14
Round 1: zarqon's Slotter uses ULTIMATE: Blood Bath!
Round 2: zarqon wins the fight!
You acquire an item: psychokinetic energy blob
After Battle: You gain 6 Beefiness
You gain 11 Meat.
You acquire an item: A-Boo clue
You acquire an item: Polysniff Perfume
You acquire an item: Claybender glasses
After Battle: You gain 5 Muscleboundness
After Battle: You gain 14 Wizardliness
After Battle: You gain 30 Smarm
You can now equip a duct tape fedora (and possibly other things).
You gain a Moxie point!

IT WORKS!

Thanks very much for your blinding-fast attention to my request.
 
Top