# WaniKani Lesson Balance script

**URL:** <https://community.wanikani.com/t/wanikani-lesson-balance-script/21136>\
**Category:** API And Third-Party Apps\
**Created:** [October 31, 2017, 5:02am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136 "2017-10-31T05:02:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [October 31, 2017, 5:02am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/1 "2017-10-31T05:02:49Z")

</div>

Get an even progression across radicals, kanji, and vocabulary with this script: [WaniKani Lesson Balance](https://greasyfork.org/en/scripts/34858-wanikani-lesson-balance). This script will have you doing more of your vocabulary earlier. So no more “Congratulations! You’ve leveled up! And now you need to work on 120 vocab!”

In the extreme your progress could look like this (very close to balanced):

![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/0/f/0f7d3ce527814c03acd9f9212d88c25efafb54dc.png)

E.g. this is what my lesson starting level 8 looked like:

![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/5/3/53040b840cf2631ebe0b24018f5d4726e072c77e.png)

More realistically (unless you always keep your lessons at zero - I always have plenty waiting for me), then with this script your progress will look a lot like this:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/b/f/bf2b4e97ed59a81477a8e03b45891ae9ad7436d1.png)

Note that this dashboard information is from [[Unsupported] Userscript: Dashboard Level Progress Detail (srs stages on progress bars)](https://community.wanikani.com/t/userscript-dashboard-level-progress-detail/21119).

Here’s a [log of screenshots](https://community.wanikani.com/t/optimizing-the-learn-order/21136/12) showing my progression from level 6 to 7 with this script.

If you’re curious as to how this works the mechanics are:

- Detect when the lesson has started, or the lesson has been continued.
- Leave the order alone for anything from an earlier level.
- Reorder the remaining subjects so that the percentage of radicals, kanjis, and vocab stay equal (with vocab \> kanji \> radical as tie breaker).
- When picking a subject select the one that unlocks the most (i.e. pick the radical that unlocks the most kanji and indirectly vocab, pick the kanji that unlocks the most vocab, or pick any vocab).
- If it’s impossible to, say, pick a vocab because they’re all locked then the script will allow the radicals, kanjis, and vocab to get unbalanced. It won’t stop you from learning!

I’ve tested this script out on myself for a full level and a half. I think I’ve ironed out all the bugs. If you find a bug, please do let me know! I’m also open to sharing what I’ve learned about writing reorder scripts because it wasn’t at all intuitive. (Big thanks to @rfindley for helping me get started)

Enjoy!

If you like this script, you might also like some other things I’ve been up to:

- [[Unsupported] Userscript: Dashboard Level Progress Detail (srs stages on progress bars)](https://community.wanikani.com/t/userscript-dashboard-level-progress-detail/21119/1)
- [[Unsupported] Leech training script](https://community.wanikani.com/t/leech-training-script/21699/1)
- [Leeches screensaver](https://community.wanikani.com/t/leeches-screensaver/19585/1)
- [[Unsupported] Dashboard Userscript: Leech, Apprentice, and Guru detail (aka SRS level progress)](https://community.wanikani.com/t/dashboard-userscript-leech-apprentice-and-guru-detail-aka-srs-level-progress/19353/1)

* * *

Original post (just to keep the replies in context):

Take a look at this:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/2/8/28a9ae4343b5d579e321cb8f7346304004440d3b.png)

Or just these snippets:

![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/f/a/fad6056db4a56651535a95dfb2401708369ad95d.jpg)

![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/9/3/938a7ab71c0a2f913f2361639eef7fcf10121f10.jpg)

![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/4/0/40011bb5e87df86b0a74e6723dd6e5a4a748ee3c.jpg)

What you’re looking at is a visualization of the dependencies of vocab → kanji → radicals on level 5.

What I’m thinking is that these can be rearranged in order to maximize the unlock rate, or that they can be organized by some other criteria (such as most troublesome for most people first).

I may experiment on myself by making a reorder script that aims to unlock the most vocabulary the soonest. Hmm. Hmm…

Thoughts?!

---

<div class="post-metadata">

**Author:** ![Leebo](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/leebo/32/439476_2.png) [@Leebo](https://community.wanikani.com/u/Leebo)\
**Post date:** [October 31, 2017, 5:16am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/2 "2017-10-31T05:16:58Z")

</div>

Took me a minute to imagine what effect this would have, then I remembered most people don’t do all their lessons at the same time.

---

<div class="post-metadata">

**Author:** ![talentobdo](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/talentobdo/32/7006_2.png) [@talentobdo](https://community.wanikani.com/u/talentobdo)\
**Post date:** [October 31, 2017, 5:37am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/3 "2017-10-31T05:37:26Z")

</div>

Nice visualization.

The tech tree is actually higher tho. In the images it seems like if tech tree has `height=3`, but in later levels you will see that there are Radicals that are composed of already learned Kanjis, basically making the tree higher.  
For example, [the older brother](https://www.wanikani.com/radicals/older-brother)` **radical** is made up of smaller radicals ([this](https://www.wanikani.com/kanji/%E5%85%84)).

But yeah, definitely there could be some improvements. Sometimes they teach you a radical with no uses in kanji in that same level.

I would just keep going using the wanikani’s order.

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [October 31, 2017, 5:42am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/4 "2017-10-31T05:42:41Z")

</div>

I added a link in the tree when it was required to unlock. (I excluded links to kanji or radicals from previous levels).

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [October 31, 2017, 5:51am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/5 "2017-10-31T05:51:31Z")

</div>

I don’t think that the tree ever does get deeper than 3 (a vocab depends on kanjis that depend on radicals). At least, not in the way that the information is organized in the WK API. I had a dig around various levels and this is the most complicated relationship that I found (from level 10):

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/0/2/02b9b937610c6948b7cc5b3b6357dd40dd019faa.png)

---

<div class="post-metadata">

**Author:** ![tomoemi](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/tomoemi/32/71063_2.png) [@tomoemi](https://community.wanikani.com/u/tomoemi)\
**Post date:** [October 31, 2017, 6:21am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/6 "2017-10-31T06:21:54Z")

</div>

Interesting but as already mentioned, the only way you can optimize with this is when you don’t do all your lessons at once. Even then I’m not sure unlocking a bigger chunk of vocab earlier will make much difference.

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [October 31, 2017, 1:45pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/7 "2017-10-31T13:45:25Z")

</div>

Yes. This would be aimed at someone like me that doesn’t have time to do them all at once.

Edit: There are differences. On level 5 I could have started a number of kanji before even doing radicals in order to unlock their vocab sooner, namely:

交 (Mix), 光 (Sunlight), 回 (Times), 多 (Many), 米 (Rice), 体 (Body), 声 (Voice), 売 (Sell), 弟 (Younger Brother), 来 (Come), 社 (Company), 角 (Angle), 谷 (Valley), 麦 (Wheat), 林 (Forest), 空 (Sky), 草 (Grass), 音 (Sound).

---

<div class="post-metadata">

**Author:** ![ccookf](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/ccookf/32/482054_2.png) [@ccookf](https://community.wanikani.com/u/ccookf)\
**Post date:** [October 31, 2017, 2:11pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/8 "2017-10-31T14:11:33Z")

</div>

> [@hitechbunny](#):
>
> making a reorder script that aims to unlock the most vocabulary the soonest

But why? I just don’t see an practical benefit to this without the exception of clumping similar items together for people who are interested in that sort of thing.

Most levels can be done in around a week at 20-30 items per day. Given that after level 14 there’s usually \<10 radicals and 30 to 40 kanji it’s usually around 2 days to clear out the dependencies then just filling the rest of the time to level with vocab.

Even if you’re leveling slowly the default ordering just makes it so that dependencies are a borderline non-issue and the penalty for missing something is only like a 2 day delay which shouldn’t matter at all for lower pace individuals.

I think it’s cool visualizing the dependencies like this, I just don’t see an actual reason to go out of your way to further optimize WK ordering.

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [October 31, 2017, 2:15pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/9 "2017-10-31T14:15:56Z")

</div>

In my case I find I have bandwidth for 0, 3, or sometimes 6 items a day.

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [November 5, 2017, 10:12pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/10 "2017-11-05T22:12:01Z")

</div>

I have a reorder script working for me (at least, I think I do - I still have to use it a bunch first). It is certainly not for everyone. What it does:

- Orders vocab towards the top, then kanji, then radicals.
- Will always try to keep the percentages of started subjects balanced (e.g. 65% of radicals, 65% of kanji, 65% of vocab) - unless it can’t because not enough is unlocked.
- Picks subjects that unlock the biggest “tree” of remaining subjects for that level.

To explain that last point some more with an example from my level (6):

- kan/直 unlocks voc/直す, voc/直る, voc/正直, voc/直行
- kan/安 unlocks voc/安全, voc/安い, voc/安心, voc/不安, voc/平安

So it will order kan/安 ahead of kan/直 in order to unlock the most vocab the soonest. The same applies to the order of radicals, except for radicals it’s considering the whole tree of unlocks (rad through to kan through to voc).

For me right now on level 6, this is my current started percentage across the types is:

`vocabulary @ 0%, kanji @ 35%, radical @ 100%`

My progress bars look like this:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/b/3/b30988208dbcf94172978ed5126104f88f133f49.png)

I’ll report back in while to show you how that percentage is altered by this script.

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [November 6, 2017, 1:31am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/12 "2017-11-06T01:31:11Z")

</div>

Illustrating how my progress went with this script:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/a/2/a23e5e1be456d71ff7637fd79cdc93496ded27b0.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/5/d/5d0f9dd9f8365b9a78008b4b254159a963adcdee.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/9/5/95b9b3df491f8326c0fbf15a7c68a002d6810e56.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/f/4/f44bd03d21cc7af985366e7356794435f6d4209f.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/b/3/b37263aa4fe112d5078d54031e913728215a01ac.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/a/8/a80c1105249254885e98541616c6e39927e3864e.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/b/f/bf2b4e97ed59a81477a8e03b45891ae9ad7436d1.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/f/4/f4e26fd50d3458994e4d7ba031b7deb858ad88c0.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/7/9/7947d0093d4486e109c415b0e132cb55529aad26.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/7/c/7cfe24997281f04d9a0b55eefc02d63964984f10.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/9/3/935610806f4b0074952c2245c792d17caa3550c3.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/f/4/f40c1b6563999f89434bbc58e403414c7abaf843.png)

Oops. I had a bug that prioritized radicals over all else:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/3/c/3c79c735c02257770a0fb4e88ba27a62887171fb.png)

It’s rebalancing things:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/c/0/c0daa0cc0b518738db56d1f5615ad164c98c2e53.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/5/2/525379f8ff004e70e8f5baaccb7c5c063df2ef54.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/3/1/31fa2723d0401001c12ccd48f0f6583031aa0181.png)

There’s a bug in my script. When I continue for more lessons it doesn’t alter the lesson order (so I did a bunch more radicals again):

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/9/1/911c48da7159baa28e90fc476c3b7584fdb91582.png)

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/1/1/11f3578a14d9bfafba3746b54ddf6ba98d1fb793.png)

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [November 7, 2017, 9:22pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/17 "2017-11-07T21:22:09Z")

</div>

To illustrate how the (as yet unpublished) script works:

 ![image](https://global.discourse-cdn.com/wanikanicommunity/original/3X/a/a/aaa5bdf97c48503229d707f2b813dd5ece7c454a.png)

---

<div class="post-metadata">

**Author:** ![rfindley](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rfindley/32/35202_2.png) [@rfindley](https://community.wanikani.com/u/rfindley)\
**Post date:** [November 7, 2017, 10:19pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/18 "2017-11-07T22:19:56Z")

</div>

@hitechbunny,  
I wonder if this would look good with the ‘locked’ background image for the locked portion of the bar:

* * *

![](https://global.discourse-cdn.com/wanikanicommunity/original/3X/c/5/c58c2faa818babd7b55a92b2ae86544db371b736.png)

* * *

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [November 8, 2017, 2:11pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/19 "2017-11-08T14:11:12Z")

</div>

I wanted to use that image. I believe that the URL will change with every new deploy of WK. Any thoughts as to how to reuse it?

---

<div class="post-metadata">

**Author:** ![rfindley](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/rfindley/32/35202_2.png) [@rfindley](https://community.wanikani.com/u/rfindley)\
**Post date:** [November 8, 2017, 2:28pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/20 "2017-11-08T14:28:13Z")

</div>

I don’t think the url changes unless the asset itself changes. But you could either draw your own and host it somewhere, or data-encode it and paste it in the script itself ([online data uri encoder](https://www.base64-image.de))

---

<div class="post-metadata">

**Author:** ![hitechbunny](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/hitechbunny/32/70848_2.png) [@hitechbunny](https://community.wanikani.com/u/hitechbunny)\
**Post date:** [November 8, 2017, 2:29pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/21 "2017-11-08T14:29:13Z")

</div>

Oh! Data url encoding is a great idea. Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![Ravsii](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/ravsii/32/72710_2.png) [@Ravsii](https://community.wanikani.com/u/Ravsii)\
**Post date:** [November 14, 2017, 4:21pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/24 "2017-11-14T16:21:18Z")

</div>

I’m sorry, but what is the script for these level bars? Or it’s private?

---

<div class="post-metadata">

**Author:** ![temporaryuser381](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/temporaryuser381/32/151314_2.png) [@temporaryuser381](https://community.wanikani.com/u/temporaryuser381)\
**Post date:** [November 14, 2017, 5:26pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/25 "2017-11-14T17:26:42Z")

</div>

its this one.

> [@\[Unsupported\] Userscript: Dashboard Level Progress Detail (srs stages on progress bars)](https://community.wanikani.com/t/userscript-dashboard-level-progress-detail/21119):
>
> This script provides a comprehensive srs-stage overview of your vocab, radicals, and kanji… So you will always see progress on your bars after a lesson or review. It will list radicals, kanji, and vocab for the current level, as well as for the previous level if they haven’t reached 90%+ guru level.

---

<div class="post-metadata">

**Author:** ![Ravsii](https://sea1.discourse-cdn.com/wanikanicommunity/user_avatar/community.wanikani.com/ravsii/32/72710_2.png) [@Ravsii](https://community.wanikani.com/u/Ravsii)\
**Post date:** [November 14, 2017, 5:35pm UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/26 "2017-11-14T17:35:38Z")

</div>

Oh, thank you!

---

<div class="post-metadata">

**Author:** ![jasenko](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/wanikanicommunity/original/3X/f/d/fd4c154120954695f788402f3bcf4e616499bc2d.png) [@jasenko](https://community.wanikani.com/u/jasenko)\
**Post date:** [November 16, 2017, 5:48am UTC](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136/27 "2017-11-16T05:48:38Z")

</div>

Can’t wait to trial this script… I made a comment in a “wishlist” thread asking for something like this. What usually happens with me is that I get hit with 30+ lessons from the previous level when entering the new level and would prefer just to deal with the items from the new level. A bunch of Kanji in each level have only one or two vocab words attached to them at respective levels and it would be great if I can study them last. This is not about speed of levelling, more about managing my time and expectations and have a constant level of apprentice items to deal with at all times. I am bookmarking this thread.

[Next page](https://community.wanikani.com/t/wanikani-lesson-balance-script/21136.md?page=2)
