Roblox group claimer with auto join, and discord webhooks

Finds unclaimed roblox groups and sends them to a webhook, or auto joins them!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Roblox group claimer with auto join, and discord webhooks
// @namespace    Roblox group claimer
// @version      2
// @description  Finds unclaimed roblox groups and sends them to a webhook, or auto joins them!
// @author       ._._.dustin
// @match        https://roblox.com/*
// @grant        GM_xmlhttpRequest
// @license      MIT
// @contributionURL https://www.buymeacoffee.com/dustin21335
// ==/UserScript==

(function() {
    'use strict';

    const useDiscordWebhook = true; // Set to true if you want to use a discord webhook
    const autoClaim = true; // Set to true if you want to auto claim groups

    const webhookURL = 'DISCORD_WEBHOOK'; // Put discord webhook where DISCORD_WEBHOOK is
    const threads = 5;

    function groupFinder(id) {
        GM_xmlhttpRequest({
            method: 'GET',
            url: `https://www.roblox.com/groups/group.aspx?gid=${id}`,
            onload: function(response) {
                if (response.responseText.includes('owned')) {
                } else {
                    GM_xmlhttpRequest({
                        method: 'GET',
                        url: `https://groups.roblox.com/v1/groups/${id}`,
                        onload: function(groupResponse) {
                            const data = JSON.parse(groupResponse.responseText);
                            if (!groupResponse.responseText.includes('isLocked') && groupResponse.responseText.includes('owner')) {
                                if (data.publicEntryAllowed && data.owner === null) {
                                    console.log(`[+] Hit: ${id}`);
                                    if (useDiscordWebhook) {
                                        sendWebhook(`@everyone Hit: https://www.roblox.com/groups/group.aspx?gid=${id}`);
                                    }
                                    if (autoClaim) {
                                        autoClaimGroup(id);
                                    }
                                }
                            }
                        }
                    });
                }
            }
        });
    }

    function sendWebhook(message) {
        GM_xmlhttpRequest({
            method: 'POST',
            url: webhookURL,
            data: JSON.stringify({ content: message }),
            headers: {
                'Content-Type': 'application/json',
            },
        });
    }

function autoClaimGroup(id) {
    setTimeout(function() {
        window.location.href = `https://www.roblox.com/groups/${id}`;
    }, 1000);
    setTimeout(function() {
        document.getElementById('group-join-button').click();
        document.querySelector('.icon-more').click();
        setTimeout(function() {
            const claimOwnershipBtn = document.querySelector('#claim-ownership button');
            if (claimOwnershipBtn) {
                claimOwnershipBtn.click();
                console.log("Group claimed!");
            } else {
                console.log("Failed to claim :C");
            }
        }, 890);
    }, 2000);
}

    function main() {
        setInterval(() => {
            const ids = Array.from({ length: threads * 2 }, () => Math.floor(Math.random() * (1150000 - 1000000 + 1)) + 1000000);
            ids.forEach(id => groupFinder(id));
        }, 5000);
    }

    main();

})();