Civitai Auto Clicker with Refresh

Add a button to auto-click specific buttons on Civitai images page and refresh the page

目前為 2024-10-18 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Civitai Auto Clicker with Refresh
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Add a button to auto-click specific buttons on Civitai images page and refresh the page
// @author       Your Name
// @match        https://civitai.com/images
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 버튼 클릭 여부 확인
    const buttonClicked = localStorage.getItem('buttonClicked');

    // 버튼이 클릭되지 않은 경우에만 버튼 생성
    if (!buttonClicked) {
        // 새로운 버튼 생성 및 스타일링
        const newButton = document.createElement('button');
        newButton.innerText = 'Click All Target Buttons';
        newButton.style.position = 'fixed';
        newButton.style.top = '10px';
        newButton.style.right = '10px';
        newButton.style.zIndex = 1000;
        newButton.style.padding = '10px';
        newButton.style.backgroundColor = '#4CAF50';
        newButton.style.color = 'white';
        newButton.style.border = 'none';
        newButton.style.borderRadius = '5px';
        newButton.style.cursor = 'pointer';

        // 버튼 클릭 핸들러
        newButton.addEventListener('click', function() {
            // 모든 버튼을 선택하여 반복
            document.querySelectorAll('button').forEach(function(button) {
                // 버튼의 부모 요소에 특정 클래스가 있는지 확인
                if (button.closest('div.absolute.inset-x-1.bottom-1.flex.items-center.justify-between.gap-1')) {
                    button.click(); // 버튼 클릭
                }
            });

            // 버튼 클릭 상태 저장
            localStorage.setItem('buttonClicked', 'true');

            // 0.5초 후 페이지 새로고침
            setTimeout(function() {
                location.reload();
            }, 500);
        });

        // 페이지에 새로운 버튼 추가
        document.body.appendChild(newButton);
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址