[Userscript] WaniKani Lesson Cap


WaniKani Lesson Cap

A simple script to lock lessons if you have too many apprentice items.


This userscript is using the WaniKani Open Framework.
You can check out this thread for install instructions.

You can download the script on GreasyFork, GitLab, or GitHub.


The way in which the score is calculated is pretty straightforward.
Each item gets a rating depending on the SRS level (from Apprentice to Enlightened).
Then the ratings get summed up and form the total score.
Basically, the higher in level an item is, the less it will affect the total score.

You can click on the score to edit the total score (detaults to 100).

SRS LevelRating
Apprentice 16.00
Apprentice 23.00
Apprentice 31.04
Apprentice 40.51
Guru 10.14
Guru 20.07

This script is based on finnra’s WK Anti-burnout Userscript

Features I added:

  • Reduce amount of API calls per update (was one for every level, now retrieved in batch)
  • Lock lesson continue button after completing a lesson if it would exceed your max score
  • Add CSS styling via stylesheet, instead of using inline style
  • And it’s of course fully compatible with my Breeze Dark Theme :smile:


I like it a lot. It seems to calculate scores a little bit differently from my script, but to be honest, everything’s made up and the points don’t matter anyway.

I don’t like how there’s a margin above the information bar. Otherwise, it seems to be a straight upgrade (as in, it’s better) from my script. I’ll try it out for a bit and find out if I’ll just link to this topic from mine.

Well done. :slight_smile:

(Edit: I’m a little bit saddened that you abandoned the spiciness metric :stuck_out_tongue: )


ありがとうございます :pray:

I could re-introduce the spicy metric again, but I didn’t want to completely copy your theme. :smile:

Something is strange here.

I think I know why.

It’s only fetching the first page of the json response, and ther can be multiple.

Edit: Should be fixed now.

1 Like

That fixed it.

I like the anti-burnout script more because it only uses on bar.

I should probably add some visual clue for this, but you can edit the max score by clicking on the score.

Ah I see. Its like a hidden feature :slight_smile:

Updated to work with the new pagination format.

My suggestions:

Great idea! I’m always doing lessons when I shouldn’t.

The Gitlab link seems to point to a page that doesn’t exist (or is not publicly visible). I can see your other WK repository, though.

Repository permissions were wrongly set to “private”.

Fixed it now, thanks.

1 Like

Hmmm, that reload icon is centered for me. :thinking:
But yeah, I probably should be smaller.

I will remove the margin in the default style.
Spiciness will probably come back as well :smile:.

I will fix this either this evening or weekend.

1 Like

How lovely! Do you mind if I direct people who used my script to this topic? I feel like it’s the natural evolution. :slight_smile:

Nah, I don’t mind.

It’s your thread, you can do with it whatever you want :slight_smile:

So I installed this, really looking forward to trying it after I was swamped with over 200 reviews this morning. But I can’t… seem to find it? I installed it from GreasyFork, and GF seems to THINK I have it installed, but I don’t have it available for me on my dashboard? It’s simply not there. I click on lessons, and I AM blocked from doing more, but… I can’t find any interface or settings for the script? Help?

EDIT: So NOW it’s visible on the lesson summary screen. And seems to be working. Is that the only place it shows up? Forgive me, I’m not familiar with the original version of the script (pre-your changes).

EDIT 2: With a maximum score set at 100, about how long does a level take? Anyone know?

Yes, it only shows up on the lesson screens, because there’s no need to inject the script into the site (and increase page load times) when it’s not needed.

Haven’t made any measurements in how long a level could take with a specific setting.
One could calculate it, and maybe I’ll take some time and put something together if I find some time.

I actually had a bug in there where it wouldn’t load properly when the API key wasn’t present, only after the next page reload.
Should be fixed now (I hope)

Hitting “Enter” on the keyboard when on the end-of-lesson screen, where you can go to the summary page or continue on to more lessons, will take you to a new set of lessons even if the set you’ve just done was supposed to be your last set and the “continue” button isn’t displayed. The key press should either be disabled or take you to the summary screen in this case.

This should be fixed now with 0.5.10.

Thanks for the report.