Greasy Fork

Greasy Fork is available in English.

faucetoshi.com

Walk through all PTC

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         faucetoshi.com
// @description  Walk through all PTC
// @version      1.1
// @author       WXC
// @match        https://faucetoshi.com/ptc*
// @grant        none
// @require      https://code.jquery.com/jquery-latest.min.js
// @grant        unsafeWindow
// @run-at document-idle
// @noframes
// @namespace http://greasyfork.icu/users/713625
// ==/UserScript==


(function() {
    'use strict';

    setInterval(function() { window.focus(); }, 500);
    document.hasFocus = function () {return true;};


    var $ = window.jQuery;
    $.noConflict();
    $(document).ready(function() {

        setTimeout( function() {

            // PTC solve
            if( location.href.indexOf("/ptc/view") > -1 ) {


                var check_ptc = setInterval( function() {

                    if( $("#verify").is(":visible") ) {

                        clearInterval( check_ptc );



                        if( $(".h-captcha").is(":visible") ) {

                            document.title = "CAPTCHA!";

                            // check response
                            var h_timer = setInterval( function() {

                                if( $("[id^=h-captcha-response]").val().length > 32 ) {

                                    clearInterval( h_timer );
                                    $("form:first").submit();

                                }

                            }, 3000 );

                        }


                    }

                }, 2000 );

            }
            // PTC list
            else if( location.href.indexOf("/ptc") > 0 ) {

                if( $("button.btn:contains('Go')").is(":visible") ) {
                    $('.btn-primary:first').click();
                }

            }
            else {}


        }, ( 3 * 1000 ) );

    });


    // global reload
    setTimeout( function() {
        location.href = location.href;
    }, ( 90 * 1000 ) );


})();