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 提交的版本,檢視 最新版本

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

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

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

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

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