[UserScript] Leech List Burn-Only Upgrade

I wasn’t expecting this thread to be so old. It’s amazing the script still works after all this time. I see that OP hasn’t been seen in a bit over a year, but I thought it good to share here anyway. I noticed today a couple of problems with the script: that the config for get_items has an error, resulting in open framework returning all items on WaniKani; and that a couple of items that should have been marked 不可能 were not. This original method to determine if a leech will only reach a value of 1.00 by burning is not correct.

If anyone wants to edit the code manually, here’s what to do.

The correct config is:
const config = {
    wk_items: {
        options: {
            review_statistics: true,
            assignments: true
        },
        filters: {
            srs: {value: '-1,0,9', invert: true}
        }
    }
};
To fix the calculation of 'impossible':

We can replace the line that sets item.startleech and the entire switch statement that follows with:

item.mustBurn = (item.highestincorrect - item.highestincorrectstreak) + item.assignments.srs_stage >= 9
if (item.mustBurn) {
    item.impossible = "不可能";
    item.impcnt = 1;
}
else {
    item.impossible = " ";
    item.impcnt = 0;
}

Furthermore, we can replace the srs stage name switch by making use of a const declared near the beginning of the function and a single line to replace the switch:

Better code for assigning stage name
// near top of function, probably right after globals comment
const srs_stages = [
    'Initiate',
    'Apprentice 1',
    'Apprentice 2',
    'Apprentice 3',
    'Apprentice 4',
    'Guru 1',
    'Guru 2',
    'Master',
    'Enlightened',
    'Burned'
];

// then replace switch(item.assignments.srs_stages) with the following line
item.srsstagename = srs_stages[item.assignments.srs_stage];

If you’re still around using this, I hope these fixes help :3

2 Likes

Looks like the userscript has finally croaked. It’s no longer showing up on my dashboard.

1 Like

Oh, not necessarily, it just looks like they changed the structure of those tables at last. At some point I’ll figure out the fix for it and make another update post here to go along with what I put above.

1 Like

Update: I’ve gotten it working again on the dashboard but I don’t have any critical condition items to test out on the Critical Items page. If someone with critical items could supply the outerHTML of the div with the class subject-character-grid--single-column that’d help a lot.

1 Like

Hello! I was interested in this script but it doesn’t seem to be changing anything about my critical condition list or dashboard in general. I notice there hasn’t been activity in a while. Is this still supported?

1 Like

Hey y’all, I’m planning on returning to Wanikani more, and will probably (not promising anything for sure) spend some time in the near future trying to fix this script. I see @LupoMikti has found some fixes again, so I think it should be fairly doable. If there is already a forked fix of this, that’s even better :stuck_out_tongue_winking_eye: If you have a link, I’ll gladly visit the page and promote it here.

Ok so it’s going to take a bit until I have created some serious leeches that are hard to fix, so it’s currently not completely possible for myself to see what is wrong with the script itself.

I have however made @LupoMikti 's suggestions permanent, and adapted the CSS such that it matches and uses the wanikani CSS.

However, I am unable to get the script to work on the critical condition page, so hold on tight for that one. Really strange question, can someone give me the link to the page of the Critical Condition Items page?

Okay tee-hee I fixed everything anyway. Only thing I can’t check is whether the burn-only count and tag are working correctly, so if there’s any issues with that, please comment down below. Also one thing I don’t have time to fix rn, it seems that the critical-conditions page doesn’t trigger properly, and needs a refresh before the script is activated. Still looking into that.