Feature - Implemented Improve skill use tracking, particularly for daily-limited skills

zarqon

Well-known member
All of the daily-limited summoning skills have tracking properties:

  • cocktailSummons
  • noodleSummons
  • reagentSummons
  • prismaticSummons
  • grimoire1Summons
  • grimoire2Summons
  • grimoire3Summons
  • tomeSummons
  • _candySummons
  • _lunchBreak

This is lovely. We are on our own for tracking daily-limited buffs, however, such as Inigo's, Managerial Manipulation, Hobopolis AT buffs, etc. At first I was thinking to request a bunch more properties, like

  • _employeeManipulated
  • _goldenSmiles
  • _inigosCast
  • _thingfinderCast

etc.

But then I thought a more general solution using proxy records would be not only possible, but TOTALLY AWESOME. I'd like to suggest adding two more fields to the skills record:

int timescast
For skills which mafia tracks in properties, this number would mean "times cast today". For skills which mafia does not track in properties, that would mean "times cast this session."

I'm not looking for this to be super elegant or complicated: no parsing for success/failure necessary -- the number could simply be incremented when the form is submitted, up to the maximum if there is one. (And if this is tracked, mafia could save server hits by not submitting casts beyond the maximum.) However, mafia verifying its numbers when visiting skills.php (or the fireplace) would be a nice touch.

int dailylimit
The maximum number of times you can cast the skill per day. Default -1 for skills with no limit. The only issues here are 1) some of the summoning skills give either 3 or 5 summons, and 2) smiles vary depending on how many Golden Mr. A's you have.

If mafia were also to include combat skills in this -- even tentatively -- out-of-combat scripts would have a kind of access to the player's playstyle; they could look at which combat skills were being used to make some educated guesses about the combat strategy / CCS of the player, and act accordingly. But that might be enough of an extension to this request that it's probably a second feature request which I'll make if the above bit doesn't get rejected.
 

StDoodle

Minion
As a side bonus, z's proposed change would allow me to nix about 1/4 of the code & about half of the saved info from my daily deeds script. ;) Seriously though, this sounds like a perfect extension of proxy records that would allow for a nice, consistent way of getting such info that would avoid a lot of "preference bloat." Kudos!
 

NardoLoopa

Member
Daily Deeds: Counters for Inigo's and other limited skills

Would be nice if the number of Inigo's casts were reported on the Daily Deeds page. Currently the only way I know how to determine the casts left is to look at KoL's skills page.

Ex: 2/5 would be nice.
Might also work for the summoning skills: reagents, cocktails, pasta.

Basically anything that's limited to more than one. Inigo's hurts the worst just because of the 100MP, then turns out you can't cast it anyway.
 

Terion

Member
1) some of the summoning skills give either 3 or 5 summons,

Or 8 if you're a sauceror with both skills and the Nemesis belt.

Your variable list missed libramSummons (which is limited in that you run out of MaxMP to be able to cast any more; the variable is needed to calculate the cost of the next summon.)

What's the difference between variables that start with an underscore and those that don't? Different peoples' habits?

Would this also track daily limited skills granted by things like the stress ball (5) [ignore]and the burrowgrub hive (3)[/ignore] and the mayfly bait (30)? (Noticed the character_prefs files has a burrowgrubSummonsRemaining, but I don't see ones for the others.)
 

slyz

Developer
Mafia preferences that start with an underscore are cleared on the first login after rollover.
 

Terion

Member
Huh. OK, thanks, that makes sense. That would be anything that would be a per-day count or flag right? I noticed burrowgrubHiveUsed doesn't have an underscore; I'd think that would be reset each day (the summonsRemaining doesn't clear at rollover, so that makes sense not to have an _.) And libramSummons and tomeSummons... actually, seems to be a number of variables.

Anyway, that's going off on a tangent. Back to the original point; wow, there's a surprising number of things that are x-per-day when you actually look at it.
 

Bale

Minion
Huh. OK, thanks, that makes sense. That would be anything that would be a per-day count or flag right? I noticed burrowgrubHiveUsed doesn't have an underscore; I'd think that would be reset each day (the summonsRemaining doesn't clear at rollover, so that makes sense not to have an _.) And libramSummons and tomeSummons... actually, seems to be a number of variables.

The feature of resetting preferences starting with an underscore was not always a feature of mafia. There are a lot of preferences that predate this feature, but they were not changed because it would break scripts that rely on them. Legacy code is troublesome that way.
 

Rinn

Developer
I thought about that and the script breaking could probably be sidestepped by having get and set_property check if an underscore version of a setting exists then resolving to that if it does.
 

Veracity

Developer
Staff member
The only way we can track count of summoning across logins is in a property, so, all the daily-limited summonings will each need a new property - even if we add the limit & casts as proxy fields to a skill. Which is not a bad idea, so that user scripts don't have to know exactly what property goes with exactly what skill.

I just added detection of the error message for exceeding a daily limit:

"You can't cast that many turns of that skill today. (You've used 5 casts today, and the limit of casts per day you have is 5.)"

for Inigo's, for example. We could use that to reset (max out) the preference associated with whatever skill you attempted to cast, to keep the KoLmafia properties correct even if you've cast a skill out of our sight...
 

zarqon

Well-known member
Yes! That's exactly what I was getting at, for skills both with and without properties. But I don't think everything necessarily needs a property. For skills that mafia doesn't track across logins, knowing the limit and maxing it out when your cast attempt fails due to hitting that limit would be quite satisfactory as far as I'm concerned.

Also, verifying (and if necessary, adjusting) the "casts" counts for daily-limited buffs could be done when visiting skills.php or the fireplace. That means that any inaccuracies in tracking daily-limited buffs would be corrected whenever any one buff was attempted.
 
Can't the vanilla KoL's skill page be parsed to see how many casts are left of the day-limit buffs? They are listed there.

I, too, would love to see some sort of tracking by KoLmafia, since most of my casting is done through mafia's Skill pane.
 
Last edited:

Veracity

Developer
Staff member
Yes, we can parse the skill use page. I'm not sure if it possible to cast skills with ajax. But if it is, I expect that chat-submitted skill casting uses that and we SHOULD use it ourself - and the whole skill page won't be there for us to look at and parse.

But yes - if you manually visit it, we could see what we figure out from it and correct any and all counters, perhaps.
 
But I don't think everything necessarily needs a property. For skills that mafia doesn't track across logins, knowing the limit and maxing it out when your cast attempt fails due to hitting that limit would be quite satisfactory as far as I'm concerned.

That's fine and dandy, except in your original proposal, you ask to track the casts made of any skill; discounting the few that skill.php will track for mafia, that's a -lot- of new properties.
I'm not sure what the philosophy on properties is though... so maybe adding a hundred and some odd skills isn't necessarily a bad thing, I'm just pointing it out.

Also, you use two spaces after the end of a sentence? I thought that died out quite a while ago.
 

Theraze

Active member
He specifically says that items without properties would just pull a session value... do you see that changing somewhere? I see that being consistently stated by zarqon...

The way I'm understanding this is, skills with limits would have a property. Could be done as simply as _skill<number>Usage, but should be something with a daily reset built into it. Skills without limits wouldn't have properties... you could just use the proxy field to check on how many times, this session, it was used. Good for figuring out how much you're casting which skills at the end of a day, or after running a buffbot, or...
 
Last edited:
Ah. I misunderstood the purpose of skillscast then. Okay. That sounds easier, but it then introduces a dichotomy in what $skill[].skillscast means. In some special cases, it's per day. In most, it's per session.

But, in a similar fashion to what you stated for the non-limited skills, we wouldn't really need properties for the limited buffs either... they could be loaded from the skills page at login, and then tracked through the session.

Not sure if that's easier or whatever, but it cuts back on new properties.
Also, the word skills no longer makes sense to me.
 

StDoodle

Minion
If "property clog" is an issue, you could always just have a "_limitedSkillUse" property that could have a [something]-delimited list.
 

roippi

Developer
Since I believe we've reached a quorum in that daily-use skills need a preference (there really aren't that many), I'll go ahead and implement that.

I believe these are the daily-use skills that mafia is lacking, let me know if I'm missing any:

Employee of the Month
Summon hobo underling (combat skill)
The Ballad of Richie Thingfinder
Benetton's Medley of Diversity
Elron's Explosive Etude
Chorale of Companionship
Prelude of Precision
Donho's Bubbly Ballad
Inigo's Incantation of Inspiration
Rainbow Gravitation

Other question - is _skill4411Casts or _inigosCasts preferable?
 
Top