Feature Expose Encounter Listing for use in scripts?

Malurth

Member
This would make my life a lot easier.

I'm trying to automate adventuring in FantasyRealm while having dice gear equipped (aka with random monster modifiers) while also trying to kill 5 monsters and then leave before triggering the noncombat (which sadly still consumes an adventure even if you just duck out of it :/), and also display the monster # in the relay browser. This would be a lot easier if I could just call up an encounter listing to determine how many of X monster I have fought today; I already mostly scripted a way to do that, but clingy and 1337 monsters can really throw a wrench in things (not to mention it's pretty ugly). Ideally it would also return whether you won/lost a fight and what choice you made in a noncombat, but that's probably asking too much.
 

Darzil

Developer
Well, as it's Fantasy Realm:
_frAreasUnlocked - shows the areas currently available.
_frButtonsPressed - shows number of buttons pressed (though I guess not where)
_frHoursLeft - shows number of areas left (blank if not started, 0 if finished)
_frMonstersKilled - shows type and number of each monster type killed.
Between those and inventory/equipment/effects you should have pretty much everything you need I think ?
 

Malurth

Member
Ah, _frMonstersKilled is precisely what I was after, didn't know it existed, thanks.

Still, I think having the Encounter Listing accessible for scripting would be useful in the general case, and would make it so you probably wouldn't have to implement daily variables like that in the future.
 

Malurth

Member
Hence why I said "Ideally it would also return whether you won/lost a fight and what choice you made in a noncombat," but you can also peek session logs to find that out (although that runs into similar issues as before with clingy/1337/hilarious monsters). Making a more fleshed-out encounter listing available for use in scripts would certainly obviate the need to make new daily variables, but of course that goes farther than simply exposing it.
 

Darzil

Developer
The encounters list is also per session, so isn't a reliable guide to what has happened, as it may have happened in a previous session.
 

Malurth

Member
Ah, that's a good point. I suppose as it stands now just exposing the encounter listing would not be particularly helpful, then. A daily detailed encounter listing would be, but at that point it's something entirely different, and I'm not sure if KoLMafia even stores any daily things outside of the underscored user prefs anyway.
 

Darzil

Developer
Prefs are how we store daily things. (Other than log files tagged with day, and those are local day, not server day)

What we try to do is store things that are useful for knowing current status, and knowing what we have done if significant. So, for example, we care on Black Market quest what progress you have made on finding it, but not which monsters you fought when making that progress.

With Fantasy Realm, to script it you may need to know if you have killed 5 monsters, which is why we have that preference, but we only need to know as much about the past as needed to plan the future. I think there is enough recorded that you could have a relay script that would tell you what is still open as a possibility, and guide you through it, for example. Or a script to do a particular quest, and know both if it is possible and pick it up again if interrupted part way.
 

ckb

Minion
Staff member
To add to what Darzil said, here is my 'place.realm_fantasy.ash' relay that adds counters for each available location. You might find this useful.
As for "A daily detailed encounter listing", isn't that what the session logs are? Parsing those can be tricky, but will get you what you want in more detail than just a monster list.
 

Attachments

  • place.realm_fantasy.ash
    1.6 KB · Views: 23

Malurth

Member
As for "A daily detailed encounter listing", isn't that what the session logs are? Parsing those can be tricky, but will get you what you want in more detail than just a monster list.

Yeah, but there's a lot of things you can obtain from parsing session logs that are built-in functionality. It goes back to my 'this would be a lot easier if' point, not that it's impossible without it. Although, honestly, with dice modifiers, it probably would have been for me.

At the time I was trying to manually keep track of the # of monsters killed, updated after each adventure. In order to account for clingy monsters, I'd have to parse the entirety of the daily log each time, since I can't know how many adventures back to look since they can chain, and I'd also have to avoid double-counting them anyway, so I'd need a full fresh parse each time. And since monster names can be replaced via the 1337 modifier or the hilarious modifier, unless I somehow managed to figure out a way to consistently decode those names back to their original form, I'd not be able to keep track of those monsters anyway.

Thankfully _frMonstersKilled obviated my need for that for now, but if I ever run into a situation where I wanted to count different monsters also using dice gear, I probably would be incapable.

(As an aside, thanks for that relay script, it's pretty handy. I had only gotten around to modifying the fight pages.)
 
Top