weiqi auto jump

按下方向键右,可直接跳到下一题

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         weiqi auto jump
// @namespace    https://www.101weiqi.com/qday/
// @version      1.0
// @description  按下方向键右,可直接跳到下一题
// @author       Lennon
// @match        https://*.101weiqi.com/*
// @require      http://code.jquery.com/jquery-2.1.1.min.js
// @run-at       document-end
// @icon         https://deepmind.com/static/v0.0.0/appIcons/favicon.png
// ==/UserScript==
(function() {
    'use strict';

    var elementButton = $('a.btn-info');
    $(document).keyup(function(e) {
        switch (e.keyCode) {
                // arrow left
            case 37:
                elementButton[0].click();
                break;
                // arrow right
            case 39:
                if($('div[ng-click="startnext()"]').length) {
                    $('div[ng-click="startnext()"]').click();
                } else if ($(elementButton[1]).length) {
                    elementButton[1].click();
                } else if ($('div.huati_lei > span > a').attr('href').length) {
                    location.href = $('div.huati_lei > span > a').attr('href');
                }
                break;
        }

        return !0
    })
})();