helperPvP2

рп

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         helperPvP2
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  рп
// @author       matrosik (Drik)
// @match        https://cavegame.io/
// @icon https://i.postimg.cc/nLbFxnNg/image.png
// @license MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function changeBackgroundColor() {
        document.body.style.backgroundColor = 'transparent';

        const menu = document.getElementById('craft-modal');
        if (menu) {
            menu.style.backgroundColor = '#FF1493';
            menu.style.color = 'white';
        }

        const elementsToStyle = [
            'buy-item',
            'buy-item-2',
            'sell-step-1',
            'xp-bar'
        ];

        elementsToStyle.forEach(id => {
            const element = document.getElementById(id);
            if (element) {
                element.style.backgroundColor = '#FF1493';
                element.style.color = 'white';
            }
        });

        const headers = document.querySelectorAll('h3');
        headers.forEach(header => {
            header.style.color = 'white';
            header.style.backgroundColor = '#FF1493';
        });

        const shopTabs = document.querySelectorAll('.shop-tab-button');
        shopTabs.forEach(tab => {
            tab.style.backgroundColor = '#FF1493';
        });

        const elementsToRemove = [
            document.querySelector('.view-instructions-container'),
            document.getElementById('bottom-links'),
            document.querySelector('.mini-modal.modal.limited')
        ];

        elementsToRemove.forEach(element => {
            if (element) {
                element.remove();
            }
        });

        createPositionMenu();
    }

    function createPositionMenu() {
        const existingMenu = document.getElementById('player-position-menu');
        if (existingMenu) {
            existingMenu.remove();
        }

        const positionMenu = document.createElement('div');
        positionMenu.id = 'player-position-menu';
        positionMenu.style.position = 'fixed';
        positionMenu.style.top = '10px';
        positionMenu.style.left = '10px';
        positionMenu.style.backgroundColor = '#FF1493';
        positionMenu.style.color = 'white';
        positionMenu.style.padding = '10px';
        positionMenu.style.borderRadius = '8px';
        positionMenu.style.zIndex = '1000';
        positionMenu.style.fontFamily = 'Arial, sans-serif';
        positionMenu.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.5)';

        const title = document.createElement('h3');
        title.innerText = 'press F1 ';
        title.style.margin = '0';
        positionMenu.appendChild(title);

        const positionDisplay = document.createElement('div');
        positionDisplay.id = 'current-position';
        positionDisplay.innerText = 'help координаты: 0, 0';
        positionMenu.appendChild(positionDisplay);

        document.body.appendChild(positionMenu);
        trackPlayerPosition();
    }

    function trackPlayerPosition() {
        const positionElement = document.querySelector('.player-position.no-select');
        const positionDisplay = document.getElementById('current-position');

        if (!positionElement || !positionDisplay) return;

        const updatePosition = () => {
            const positionText = positionElement.innerText;
            positionDisplay.innerText = `Cord: ${positionText}`;
        };

        updatePosition();
        setInterval(updatePosition, 0);

        window.addEventListener("keydown", function(e) {
            if (e.key.toLowerCase() === "f1") {
                e.preventDefault();
                const coordsElem = document.querySelector('.player-position.no-select');
                const chatInput = document.querySelector('#chat-input');
                if (coordsElem && chatInput) {
                    const coords = `(code matrosika) help pls: ${coordsElem.textContent.trim()}`;
                    let tEvent = new KeyboardEvent('keydown', {
                        key: "t",
                        code: "KeyT",
                        keyCode: 84,
                        which: 84,
                        bubbles: true,
                        cancelable: true
                    });
                    document.dispatchEvent(tEvent);

                    setTimeout(() => {
                        chatInput.value = coords;
                        const enterEvent = new KeyboardEvent('keydown', {
                            key: "Enter",
                            code: "Enter",
                            keyCode: 13,
                            which: 13,
                            bubbles: true,
                            cancelable: true
                        });
                        chatInput.dispatchEvent(enterEvent);
                    }, 0);
                }
            }
        });
    }

    window.addEventListener('load', changeBackgroundColor);
})();