My First Multi-Player Radar

Scans and logs multiple players simultaneously using engine components

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         My First Multi-Player Radar
// @namespace    http://tampermonkey.net
// @version      1.1
// @description  Scans and logs multiple players simultaneously using engine components
// @author       You
// @match        *://*.bloxd.io/*
// @match        *://*.bloxdhop.io/*
// @match        *://*://*
// @run-at       document-body
// @grant        none
// ==/UserScript==


(function() {
    'use strict';

    let savedEngine = null;

    // 1. THE ANTENNA: Hook into the game's loading files to grab the engine
    Object.defineProperty(Function.prototype, 'call', {
        enumerable: false,
        configurable: true,
        writable: true,
        value: function (thisArg, ...args) {
            const core = args[0];
            // If we catch a piece of code containing 'entities' and 'bloxd', save it!
            if (core && core.entities && core.bloxd) {
                savedEngine = core;
                console.log("Successfully hooked into the Bloxd engine!");
            }
            return Function.prototype.call.apply(this, [thisArg, ...args]);
        }
    });

    // 2. THE MULTI-TARGET MONITOR LOOP
    setInterval(() => {
        if (!savedEngine) return;

        // Fetch your own position (You are always ID 1)
        let pos = savedEngine.entities.getState(1, "position")?.position;
        if (!pos) return;

        // DYNAMIC SCANNER: Extract a fresh list of EVERY entity currently loaded around you
        let allPlayerIds = Object.keys(savedEngine.entities.components.position);

        // This loop automatically repeats your distance math for every single active ID found
        allPlayerIds.forEach(id => {
            if (id == "1") return; // Skip yourself to prevent self-targeting

            // Fetch the current loop player's coordinate array dynamically
            let enemypos = savedEngine.entities.getState(id, "position")?.position;
            if (!enemypos) return;

            // FIXED VECTOR MATH: Subtracting individual elements keeps the calculations stable
            let dx = pos[0] - enemypos[0];
            let dy = pos[1] - enemypos[1];
            let dz = pos[2] - enemypos[2];
            let distance = Math.sqrt(dx*dx + dy*dy + dz*dz);

            // Execute the action block if this specific player is within range
            if (distance <= 6.0) {
                console.log(`attack ID: ${id} | Distance: ${distance.toFixed(2)}`);
            }
        });
    }, 100);

})();