[Brick-Kill] Clan Botter

Bots a clan by joining it several times.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// discord.gg/JjszyaD63A

// ==UserScript==
// @name         [Brick-Kill] Clan Botter
// @version      3.1
// @description  Bots a clan by joining it several times.
// @match        *://www.brick-hill.com/*
// @run-at       document-idle
// @icon         https://www.brick-hill.com/favicon.ico
// @license      MIT
// @namespace    bhclanbotter
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';

    /*-    SETTINGS    -*/

    const clanId = 8434 // The id of the clan you want to target.

    const Mode = "Ambush" // Ambush or Repeat.

    // 'Ambush' will join a clan several times at once when you join. Can join 5-10 times at random. If you can't set a clan to "Join pending", use this.
    const Ambush_amount = 11 // Number of times to send joinClan in Ambush mode.

    // 'Repeat' will join a clan once repeatedly over time. Has no limit compared to Ambush. Recommended for a clan that has "Join pending", and you can accept the invites.
    const Repeat_interval = 500 // Number of times to send joinClan in Ambush mode. Recommended to at most 300ms so you don't get rate limited.

    /*-                -*/




    const token = document.querySelector('input[name="_token"]').value;
    const params = new URLSearchParams();
    params.append('clan_id', clanId + 0.25);
    params.append('_token', token);

    const headers = {
        "Content-Type": "application/x-www-form-urlencoded"
    };

    function joinClan() {
        return fetch("https://www.brick-hill.com/clan/join", {
            method: "POST",
            headers: headers,
            body: params.toString()
        })
            .then(response => {
            if (!response.ok) {
                throw new Error('Network response was not ok');
            }
            return response.text();
        })
            .catch(error => {
            throw new Error('Error joining clan:', error);
        });
    }

    if (Mode === "Ambush") {
        Promise.all(Array.from({ length: Ambush_amount }, joinClan))
            .catch(error => {
            throw new Error('One or more requests failed:', error);
        });
    } else if (Mode === "Repeat") {
        setInterval(joinClan, Repeat_interval);
    }
})();