Feature ash function: string last_encounter()

ckb

Minion
Staff member
I have been writing some scripts that have some non-traditional adventuring requirements. Sometimes it involves looking for a specific adventure, or some text in a specific adventure. I can pull some of this information by looking at the session_logs() and parsing that, but it would be sweet to have a function that would return the full string of the last completed adventure, including fight and win/lose text.

last_encounter() would return the string of the last complete adventure, similar to how last_monster() returns the last monster fought.

Questions:
* does this return plain text or html?
* it is easy to get the full text of every round of a fight if it is not macro-fied?
* Can the function return the last encounter string of what would be pushed to the session log is the first two options are not possible?

Thanks!
 

Veracity

Developer
Staff member
A monster:

> ash get_property( "lastEncounter" );

Returned: shady pirate

A choice adventure:
> ash get_property( "lastEncounter" );

Returned: Barrie Me at Sea

A non-combat adventure:
> ash get_property( "lastEncounter" );

Returned: A Dreadful Curse
Which is to say, option #3 is already available to you.

We don't currently save the full response text of adventures.
 

ckb

Minion
Staff member
I guess I go with option 3 then. Though It would be nice to consider option 1 or 2 fr the future (if possible).

The problem with get_property( "lastEncounter" ) is that is does not account for the entire adventure, just the last encounter.

So something like this:
The Castle in the Clouds in the Sky (Top Floor)
Encounter: Yeah, You're for Me, Punk Rock Giant
Encounter: Flavor of a Raver
Encounter: Raver Giant

returns only "Raver Giant".

But I can still get what I need from parsing session_logs().
 
Top