Sots Parcel.ash script request

Veracity

Developer
Staff member
test_first_visit_sot_to_get_location.html
What he means is that he lost something over in The Haunted Storage Room and he'd like you to get it for him.
test_next_visit_sot_to_get_location.html
He's just sitting there, waiting for you to bring his package back from The Haunted Storage Room.

I don't see any code in QuestDatabase to indicate we consider the Sot to be a quest, so, perhaps it is not actually in the charpane/questlog.
 

snooty

Member
Primordial soup seems to be an issue as well unrelated to choice adventures. Going to closet my empty bottles to see if that helps for tomorrow, giving up for today.
 

fronobulax

Developer
Staff member

When that PR is merged there should be enough information in the session log to tell why an extracted location is not valid. Otherwise the script should not fail because of can_adventure but might fail on the prep.
 

Veracity

Developer
Staff member
I am not convinced your PR is testing a real case or will help in the reported case.

We all believe that KoLmafia parsed “The Hippy Camp” from the response text.

snooty said "I beat up frat boys in the war, so, this really makes no sense."
(that KoLmafia cannot find that location.)

This is post war, so the post-war Hippy Camp is available.

Doing fuzzy matching and turning it into "The Hippy Camp (Bombed Back to the Stone Age)" cannot be right

I believe that KoL calls the post-war Hippy Camp simply "Hippy Camp" everywhere else.
-> If you adventure in the post-war Hippy Camp, what does the charpane say your last adventure was?

If you accept the Sot's quest, does it in fact tell you about it in the charpane (and presumably quest log)?
-> If so, what does it say there?
(I haven't done the Sot's quest recently, but I think I remember that. Perhaps I am wrong.)
 

Ryo_Sangnoir

Developer
Staff member
KoL has four places called "The Hippy Camp": basic, disguised, dawn of war, dawn of war disguised. Fortunately, you can only ever access one of them.

Mafia gives all locations different names. The "right" thing to do would be to, like we do for item / effect, use the KoL names (which we can find out from the autumn-aton) and use ids for distinguishing.
 

fronobulax

Developer
Staff member
Just to reiterate

Cannot adventure at The Hippy Camp

Would only be generated if "The Hippy Camp" was the text KoLmafia extracted from KoL.

The inability to adventure was detected by the ash function can_adventure.

The code, at the time, did not distinguish between can't adventure because the location is invalid and can't adventure because it is not available.

The doctored HTML in the PR demonstrates that "The Hippy Camp" does have a unique fuzzy match but in this context the match is not correct because the area is not available.

When I first implemented the parsing my nightmare scenario was that something would parsed and be an available location but it would be the wrong one so that any script that used the property would potentially loop forever because the parcel never dropped.

My thinking now, having skimmed but not digested the PR comment, is that if KoLmafia sets the location then the extracted string corresponds to a unique location that was adventurable at the time of the extraction. A string that cannot be mapped to a unique location or a location that is not available for adventuring should be errors and reported differently.

Thanks.
 

fronobulax

Developer
Staff member
KoL has four places called "The Hippy Camp": basic, disguised, dawn of war, dawn of war disguised. Fortunately, you can only ever access one of them.

Mafia gives all locations different names. The "right" thing to do would be to, like we do for item / effect, use the KoL names (which we can find out from the autumn-aton) and use ids for distinguishing.

Since the KoL strings are mapped into mafia strings "The Hippy Camp" should map into four possibilities and a unique possibility should be derivable based upon which of the four is actually available. By itself getAdventure(name) does not seem to do this. But the expectation should be programmer misunderstanding and there are possible tests and workarounds.
 

snooty

Member
Next time I get the hippy camp (in mafia it's Mysterious Island: Hippy Camp, no "the"), I'll pay closer attention to the Sot's text. But maybe the problem is the Sot text includes "the"? I mean, it would sound weird if he said "go fetch my shizz from hippy camp".
 

fronobulax

Developer
Staff member
Next time I get the hippy camp (in mafia it's Mysterious Island: Hippy Camp, no "the"), I'll pay closer attention to the Sot's text. But maybe the problem is the Sot text includes "the"? I mean, it would sound weird if he said "go fetch my shizz from hippy camp".

Yeah. Because in the specific situation of the Sot's Parcel the leading "The" perhaps needs to be stripped of before trying a location. If there is fuzzy matching maybe the ones that really have "the" will match a string without it.
 

fronobulax

Developer
Staff member
So I changed the PR and the approach. No fuzzy matching. If it begins with "The" and doesn't match then I try again without the "The".

Fuzzy matching is probably wrong because the text came from KoL.
 

fronobulax

Developer
Staff member
KoL sent me to A Massive Ziggurat. Since I had already cleared the area I couldn't adventure there. The good news is that the script stopped with an unhandled choice adventure.
 

snooty

Member
So, I noticed an odd thing, the script seems to be randomly resetting the MCD? Or, maybe mafia? I don't recall there being an MCD setting other than the "travel > monster level", have I forgotten one somewhere?

Talking to the Milky-Eyed Sot MCD: adjusting to 10... Resetting mind control device... Mind control device reset.
 

fronobulax

Developer
Staff member
So, I noticed an odd thing, the script seems to be randomly resetting the MCD? Or, maybe mafia? I don't recall there being an MCD setting other than the "travel > monster level", have I forgotten one somewhere?

Talking to the Milky-Eyed Sot MCD: adjusting to 10... Resetting mind control device... Mind control device reset.

Hmmm... Not doing it deliberately but it could be an un-noticed by me feature of can_adventure or prepare_for_adventure. I will try and remember to check.
 

fronobulax

Developer
Staff member
it's a good thing I have accepted that I can be wrong. I misunderstood the cause of the Hippy Camp issue and as a consequence the PR attacks the wrong problem. What makes this more embarrassing is that I was given gentle hints that I was on the wrong path but I didn't get them.

The current KoLmafia code works. It AFAIK correctly extracts the location text from KoL. The issue is that there are a few cases where the KoL name and the KoLmafia name are not the same. Mapping the KoL name to an adventure location does not always yield a unique location until factors besides the name are included.

I introduced the problem in the script where I decided to confirm that canAdventure was true for the extracted string. Logically, if there are no errors in parsing, there should be no problems in adventuring in the location represented by the string. $location or to_location should be able to resolve the name,

The attached version of the script doesn't call canAdventure although it might still be wrong. I am going to look at canAdventure, $location[string] and to_location(string) and decide or confirm that they will uniquely map a KoL location to a KoLmafia location. Then I will decide what to do.

KoLmafia and this version of the script should work just fine with a possible exception of a location that has one name in KoL and different names in KoLmafia. The Frat House and The Hippy Camp are two examples. The script might even work there - I just have not finished my "research".
 

Attachments

  • Sot.ash
    1 KB · Views: 8

snooty

Member
Dude, we're all only human. We all make mistakes, but not everyone has the strength to admit when they have. Kudos to you for being a decent human, and sharing your knowledge in creating scripts for those of us without your skill sets. ❤️

I get to test your update here in a few, I'm excited!
 

fronobulax

Developer
Staff member
Well...

In my quest for information I have discovered two things.

My understanding of the syntax for $location is wrong. I fixed that.

$location and to_location when passed "The Hippy Camp" or equivalent return "The Hippy Camp (Bombed Back to the Stone Age)".

but for a character who finished the war as a Hippy, the location should be "The Hippy Camp".

At least I have something to figure out that is not necessarily a problem of my own making :)
 

snooty

Member
Okay, 14 iterations later, still no hippy camp. Everything seems to be going well, but, is it possible to auto-abort if Sonofa Beach pops up as the location? I've gotten it a few times, and once I even tried throwing on all the +combat I could. Gave up after ~30 advs (I'm a bit stubborn). I don't think I've encountered anything quite this bad among all the mixed non/combat adv areas I've been to thus far.

I verbally kick myself when problems are of my own making. When that mental light bulb clicks on with the solution though, it's so satisfying!
 

fronobulax

Developer
Staff member
Parameterizing it is on my list. I definitely want the number of tries to be user configurable and once that is done a list of places to avoid could be configured. I keep getting the Ziggurat after it has been cleared so...
 

fronobulax

Developer
Staff member
Just got the hippy camp again, and again mafia insists that area is not available :(
Expected. The "right" fix is going to need information that either Kolmafia does not have or I can't find or figure out how to derive. I also expect problems with "The Frat House" and possibly the Cola Wars and Island Battlefields when available. Still floating near the top of my "to do" list as are parametrization and supporting a list of exclusion areas. Thank you. Some work is much more fun when someone else cares :)
 
Top