Feature globalPath

fredg1

Member
I made a patch that adds a preference, globalPath.

The point would be to "store" which path (more exactly, its ID) you're in for aftercore, so that you can see if you are, for example, in Community Service's aftercore, which still locks Council quests.

I originally wanted to make the preference only for information storage, and make it so that you could use my_path( boolean ) or my_path_id( boolean ) to get it, but got convinced to refrain from doing that, though that meant I was forced to end up storing the path as its ID rather than its name.


It's not much, but it would be a start.
(I was originally thinking of adding another possible value to quest properties: rather than only having unstarted and finished as "edge" values, we would also have n/a (not available). May not be needed if this globalPath feature is implemented, though... ... or not? =3 )


View attachment globalPath.patch
 

MCroft

Developer
Staff member
Well, I don’t think it’s really global, which seems like it should be cross-character, like global preferences.

Maybe the name should be lastPathStarted?

But what it really makes me think is that something like a browser cookie system for ASH solves this by letting a script persist data in the prefs. Basically get/set/clear commands based on a key returning a value. Mafia wouldn’t need to change each time an ash script needed to persist a key-value pair.
 

Veracity

Developer
Staff member
So Community Service takes away your options in aftercore?
Surely you know that, going into such a run.
Surely you know when you have completed such a run.
What, exactly, are you doing, such that you forget that?

I’ve never done a Community Service run. Reading about it in the Wiki, I am sure that I never will. But the Wiki seems to say that you have to make an effort to even HAVE an aftercore. Given that, why can’t you write yourself a note (set yourself a property) to remind yourself? Why is this something KoLmafia needs to do? Since KoL apparently disciurages aftercore n Community Service, is KoLmafia support useful for anyone other than you?

I repeat: why are you doing this?
 

fredg1

Member
IDK if Community Service is the only path that would be helped by this change (does kingdom of exploathing also keep parts of the kingdom blown up once you break the prism?), but assuming it is/answering the question:

Community is an excellent path to farm karma, especially time-wise, with how more-easily-than-normal you can script the ascension (it's thanks to it, in fact, that I got to learn ASH).
With IOTMs, you can easily finish it in less than 2 days, which means you ascend on this path at the end of the day, doing day 1, and on the next day, finish the "day 2", and you're out, ascending again at the end of the day. 1 ascension per day.

So, to answer your question, I'll just say how many adventures I generally have to spend in aftercore, once I exit community service: 300-400.
P.S. I'm far from the only person doing this, regardless of how much the wiki "discourages" this.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I'm sure something like this would help zarqon's CanAdv for example. But it is a strange one for sure. In any case, here you go fred!

Code:
int my_starting_path()
{
    if ( my_path_id() != 0 )
    {
        return my_path_id();
    }

    int ascension_number = my_ascensions() + 1;
    string log = visit_url( `ascensionhistory.php?who={my_id()}` );

    string PATTERN = `{ascension_number}   </td><td.*?</td><td.*?</td><td.*?</td><td.*?</td><td.*?</td><td.*?</td><td.*?</td><td.*?<img.*?<img.*?alt="(.*?)"`;
    matcher m = PATTERN.create_matcher( log );

    if ( !m.find() )
    {
        return 0;
    }

    string path_name = m.group( 1 );

    int newline = path_name.index_of( "\n" );

    if ( newline > -1 )
    {
        path_name = path_name.substring( 0, newline - 2 );
    }

    return path_name.path_name_to_id();
}
 
Last edited:
Top