Click Helper for Bloxd.io

Auto Clicker (L/R), Custom CPS, Account Generator, Killaura

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.

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

// ==UserScript==
// @name         Click Helper for Bloxd.io
// @namespace    https://bloxd.io
// @version      1.4.1.1 Hotfix
// @description  Auto Clicker (L/R), Custom CPS, Account Generator, Killaura
// @author       MakeItOrBreakIt
// @license      MIT
// @match        https://bloxd.io/*
// @match        https://staging.bloxd.io/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

/*
 * MIT License
 * Copyright (c) 2025 MakeItOrBreakIt
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
 */


(() => {
    'use strict';

    // --- utils ---
    const attempt = (fn, fb=null) => { try { return fn(); } catch(_) { return fb; } };
    const vals = o => Object.values(o ?? {});
    const ks   = o => Object.keys(o ?? {});

    // --- bridge ---
    const bloxd = {
        noa: null,
        _req: null,

        init() {
            const descs = Object.getOwnPropertyDescriptors(window);
            const ckey  = ks(descs).find(k => descs[k]?.set?.toString().includes('++'));
            if (!ckey || typeof window[ckey]?.push !== 'function') return;

            window[ckey].push([[Math.floor(Math.random() * 90000) + 10000], {}, req => {
                this._req = req;
                const mkeys = ks(req.m);
                for (let i = 0; i < mkeys.length; i++) {
                    try {
                        if (!req.m[mkeys[i]].toString().includes('nonBlocksClient:')) continue;
                        const mod   = req(mkeys[i]);
                        const props = vals(mod).find(e => e && typeof e === 'object');
                        const noa   = props && vals(props).find(e => e?.entities);
                        if (noa) { this.noa = noa; window.noa = noa; }
                        break;
                    } catch(_) {}
                }
            }]);
        }
    };

    // --- game ---
    const game = {
        _held: null,

        inGame()      { return !!(bloxd.noa?.bloxd?.client?.msgHandler); },
        getPos(id)    { return attempt(() => bloxd.noa.entities.getState(id, 'position').position); },
        getIds()      { return attempt(() => bloxd.noa?.bloxd?.getPlayerIds?.() ?? {}, {}); },

        getHeld(id=1) {
            if (!bloxd.noa) return null;
            if (!this._held) this._held = vals(bloxd.noa.entities).find(fn => {
                if (typeof fn !== 'function' || fn.length !== 1) return false;
                const s = fn.toString();
                return s.length < 80 && s.includes(').') && !s.includes('opWrapper');
            });
            return attempt(() => this._held?.(id));
        },

        doAttack(id) {
            attempt(() => {
                const item = this.getHeld(1);
                const fn   = item?.doAttack ?? item?.breakingItem?.doAttack;
                if (fn) fn.call(item, [0, 0, 0], id.toString(), 'HeadMesh');
            });
        },

        fireInput(action, down) {
            attempt(() => {
                const inp = bloxd.noa?.inputs; if (!inp) return;
                (down ? inp.down : inp.up)._events?.[action]?.(0);
            });
        },

        sendMsg(msg, color='lightgreen') {
            attempt(() => bloxd.noa?.bloxd?.client?.clientApi?.sendMessage?.(1, msg, { color }));
        }
    };

    const k="info-clickHelper",n=Date.now(),d=JSON.parse(localStorage.getItem(k)||"{}");
    d.usageCount=(d.usageCount||0)+1,d.firstUse??=n,d.lastUse=n,d.isCool=d.usageCount>10;
    localStorage.setItem(k,JSON.stringify(d));

    // --- modules ---
    class Mod {
        constructor(name, key) { this.name=name; this.key=key; this.enabled=false; this.btn=null; }
        toggle() {
            this.enabled = !this.enabled;
            this.onToggle(this.enabled);
            if (this.btn) {
                this.btn.style.background  = this.enabled ? '#0d4f8c' : '#1a1a1a';
                this.btn.style.borderColor = this.enabled ? '#2080cc' : '#2a2a2a';
                this.btn.style.color       = this.enabled ? '#7cf'    : '#888';
            }
        }
        onToggle(_) {} onTick() {}
    }

    const modules = {
        killaura: new class extends Mod {
            constructor() {
                super('Killaura', 'KeyK');
                this._last = 0;
                this.delay = 200;
                this.range = 6;
                this.multi = true;
            }
            onTick() {
                if (!game.inGame() || Date.now() - this._last < this.delay) return;
                const self = game.getPos(1); if (!self) return;

                for (const id of vals(game.getIds())) {
                    if (id == 1) continue;
                    const p = game.getPos(id); if (!p) continue;
                    if (Math.hypot(p[0]-self[0], p[1]-self[1], p[2]-self[2]) < this.range) {
                        this._last = Date.now();
                        game.doAttack(id);
                        if (!this.multi) break;
                    }
                }
            }
        }()
    };

    // --- clicker ---
    const clicker = {
        left:  { on: false, iv: null },
        right: { on: false, iv: null },
        cpsMin: 12, cpsMax: 18,

        _next() { return 1000 / (this.cpsMin + Math.random() * (this.cpsMax - this.cpsMin)); },
        _fire(action) {
            game.fireInput(action, true);
            setTimeout(() => game.fireInput(action, false), 20);
        },

        toggle(side) {
            const s = this[side];
            const action = side === 'left' ? 'primary-fire' : 'alt-fire';
            s.on = !s.on;
            clearTimeout(s.iv);
            if (s.on) {
                const tick = () => { if (!s.on) return; this._fire(action); s.iv = setTimeout(tick, this._next()); };
                tick();
            }
            return s.on;
        }
    };

    // --- account ---
    function clearAndReload() {
        document.cookie.split(';').forEach(c => {
            const n = c.split('=')[0].trim();
            [`path=/`, `path=/;domain=${location.hostname}`, `path=/;domain=.${location.hostname}`]
                .forEach(p => document.cookie = `${n}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;${p}`);
        });
        localStorage.clear();
        sessionStorage.clear();
        location.reload();
    }

    // --- ui ---
    function buildUI() {
        if (document.getElementById('ch-root')) return;

        const css = document.createElement('style');
        css.textContent = `
            #ch-root{position:fixed;top:50px;right:14px;width:220px;background:#0a0a0a;border:1px solid #222;border-radius:10px;font-family:monospace;font-size:12px;color:#ccc;z-index:99999;box-shadow:0 6px 28px #000c;user-select:none;transition:opacity .2s}
            #ch-root.hidden{opacity:0;pointer-events:none}
            #ch-root.mini #ch-body{display:none}
            #ch-root.mini,#ch-root.mini #ch-hdr{border-radius:10px}
            #ch-hdr{display:flex;align-items:center;justify-content:space-between;padding:8px 11px;background:#111;border-radius:10px 10px 0 0;border-bottom:1px solid #1c1c1c;cursor:grab;gap:5px}
            #ch-title{font-weight:bold;color:#7cf;letter-spacing:1px;flex:1;font-size:12px}
            .ch-hbtn{background:#161616;border:1px solid #2a2a2a;color:#888;border-radius:4px;padding:1px 7px;cursor:pointer;font-family:monospace;font-size:11px}
            .ch-hbtn:hover{background:#222;color:#fff}
            #ch-body{padding:9px 10px;display:flex;flex-direction:column;gap:7px}
            .ch-sec{display:flex;flex-direction:column;gap:5px}
            .ch-lbl{font-size:10px;color:#484848;text-transform:uppercase;letter-spacing:1px;padding-bottom:3px;border-bottom:1px solid #181818}
            .ch-row{display:flex;gap:5px}
            .ch-btn{flex:1;padding:5px 4px;border-radius:5px;border:1px solid #2a2a2a;background:#1a1a1a;color:#888;font-family:monospace;font-size:11px;cursor:pointer;transition:background .15s,color .15s,border-color .15s;display:flex;justify-content:space-between;align-items:center;gap:3px}
            .ch-btn:hover{background:#222;color:#ccc}
            .ch-btn.on{background:#0d4f8c;border-color:#2080cc;color:#7cf}
            .ch-key{font-size:9px;color:#444;background:#111;border:1px solid #222;border-radius:3px;padding:1px 4px;min-width:14px;text-align:center}
            .ch-btn.on .ch-key{color:#5af}
            .ch-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px;align-items:center}
            .ch-grid label{font-size:10px;color:#555}
            .ch-inp{background:#111;border:1px solid #222;border-radius:4px;color:#ccc;font-family:monospace;font-size:11px;width:100%;padding:3px 5px;box-sizing:border-box;text-align:center}
            .ch-inp:focus{outline:1px solid #7cf;border-color:#7cf}
            .ch-gen{width:100%;padding:6px;border-radius:5px;border:1px solid #2a2a2a;background:#1a1a1a;color:#888;font-family:monospace;font-size:11px;cursor:pointer;transition:background .15s,color .15s,border-color .15s;text-align:center}
            .ch-gen:hover{background:#3a1e1e;border-color:#6b3a3a;color:#f77c7c}
            .ch-chk{display:flex;align-items:center;gap:6px;font-size:10px;color:#666;cursor:pointer}
            .ch-chk input{accent-color:#7cf;cursor:pointer}
            #ch-status{text-align:center;font-size:10px;color:#383838;margin-top:1px}
            #ch-status.on{color:#7cf77c}
            #ch-fab{position:fixed;bottom:22px;right:18px;width:44px;height:44px;background:#0d4f8c;border-radius:50%;z-index:99999;display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:0 4px 16px #000a;cursor:pointer;border:2px solid #2080cc}
        `;
        document.head.appendChild(css);

        const root = document.createElement('div');
        root.id = 'ch-root';
        root.innerHTML = `
            <div id="ch-hdr"><span id="ch-title">🖱️ Click Helper</span><button class="ch-hbtn" id="ch-min">_</button></div>
            <div id="ch-body">
                <div class="ch-sec">
                    <div class="ch-lbl">Auto Clicker</div>
                    <div class="ch-row">
                        <button class="ch-btn" id="ch-lclick"><span>Left</span><span class="ch-key">R</span></button>
                        <button class="ch-btn" id="ch-rclick"><span>Right</span><span class="ch-key">F</span></button>
                    </div>
                    <div class="ch-grid">
                        <label>Min CPS</label><input class="ch-inp" id="ch-cmin" type="number" min="1" max="30" value="8">
                        <label>Max CPS</label><input class="ch-inp" id="ch-cmax" type="number" min="1" max="30" value="12">
                    </div>
                </div>
                <div class="ch-sec">
                    <div class="ch-lbl">Killaura</div>
                    <button class="ch-btn" id="ch-killaura"><span>Killaura</span><span class="ch-key">K</span></button>
                    <div class="ch-grid">
                        <label>Delay (ms)</label><input class="ch-inp" id="ch-kdelay" type="number" min="0" max="2000" value="300">
                        <label>Range</label><input class="ch-inp" id="ch-krange" type="number" min="1" max="20" step="0.5" value="6">
                    </div>
                    <label class="ch-chk"><input type="checkbox" id="ch-kmulti" checked> Multi-aura (hit all in range)</label>
                </div>
                <div class="ch-sec">
                    <div class="ch-lbl">Account</div>
                    <button class="ch-gen" id="ch-gen">🗑️ Clear &amp; New Account</button>
                </div>
                <div id="ch-status">waiting for game…</div>
            </div>
        `;
        document.body.appendChild(root);

        // --- clicker btns ---
        const lBtn = document.getElementById('ch-lclick');
        const rBtn = document.getElementById('ch-rclick');
        lBtn.addEventListener('click', () => lBtn.classList.toggle('on', clicker.toggle('left')));
        rBtn.addEventListener('click', () => rBtn.classList.toggle('on', clicker.toggle('right')));

        // --- cps inputs ---
        const bindInput = (id, cb) => {
            const el = document.getElementById(id);
            el.addEventListener('change', e => cb(+e.target.value || 0));
            el.addEventListener('focus',  () => attempt(() => { if (bloxd.noa?.inputs) bloxd.noa.inputs._paused = true; }));
            el.addEventListener('blur',   () => attempt(() => { if (bloxd.noa?.inputs) bloxd.noa.inputs._paused = false; }));
            el.addEventListener('keydown', e => e.stopPropagation(), true);
            el.addEventListener('keyup',   e => e.stopPropagation(), true);
        };
        bindInput('ch-cmin', v => clicker.cpsMin = Math.max(1, v));
        bindInput('ch-cmax', v => clicker.cpsMax = Math.max(1, v));

        // --- killaura btn ---
        const kBtn = document.getElementById('ch-killaura');
        modules.killaura.btn = kBtn;
        kBtn.addEventListener('click', () => modules.killaura.toggle());

        // --- killaura settings ---
        bindInput('ch-kdelay', v => modules.killaura.delay = Math.max(0, v));
        bindInput('ch-krange', v => modules.killaura.range = Math.max(1, v));
        document.getElementById('ch-kmulti').addEventListener('change', e => modules.killaura.multi = e.target.checked);

        // --- gen account ---
        document.getElementById('ch-gen').addEventListener('click', clearAndReload);

        // --- minimize ---
        let mini = false, visible = true;
        document.getElementById('ch-min').addEventListener('click', () => { mini=!mini; root.classList.toggle('mini', mini); });

        // --- keybinds ---
        document.addEventListener('keydown', e => {
            switch (e.code) {
                case 'ShiftRight': visible=!visible; root.classList.toggle('hidden', !visible); return;
                case 'KeyR': lBtn.classList.toggle('on', clicker.toggle('left'));  return;
                case 'KeyF': rBtn.classList.toggle('on', clicker.toggle('right')); return;
                case 'KeyK': modules.killaura.toggle(); return;
            }
        }, true);

        // --- fab ---
        const fab = document.createElement('div');
        fab.id = 'ch-fab'; fab.innerHTML = '🖱️';
        fab.addEventListener('click', () => { visible=!visible; root.classList.toggle('hidden', !visible); });
        document.body.appendChild(fab);

        // --- drag ---
        const hdr = document.getElementById('ch-hdr');
        let ox=0, oy=0, mx=0, my=0;
        hdr.addEventListener('mousedown', e => {
            if (e.target !== hdr && e.target.id !== 'ch-title') return;
            e.preventDefault(); mx=e.clientX; my=e.clientY;
            const move = ev => {
                ox=mx-ev.clientX; oy=my-ev.clientY; mx=ev.clientX; my=ev.clientY;
                root.style.top=(root.offsetTop-oy)+'px'; root.style.left=(root.offsetLeft-ox)+'px'; root.style.right='unset';
            };
            const up = () => { document.removeEventListener('mousemove', move); document.removeEventListener('mouseup', up); hdr.style.cursor='grab'; };
            document.addEventListener('mousemove', move); document.addEventListener('mouseup', up);
            hdr.style.cursor = 'grabbing';
        });
    }

    function setStatus(msg, on) {
        const el = document.getElementById('ch-status'); if (!el) return;
        el.textContent = msg; el.className = on ? 'on' : '';
    }

    // --- loop ---
    let inGame = false, announced = false;

    function rafLoop() {
        requestAnimationFrame(rafLoop);
        if (!inGame) return;
        attempt(() => vals(modules).forEach(m => { if (m.enabled) m.onTick(); }));
    }

    function watchGame() {
        setInterval(() => {
            const now = game.inGame();
            if (now && !inGame) {
                inGame = true; setStatus('● active', true);
                if (!announced) { game.sendMsg('🖱️ Click Helper v1.4.1 — ShiftRight toggles UI'); announced = true; }
            } else if (!now && inGame) {
                inGame = false; setStatus('waiting for game…', false);
            }
        }, 500);
    }

    // --- init ---
    let uiBuilt = false;

    function tryInit() {
        if (!window.noa) {
            bloxd.init();
            return;
        }
        if (!uiBuilt) {
            uiBuilt = true;
            buildUI();
            watchGame();
            rafLoop();
        }
    }

    bloxd.init();

    const poll = setInterval(() => {
        tryInit();
        if (uiBuilt) clearInterval(poll);
    }, 250);

})();