POPCAT 自動點擊器

POPCAT 自動點擊

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         POPCAT 自動點擊器
// @namespace    http://tampermonkey.net/
// @version      2.0.0
// @description  POPCAT 自動點擊
// @author       聖冰如焰
// @match        https://popcat.click/
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// @grant        GM_addStyle
// ==/UserScript==

GM_addStyle(`
    #timeLeftBox {
        top: 100px;
        position: absolute;
        z-index: 10;
        font-size: 50px;
        margin: 10px;
        -webkit-text-stroke-width: 1.5px;
        height: 0;
        flex-grow: 1;
        background-position: bottom;
        background-size: contain;
        background-repeat: no-repeat;
        touch-action: manipulation;
        text-align: center;
        color: #fff;
        -webkit-text-stroke-width: 2px;
        -webkit-text-stroke-color: #000;
        font-weight: 900;
        word-wrap: break-word;
    }
    
    #timeLeftTitle {
        
    }
    
    #timeLeftCount {
        font-size: 40px;
    }
`);

'use strict';
(() => {
    $('body').prepend('<div id="timeLeftBox"><div id="timeLeftTitle">剩餘時間</div><div id="timeLeftCount">30</div></div>');

    //--------------------------------------------//
    let timeLeftCount = $('#timeLeftCount');
    let limitTime = 30000;
    let limitCount = 800;
    let time = +new Date();
    let clickCount = 0;
    let event = new KeyboardEvent('keydown', {
        key: 'g',
        ctrlKey: true
    });
    let rundo = () => {
        let nowTime = +new Date();
        let leftTime = nowTime - time;
        timeLeftCount.text((Math.round((30 - leftTime / 1000) * 1000)/1000).toFixed(3) + 's');
        if (leftTime >= limitTime) {
            time = nowTime;
            clickCount = 0;
        };
        if (++clickCount < limitCount)
            document.dispatchEvent(event);
        requestAnimationFrame(rundo);
    }
    requestAnimationFrame(rundo);
})()