[Userscript] auto-commit; the end of the enter key

Just wrote a small scripts that checks your input against the expected answers. If your input is correct then the answer is commited automatically.

Therefore you have to use the enter key way less than before. Relieve for your pinky finger!!!1one

URL: https://greasyfork.org/en/scripts/16466-wk-auto-commit

The script adds a small button on the bottom of the page, where you can activate/deactivate the script.

Please tell me your feedback or bug reports here.

Tested with the Chromium Browser and Tampermonkey 

User WillNiels also added a version that deactivates the script for certain items such that you cannot use this script for cheating, please see this post.

EDIT: It does not work with Firefox and Greasemonkey, as Greasemonkey seems to be more restrictive about the use of jQuery than Tampermonkey.
EDIT2: It does work with Firefox and Greasemonkey for me now. Installation URL remains the same.
EDIT3: Now also works on the Lessons, not only on the Reviews
EDIT4: Added modification of user WillNiels
Screenshot:



7 Likes

Hey, this sounds awesome, but sadly I get an error while trying to download it with greasemonkey:



It’s in German, I’ll try to translate it.

“Skript could not be analyzed.
Ignore @match rule http*://wanikani.com/review
/session* because:
Error: @Hit: The pattern could not be analyzed.”

1 Like

I really want something that let’s me avoid the enter key. I’m starting to develop a RSI in my pinky from stretching out to the enter key after each word I type. But sadly I don’t dare to try this one, I know I would cheat way too much.

I can see myself answer しゅく as reading for something, see that it’s not autosubmitted and fix it to しゃく instead and get it autosubmitted and I succeed with a word that I would actually fail.

What I would love were if double tapping space submitted the word. That’s not something you do by accident and extra spaces at the end of a word doesn’t mark it as wrong.

Nope, doesn’t work in Firefox.

EDIT: it doesn’t even load, so there’s something in the script that greasemonkey doesn’t like.

It’s nice and all, but it essentially let’s me guess answers until it accepts the right one. So this script is also one of those where you have to have some self control and not abuse it.

2 Likes
rocker2511 said... Hey, this sounds awesome, but sadly I get an error while trying to download it with greasemonkey:



It’s in German, I’ll try to translate it.

“Skript could not be analyzed.
Ignore @match rule http*://wanikani.com/review
/session* because:
Error: @Hit: The pattern could not be analyzed.”

 I just randomly clicked into this thread from recent activity but this is really easy to fix,
where it says @match http*://www.wanikani.com
// @match        http://www.wanikani.com/review/session*
// @match https://www.wanikani.com/review/session*

it doesn’t like the unqualified windows style * in the middle of the match

Looks great

horusscope said...
rocker2511 said... Hey, this sounds awesome, but sadly I get an error while trying to download it with greasemonkey:



It’s in German, I’ll try to translate it.

“Skript could not be analyzed.
Ignore @match rule http*://wanikani.com/review
/session* because:
Error: @Hit: The pattern could not be analyzed.”

 I just randomly clicked into this thread from recent activity but this is really easy to fix,
where it says @match http*://www.wanikani.com
// @match http://www.wanikani.com/review/session
// @match https://www.wanikani.com/review/session


it doesn’t like the unqualified windows style * in the middle of the match

 doesn’t fix it for me. It was one of the first things I tried. After some 20 minutes of debugging I just gave up.
johmik said... EDIT: It does not work with Firefox and Greasemonkey, as Greasemonkey seems to be more restrictive about the use of jQuery than Tampermonkey.
 False, jQuery is fine.


Edit: As a random aside, when I read through the WK override script I noticed it had
$ = unsafeWindow.$;
to alias jQuery, either way the script won't load in GM until you fix the URL match
horusscope said...
johmik said... EDIT: It does not work with Firefox and Greasemonkey, as Greasemonkey seems to be more restrictive about the use of jQuery than Tampermonkey.
 False, jQuery is fine.


Edit: As a random aside, when I read through the WK override script I noticed it had
$ = unsafeWindow.$;
to alias jQuery, either way the script won't load in GM until you fix the URL match
 That's not really necessary. My scripts work fine without it. JQuery doesn't even need to be included because WK itself already uses it.
Mempo said...
horusscope said...
johmik said... EDIT: It does not work with Firefox and Greasemonkey, as Greasemonkey seems to be more restrictive about the use of jQuery than Tampermonkey.
 False, jQuery is fine.


Edit: As a random aside, when I read through the WK override script I noticed it had
$ = unsafeWindow.$;
to alias jQuery, either way the script won't load in GM until you fix the URL match
 That's not really necessary. My scripts work fine without it. JQuery doesn't even need to be included because WK itself already uses it.
I made it work with Firefox and Greasemonkey for now.
It looks like that the site jQuery can not be accesed if there is not a "// @grant none" line in the header.
Therefore, because I used "// grant GM_addStyle" the site jQuery could not be accessed, and the variable $ was left as  not defined.
I amended the script slightly, such that it does not use the GM_addstyle anymore.

For me, it works in Firefox with Greasemonkey, as well as in Chromium with Tampermonkey now. Tested with FF 43.0 and GM 3.6, as well as Ch 47 and TM 3.12.

Thanks for all your feedback! :)
nibarius said... I really want something that let's me avoid the enter key. I'm starting to develop a RSI in my pinky from stretching out to the enter key after each word I type. But sadly I don't dare to try this one, I know I would cheat way too much.

I can see myself answer しゅく as reading for something, see that it's not autosubmitted and fix it to しゃく instead and get it autosubmitted and I succeed with a word that I would actually fail.
Exactly, with only 100 reviews, its like hitting the enter key 200 times only for the reviews. About the cheating, well its the same discussion as with the Override script I would say, some people won't misuse this where others would.

nibarius said...What I would love were if double tapping space submitted the word. That's not something you do by accident and extra spaces at the end of a word doesn't mark it as wrong.
 Yes, I like this idea too !
1 Like

This works great!

Though I still got the pinky reflex ;p

EDIT: didn’t know about the @grant:none JQuery thing. Learned something today!

Are you planning to include this in lessons too?

I didn’t plan to, because in my case lessons are way less than reviews.

Yet, I will have a look on it this weekend, I think it’ shouldn’t be too difficult to adapt to the lessons page.

there actually is already a script for that, called Wanikani Improve, but you can’t really find it anymore and it hasn’t been maintained for 2 years or so, so it doesn’t work without some tweaking. I still have it from back then.

I don’t want to suggest to drop yours, because having a script for this that is still being maintained is definitely useful. You might want to consider to copy a feature from WaniKani Improve though:
It has a button to show you the definition from the last item and what your answer was. It also shows by color coding of the button if there were other possible answers around, or if your answer wasn’t spot on and the typo correcter jumped in (mostly these are the cases where you use the button, to check if it really was a typo or if your answer was wrong).

Naryoril said... there actually is already a script for that, called Wanikani Improve, but you can't really find it anymore and it hasn't been maintained for 2 years or so, so it doesn't work without some tweaking. I still have it from back then.

I don't want to suggest to drop yours, because having a script for this that is still being maintained is definitely useful. You might want to consider to copy a feature from WaniKani Improve though:
It has a button to show you the definition from the last item and what your answer was. It also shows by color coding of the button if there were other possible answers around, or if your answer wasn't spot on and the typo correcter jumped in (mostly these are the cases where you use the button, to check if it really was a typo or if your answer was wrong).
 I know and use the WK Improve script. It has some overlap in functionality, but it's still not quite the same. It reduces the need to ENTER by one, but this script eliminates it completely. But the Improve script, as you said, also does a number of others things on the reviews page. Therefore it's useful to have this one, because it improves on only one function found in the Improve script and could potentially branch out to improve lessons.

johmik said... I didn't plan to, because in my case lessons are way less than reviews.

Yet, I will have a look on it this weekend, I think it' shouldn't be too difficult to adapt to the lessons page.
 Well, apparently it's not as simple as add the lesson URL's to the @match, because I already tried that! ;p
You'll probably have to find a way to postpone the binding of your 'checkAnswer' function to the review box until the lesson info pages are over.
Though I haven't looked at it any further than described above, I'm guessing the script now goes like 'Welp, couldn't find that HTML element you're looking for, so good look without me, mate!'

Overall it would just be nice to have because I quickly got used to no more ENTERs, and whenever I do lessons now, it bugs the hell out of me. Mostly because I just stare at the screen, waiting for it to commit, but a few seconds later I realize that doesn't happen on the lessons page and I go like AAAAAARRRGGHH and this happens far too often!

Updated the script to make it work on the Lessons page too.

https://greasyfork.org/en/scripts/16466-wk-auto-commit

I did not test if it works with radicals on the lessons page, though, but should not be a problem.

johmik said... Updated the script to make it work on the Lessons page too.

https://greasyfork.org/en/scripts/16466-wk-auto-commit

I did not test if it works with radicals on the lessons page, though, but should not be a problem.
 Great, thanks! Gonna have to wait a few more days before I can test it on radicals, but as you said, that's probably not going to be a problem!

The button doesn’t work when WK Override is enabled.