Cartel Empire - Quick Refills/Resets

Adds buttons to pages to allow you to quick use point refills and resets without being on the donator page

当前为 2025-04-04 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Cartel Empire - Quick Refills/Resets
// @namespace    baccy.ce
// @version      0.1
// @description  Adds buttons to pages to allow you to quick use point refills and resets without being on the donator page
// @author       Baccy
// @match        https://cartelempire.online/*
// @icon         https://cartelempire.online/images/icon-white.png
// @grant        none
// @license      MIT
// ==/UserScript==
(function() {
    'use strict';

    let title = null;
    let url;
    let header = 1;

    switch (location.pathname) {
        case '/PetShop':
            title = 'Reset Pets';
            url = 'https://cartelempire.online/Donator/ResetPetShop';
            break;
        case '/Town/Club':
            title = 'Reset Sicarios';
            url = 'https://cartelempire.online/Donator/ResetClubRecruitment';
            break;
        case '/Casino/Blackjack':
            title = 'Refill Tokens';
            url = 'https://cartelempire.online/Donator/ResetTokens';
            break;
        case '/Casino/Spinner':
            title = 'Refill Tokens';
            url = 'https://cartelempire.online/Donator/ResetTokens';
            break;
        case '/Casino/Slots':
            title = 'Refill Tokens';
            url = 'https://cartelempire.online/Donator/ResetTokens';
            break;
        case '/Casino/Lottery':
            title = 'Refill Tokens';
            url = 'https://cartelempire.online/Donator/ResetTokens';
            header = 3;
            break;
        case '/Gym':
            title = 'Refill Energy';
            url = 'https://cartelempire.online/Donator/Refill/Energy';
            header = 0;
            break;
        case '/University':
            title = 'Refill Energy';
            url = 'https://cartelempire.online/Donator/Refill/Energy';
            header = 0;
            break;
        case '/Hospital':
            title = 'Refill Life';
            url = 'https://cartelempire.online/Donator/Refill/Life';
            header = 0;
            break;
        default:
            break;
    }

    if (title !== null) {
        const headers = document.querySelectorAll('.header-section');
        if (headers[header]) {
            headers[header].style.cssText = 'display: flex; justify-content: space-between;';
            const button = document.createElement('button');
            button.textContent = title;
            button.style.cssText = 'background: #1e1e1e; color: #fff; border: 1px solid #555; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-size: 14px;';
            button.addEventListener('click', async () => {
                const response = await fetch(url, { method: 'POST' });
                if (response.ok) window.location.reload();
            });
            headers[header].appendChild(button);
        }
    }
})();