Auto Vote

Deletes account, logs back in via Roblox, loops

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

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

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

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

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

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

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

Advertisement:

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

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

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

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

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

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

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

Advertisement:

// ==UserScript==
// @name         Auto Vote
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Deletes account, logs back in via Roblox, loops
// @match        *://gag.gg/*
// @match        *://authorize.roblox.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
    'use strict';

    const url = window.location.href;

    // ─── PAGE 1: Main gag.gg page — expand section and click delete ───
    if (url.includes('gag.gg') && !url.includes('deleted=1')) {

        window.confirm = () => true;

        let loop;

        function run() {
            const header = document.querySelector('button.pf__collapse-head[data-pf-collapse]');

            if (!header) {
                console.warn('[AutoDelete] Header not found');
                clearInterval(loop);
                return;
            }

            if (header.getAttribute('aria-expanded') === 'false') {
                header.click();
                console.log('[AutoDelete] Opened collapse section');
            }

            setTimeout(() => {
                const deleteBtn = document.querySelector('button.pf__btn.pf__btn--ghost[data-pf-delete]');

                if (deleteBtn) {
                    deleteBtn.click();
                    console.log('[AutoDelete] Clicked delete button');
                } else {
                    console.warn('[AutoDelete] Delete button not found');
                    clearInterval(loop);
                }
            }, 600);
        }

        window.addEventListener('load', () => {
            setTimeout(() => {
                loop = setInterval(run, 3000);
            }, 1500);
        });
    }

    // ─── PAGE 2: Redirected to gag.gg/?deleted=1 — click Roblox login ───
    if (url.includes('gag.gg') && url.includes('deleted=1')) {

        window.addEventListener('load', () => {
            setTimeout(() => {
                const loginBtn = document.querySelector('a.rbxauth__signin[data-rbxauth-signin]');

                if (loginBtn) {
                    loginBtn.click();
                    console.log('[AutoDelete] Clicked Roblox login button');
                } else {
                    console.warn('[AutoDelete] Roblox login button not found');
                }
            }, 1500);
        });
    }

    // ─── PAGE 3: Roblox authorize page — click Continue ───
    if (url.includes('authorize.roblox.com')) {

        window.addEventListener('load', () => {
            setTimeout(() => {
                // Match by text content since the class names are auto-generated and may change
                const continueBtn = [...document.querySelectorAll('button')]
                    .find(btn => btn.textContent.trim() === 'Continue');

                if (continueBtn) {
                    continueBtn.click();
                    console.log('[AutoDelete] Clicked Continue on Roblox auth page');
                } else {
                    console.warn('[AutoDelete] Continue button not found');
                }
            }, 2000); // slightly longer wait for Roblox page to fully render
        });
    }
// ─── PAGE 4: Roblox permissionRequest step — wait for timer then confirm ───
if (url.includes('authorize.roblox.com')) {
    const observer = new MutationObserver(() => {
        if (window.location.href.includes('step=permissionRequest')) {
            observer.disconnect();
            const poller = setInterval(() => {
                const confirmBtn = [...document.querySelectorAll('button')]
                    .find(btn => btn.textContent.trim() === 'Confirm and Give Access');
                if (confirmBtn) {
                    confirmBtn.click();
                    console.log('[AutoDelete] Clicked confirm on permissionRequest');
                    clearInterval(poller);
                }
            }, 500);
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
}

// ─── PAGE 5: gag.gg/?signed_in=1 — click Vote ───
if (url.includes('gag.gg') && url.includes('signed_in=1')) {

    window.addEventListener('load', () => {
        setTimeout(() => {
            const voteBtn = document.querySelector('a.launch__vote[data-launch-vote]');

            if (voteBtn) {
                voteBtn.click();
                console.log('[AutoDelete] Clicked Vote button');
            } else {
                console.warn('[AutoDelete] Vote button not found');
            }
        }, 1500);
    });
}
/// ─── PAGE 6: gag.gg/vote/ — click heart button 20 times ───
if (url.includes('gag.gg/vote')) {
    let clickCount = 0;
    const maxClicks = 20;
    window.addEventListener('load', () => {
        setTimeout(() => {
            const poller = setInterval(() => {
                if (clickCount >= maxClicks) {
                    clearInterval(poller);
                    console.log('[AutoDelete] Done — clicked heart 20 times');
                    window.location.href = 'https://gag.gg/profile/';
                    return;
                }
                const heartBtn = document.querySelector('button.swipe__btn.swipe__btn--like[data-swipe-like]');
                if (heartBtn) {
                    heartBtn.click();
                    clickCount++;
                    console.log(`[AutoDelete] Clicked heart #${clickCount}`);
                }
            }, 1500);
        }, 2000);
    });
}
})();