Auto Vote

Deletes account, logs back in via Roblox, loops

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 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);
    });
}
})();