Kirka.io ESP Script

ESP script for kirka.io to highlight enemies with a line above them. Press F4 to toggle.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Kirka.io ESP Script
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  ESP script for kirka.io to highlight enemies with a line above them. Press F4 to toggle.
// @author       ChatGPT
// @match        https://kirka.io/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let scriptEnabled = true; // Variável para controlar se o script está ativado ou não
    let intervalId; // Variável para armazenar o ID do intervalo

    // CSS para estilizar a linha sobre os inimigos
    let style = document.createElement('style');
    style.innerHTML = `
        .enemy-line {
            position: absolute;
            width: 100%;
            height: 1px;
            background-color: red; /* Cor da linha */
            pointer-events: none; /* Garante que a linha não interfere com os cliques */
            z-index: 999; /* Coloca a linha acima de outros elementos */
        }
    `;
    document.head.appendChild(style);

    // Função para adicionar a linha sobre os inimigos
    function addEnemyLines() {
        let enemies = document.querySelectorAll('.enemy'); // Classe que representa os inimigos

        enemies.forEach(enemy => {
            let enemyRect = enemy.getBoundingClientRect();
            let line = document.createElement('div');
            line.className = 'enemy-line';
            line.style.top = `${enemyRect.top}px`; // Posiciona a linha acima do inimigo
            document.body.appendChild(line);
        });
    }

    // Função para iniciar o intervalo de atualização das linhas
    function startScript() {
        intervalId = setInterval(() => {
            if (scriptEnabled) {
                // Remove linhas antigas antes de adicionar novas
                let existingLines = document.querySelectorAll('.enemy-line');
                existingLines.forEach(line => line.remove());

                // Adiciona novas linhas
                addEnemyLines();
            }
        }, 1000); // Atualiza a cada segundo (1000 milissegundos)
    }

    // Função para parar o intervalo de atualização das linhas
    function stopScript() {
        clearInterval(intervalId);
        let existingLines = document.querySelectorAll('.enemy-line');
        existingLines.forEach(line => line.remove());
    }

    // Função para alternar entre ligar e desligar o script
    function toggleScript() {
        scriptEnabled = !scriptEnabled;
        if (scriptEnabled) {
            startScript();
        } else {
            stopScript();
        }
    }

    // Evento para capturar a tecla F4
    document.addEventListener('keydown', function(event) {
        if (event.key === 'F4') {
            toggleScript();
        }
    });

    // Inicia o script quando a página carregar
    startScript();

    // Cria uma tabela no canto superior esquerdo para mostrar as instruções
    let table = document.createElement('table');
    table.style.position = 'fixed';
    table.style.top = '10px';
    table.style.left = '10px';
    table.style.background = 'rgba(255, 255, 255, 0.5)';
    table.style.padding = '10px';
    table.style.borderRadius = '5px';
    table.innerHTML = `
        <tr>
            <td colspan="2" style="text-align: center; font-weight: bold;">Controles do Script</td>
        </tr>
        <tr>
            <td>Ativar/Desativar Script</td>
            <td>F4</td>
        </tr>
    `;
    document.body.appendChild(table);

})();