Feature Count ascensions since rollover

Irrat

Member
Currently there doesn't seem to be a way to track how many times the user has ascended since rollover.

It'd be useful for a script as it means it can check what leg of their loop they should be running, as the alternative is either guessimating by their current state or to store a preference of their own.

As a brief example, when I log in for the first time. ascensionsToday = 0, I ascend into casual. ascensionsToday = 1.

I run my script, and it knows that I am on my first ascension, and I will be ascending again today.

I ascend, and ascensionsToday = 2. The script knows I will be ending rollover on this ascension.

That said, I'm not sure if mafia does any sort of rollover tracking, even _potatoAlarmClockUsed is a daily flag when it should be a rollover flag as it can only trigger once/rollover.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I would be interested in an _ascensionsToday pref, PRs welcome. Potato alarm clock should be fixed on the mafia end - we can problably give it a _ exception to only apply on true rollover.
 

Veracity

Developer
Staff member
Yeah, potato alarm clock is fine as a “_”, since it will clear on rollover, just like all such properties do. Making it not clear on ascension would be accurate.

But, considering it’s just “informative” - it tells you whether you got 5 extra turns at rollover; if it is “false”, there is nothing you can do to change it - I can’t imagine why a script would change its behavior based on it being true vs. false.

Which is to say, although I like accuracy, it’s a purely cosmetic change - and would be way down on my personal priority list.
 

Baden

Member
Proper mafia support for this would be amazing. I've been using the following function that parses the session log to count ascensions:

JavaScript:
import {
  fileToBuffer,
  myName,
  todayToString,
} from "kolmafia";

export function ascensionsToday(): number {
  const sessionLog = fileToBuffer(`${myName()}_${todayToString()}.txt`);
  return (sessionLog.match(/Ascend as a .+? banking \d+ Karma./g) || []).length;
}
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
It's a simple PR, please do make it!
 

Irrat

Member
I think the biggest question is, do we increment it when we jump into the gash, or when we pick a path?
 
Top