Greasy Fork is available in English.

恋爱游戏网验证码自动识别

打开游戏页面,自动识别并填写验证码

// ==UserScript==
// @name         恋爱游戏网验证码自动识别
// @namespace    http://tampermonkey.net/code_recongnize
// @version      2020.10.27.1
// @description  打开游戏页面,自动识别并填写验证码
// @author       PY-DNG
// @icon         https://www.lianaiyx.com/skin/member/images/nopic.gif
// @include      https://www.lianaiyx.com/
// @include      https://www.lianaiyx.com/GalGame/*
// @include      https://www.lianaiyx.com/yangcheng/*
// @include      https://www.lianaiyx.com/monijingying/*
// @include      https://www.lianaiyx.com/celve/*
// @include      https://www.lianaiyx.com/jiemi/*
// @include      https://www.lianaiyx.com/ss/*
// @include      https://www.lianaiyx.com/yxzy/*
// @include      https://www.lianaiyx.com/gonglve/*
// @include      https://www.lianaiyx.com/e/pl/*
// @require      https://greasyfork.org/scripts/408740-%E6%81%8B%E7%88%B1%E6%B8%B8%E6%88%8F%E7%BD%914%E4%BD%8D%E6%95%B0%E5%AD%97%E9%AA%8C%E8%AF%81%E7%A0%81%E8%AF%86%E5%88%AB/code/%E6%81%8B%E7%88%B1%E6%B8%B8%E6%88%8F%E7%BD%914%E4%BD%8D%E6%95%B0%E5%AD%97%E9%AA%8C%E8%AF%81%E7%A0%81%E8%AF%86%E5%88%AB.js?version=837246
// ==/UserScript==

(function() {
    'use strict';

    let code;
    const input = document.getElementById('key');
    const focusEvent = new Event('focus');
    const codeImage = document.getElementById('KeyImgpl') ? document.getElementById('KeyImgpl') : document.getElementById('KeyImg');
    if (!codeImage) {return;};
    codeImage.addEventListener('load', function() {
        code = rec_image(codeImage);
        if (code) {
            input.value = code;
        } else {
            input.dispatchEvent(focusEvent);
        }
    })
    input.dispatchEvent(focusEvent);
})();