Tribals.io Green ESP (Fixed)

AHAHA AAMAKKAMAKMAKAMAK

لا ينبغي أن لا يتم تثبيت هذا السكريت مباشرة. هو مكتبة لسكبتات لتشمل مع التوجيه الفوقية // @require https://update.greatest.deepsurf.us/scripts/573806/1798328/Tribalsio%20Green%20ESP%20%28Fixed%29.js

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!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Tribals.io Green ESP (Fixed)
// @namespace    http://tampermonkey.net/
// @match        https://tribals.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tribals.io
// @require      https://code.jquery.com/jquery-3.7.0.min.js
// @grant        none
// @run-at       document-start
// ==/UserScript==

console.log('[EVENT] Green ESP Loaded');

// UI + Yeşil Tema
const tribalsCheatHTML = `
<div id="tribals-esp-status">
    ESP: <span id="esp" class="esp-state">Disabled</span>
</div>
<style>
#tribals-esp-status {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff44;
    color: #00ff44;
    font-family: monospace;
    font-size: 16px;
    border-radius: 6px;
    z-index: 9999;
    user-select: none;
    pointer-events: none;
    box-shadow: 0 0 10px #00ff44;
}
.esp-state { font-weight: bold; }
</style>`;

document.addEventListener('DOMContentLoaded', () => {
    $('body').append(tribalsCheatHTML);

    document.addEventListener('keypress', e => {
        if (e.key === '-') {
            toggleESP();
        }
    });
});

window.tribals = {
    players: [],
    localPlayer: {},
    espDelay: 10 // Performans için hafif artırıldı
};

const sym = Symbol('Local Player Hook');

Object.defineProperty(Object.prototype, 'isSleeping', {
    set(data) {
        this[sym] = data;
        if (this.protected) {
            window.tribals.localPlayer = this;
        }
        if (this.username !== undefined) {
            window.tribals.players.unshift({
                username: this.username,
                obj: this,
                lastPosition: { ...this.entity.position },
                lastMoveTime: Date.now()
            });
        }
    },
    get() { return this[sym]; }
});

window.getAllPlayers = function () {
    const uniquePlayers = [];
    const seen = new Set();
    window.tribals.players.forEach(plr => {
        if (!seen.has(plr.username)) {
            seen.add(plr.username);
            uniquePlayers.push(plr);
        }
    });
    return uniquePlayers;
};

let espEnabled = false;
let espInterval;

window.toggleESP = function () {
    espEnabled = !espEnabled;
    const espSpan = document.getElementById('esp');
    if (espSpan) {
        espSpan.textContent = espEnabled ? 'Enabled' : 'Disabled';
        espSpan.style.color = espEnabled ? '#00ff44' : '#ff4444';
    }

    if (espEnabled) {
        const espCanvas = document.createElement('canvas');
        espCanvas.id = 'espCanvas';
        espCanvas.style = "position:absolute; top:0; left:0; z-index:2147483647; pointer-events:none;";
        document.body.appendChild(espCanvas);
        const ctx = espCanvas.getContext('2d');

        espInterval = setInterval(() => {
            espCanvas.width = window.innerWidth;
            espCanvas.height = window.innerHeight;
            ctx.clearRect(0, 0, espCanvas.width, espCanvas.height);

            window.getAllPlayers().forEach(plr => {
                const curr = plr.obj.entity.position;
                if (!curr || !window.tribals.localPlayer.cameraEntity) return;

                const screenPos = window.tribals.localPlayer.cameraEntity.camera.worldToScreen(curr.clone());

                // Ekranın içindeyse çiz (Z >= 1 kontrolü)
                if (screenPos.z >= 1.0) {
                    const scale = 4 / screenPos.z;
                    const width = 60 * scale;
                    const height = 150 * scale;
                    const x = screenPos.x - width / 2;
                    const y = screenPos.y - height / 2;

                    // YEŞİL KUTU
                    ctx.strokeStyle = '#00ff44';
                    ctx.lineWidth = 2;
                    ctx.strokeRect(x, y, width, height);

                    // YEŞİL İSİM
                    ctx.font = 'bold 14px Arial';
                    ctx.fillStyle = '#00ff44';
                    ctx.textAlign = 'center';
                    ctx.fillText(plr.username, screenPos.x, y - 10);
                }
            });
        }, window.tribals.espDelay);
    } else {
        clearInterval(espInterval);
        const canvas = document.getElementById('espCanvas');
        if (canvas) canvas.remove();
    }
};