Greasy Fork is available in English.

Capybara Clicker

inf click, inf upgrades

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name         Capybara Clicker
// @namespace    http://tampermonkey.net/
// @version      4.3
// @description  inf click, inf upgrades
// @author       Gemini
// @match        https://capybara-game.com/
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // 1. Storage Keys Helper
    const UPGRADE_KEYS = [
        'upgrade_1', 'upgrade_2', 'upgrade_3', 'upgrade_4', 'upgrade_5', 
        'upgrade_6', 'upgrade_7', 'upgrade_8', 'upgrade_9', 'upgrade_10',
        'upg_1', 'upg_2', 'upg_3', 'upg_4', 'upg_5', 'upg_6', 'upg_7', 'upg_8'
    ];

    // Read existing storage or provide reasonable defaults if empty
    let currentLevel = localStorage.getItem('upgrade_1') || '999';
    let currentCash = localStorage.getItem('number_capybaras') || '100000000000';
    let currentClicks = localStorage.getItem('number_click') || '1000';

    // 2. LocalStorage Interceptor Engine
    const originalGetItem = Storage.prototype.getItem;
    const originalSetItem = Storage.prototype.setItem;

    Storage.prototype.getItem = function(key) {
        // Intercept values live as the game requests them
        if (key === 'number_capybaras') return originalGetItem.call(localStorage, 'number_capybaras') || currentCash;
        if (key === 'capyparas_earned') return originalGetItem.call(localStorage, 'capyparas_earned') || currentCash;
        if (key === 'number_click') return originalGetItem.call(localStorage, 'number_click') || currentClicks;

        // Auto unlock achievements and skins
        if (key.startsWith('achiev_') || key.startsWith('skin_')) {
            return '1';
        }

        // Target upgrades via wildcard search
        if (key.toLowerCase().includes('upgrade') || key.toLowerCase().includes('upg')) {
            return originalGetItem.call(localStorage, 'upgrade_1') || currentLevel;
        }

        return originalGetItem.apply(this, arguments);
    };

    Storage.prototype.setItem = function(key, value) {
        return originalSetItem.apply(this, arguments);
    };

    // 3. Inject GUI
    function injectGUI() {
        if (document.getElementById('capy-god-menu')) return;

        const menu = document.createElement('div');
        menu.id = 'capy-god-menu';
        menu.style = `
            position: fixed; top: 15px; left: 15px; width: 280px;
            background: rgba(10, 10, 10, 0.98); color: #fff; font-family: system-ui, -apple-system, sans-serif;
            border: 2px solid #ffcc00; border-radius: 10px; z-index: 10000000;
            box-shadow: 0 0 20px rgba(255, 204, 0, 0.4); font-size: 13px; overflow: hidden;
        `;

        menu.innerHTML = `
            <div id="capy-drag-header" style="background: linear-gradient(90deg, #ffcc00, #ff6600); padding: 12px; cursor: move; font-weight: bold; text-align: center; letter-spacing: 1px; color: #000;">
                👑 OpenSource Capybara Clicker
            </div>
            <div style="padding: 15px; display: flex; flex-direction: column; gap: 12px;">
                
                <div>
                    <label style="display: block; margin-bottom: 4px; color: #ffcc00; font-weight: bold;">All Upgrades Level:</label>
                    <input type="number" id="target-level-input" value="${currentLevel}" style="width: 100%; padding: 6px; background: #222; border: 1px solid #444; color: #fff; border-radius: 4px; font-family: monospace; font-size: 14px; box-sizing: border-box;">
                </div>

                <div>
                    <label style="display: block; margin-bottom: 4px; color: #aaa;">Capybara Balance:</label>
                    <input type="text" id="target-cash-input" value="${currentCash}" style="width: 100%; padding: 6px; background: #222; border: 1px solid #444; color: #fff; border-radius: 4px; font-family: monospace; font-size: 14px; box-sizing: border-box;">
                </div>

                <div>
                    <label style="display: block; margin-bottom: 4px; color: #aaa;">Total Clicks:</label>
                    <input type="number" id="target-clicks-input" value="${currentClicks}" style="width: 100%; padding: 6px; background: #222; border: 1px solid #444; color: #fff; border-radius: 4px; font-family: monospace; font-size: 14px; box-sizing: border-box;">
                </div>

                <button id="btn-apply" style="background: #ffcc00; color: #000; border: none; padding: 10px; border-radius: 4px; cursor: pointer; font-weight: bold; width: 100%; margin-top: 5px; transition: 0.2s;">
                    Apply modifications & Reload
                </button>
            </div>
        `;

        document.body.appendChild(menu);

        const levelInput = document.getElementById('target-level-input');
        const cashInput = document.getElementById('target-cash-input');
        const clicksInput = document.getElementById('target-clicks-input');
        const applyBtn = document.getElementById('btn-apply');

        applyBtn.addEventListener('click', () => {
            const typedLevel = levelInput.value.trim() || "0";
            const typedCash = cashInput.value.trim() || "0";
            const typedClicks = clicksInput.value.trim() || "0";

            localStorage.setItem('number_capybaras', typedCash);
            localStorage.setItem('capyparas_earned', typedCash);
            localStorage.setItem('number_click', typedClicks);

            UPGRADE_KEYS.forEach(k => {
                localStorage.setItem(k, typedLevel);
            });

            window.location.reload();
        });

        // Window Dragging Controls
        let isDragging = false, startX, startY, initialX, initialY;
        const header = document.getElementById('capy-drag-header');
        
        header.addEventListener('mousedown', (e) => {
            isDragging = true;
            startX = e.clientX; startY = e.clientY;
            initialX = menu.offsetLeft; initialY = menu.offsetTop;
        });
        
        document.addEventListener('mousemove', (e) => {
            if (!isDragging) return;
            menu.style.left = (initialX + (e.clientX - startX)) + 'px';
            menu.style.top = (initialY + (e.clientY - startY)) + 'px';
        });
        
        document.addEventListener('mouseup', () => isDragging = false);
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', injectGUI);
    } else {
        injectGUI();
    }
})();