Planet Client

This is a Bloxd.io Client!

// ==UserScript==
// @name         Planet Client
// @namespace    http://tampermonkey.net/
// @version      3.2
// @description  This is a Bloxd.io Client!
// @author       Ankit
// @match        https://bloxd.io/
// @icon         https://i.imgur.com/gfZEi7a.png
// @grant        GM_addStyle
// @license      GPLv3
// ==/UserScript==

setInterval(function() {
    'use strict';
    document.title = "Planet Client";
    const maintext = document.querySelector('.Title.FullyFancyText');
    maintext.style.textShadow = "10px 5px 5px #000000";
    maintext.style.webkitTextStroke = "none";
    maintext.style.fontFamily = "'Baloo Paaji 2', cursive"; // Change to Baloo Paaji 2
    document.querySelector('.Title.FullyFancyText').textContent = "Planet Client";
    const background = document.querySelector(".HomeBackground");
    if (background) {
        background.style.backgroundImage = 'url(https://wallpapercrafter.com/desktop/152018-digital-art-space-stars-black-Earth-planet-pixels-pixel-art-pixelated-simple-background-square-minimalism.png)';
    }
    const modifyElements = () => {
        ['LogoContainer', 'cube'].forEach(className => {
            document.querySelectorAll('.' + className).forEach(el => el.remove());
        });
    };
    modifyElements(); // Call the function to remove elements
}, 1000); // Missing closing parenthesis

//CrossHair
setInterval(function() {
    const crosshair = document.querySelector(".CrossHair");
    if (crosshair) {
        crosshair.textContent = "";
        crosshair.style.backgroundImage = "url(https://i.imgur.com/1MnSP24.pngww)";
        crosshair.style.backgroundRepeat = "no-repeat";
        crosshair.style.backgroundSize = "contain";
        crosshair.style.width = "19px";
        crosshair.style.height = "19px";
    }
}, 1);

//Planet Network Overlay
(function() {
    'use strict';
    const fontLink = document.createElement('link');
    fontLink.href = 'https://db.onlinewebfonts.com/c/68c9057f4e4dc415b2648f88526aeea7?family=Reglisse-Fill';
    fontLink.rel = 'stylesheet';

    const text = document.createElement('div');
    text.style.position = "fixed";
    text.style.color = "#fff";
    text.textContent = "Planet Network";
    text.style.top = "75%";
    text.style.left = "50%";
    text.style.zIndex = "10000";
    text.style.fontWeight = "bold";
    text.style.borderRadius = "25px";
    text.style.fontSize = "18px";
    text.style.height = "6vh";
    text.style.display = "flex";
    text.style.paddingTop = "0.1rem";
    text.style.justifyContent = "center";
    text.style.width = "11vw";
    text.style.height = "6vh";
    text.style.transform = "translateX(-50%)";
    text.style.textAlign = "center";
    text.style.lineHeight = "50px";
    text.style.boxShadow = "rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px";
    text.style.backgroundColor = "rgba(0,0,0,.4)";
    text.style.cursor = "pointer";
    text.style.pointerEvents = "none"; // This makes the element click-through

    document.head.appendChild(fontLink);
    document.body.appendChild(text);

    function centerText() {
        text.style.top = "77%";
        text.style.left = "50%";
        text.style.transform = "translate(-50%, -50%)";
    }

    window.addEventListener('resize', centerText);
    centerText();
})();


// Keystrocks\CPS Counter
(function () {
    console.log('Script loaded');

    var container = document.createElement('div');
    container.style.position = 'fixed';
    container.style.bottom = '30px'; // Adjusted position for visibility
    container.style.left = '1188px'; // Adjusted position for visibility
    container.style.backgroundColor = 'transparent';
    container.style.color = 'white';
    container.style.padding = '5px';
    container.style.fontFamily = 'Arial';
    container.style.zIndex = '9999';
    container.style.pointerEvents = 'none'; // Makes the element click-through

    var row1 = document.createElement('div');
    row1.style.display = 'flex';
    row1.style.justifyContent = 'center';

    var upKey = createKeyElement('W');

    var row2 = document.createElement('div');
    row2.style.display = 'flex';
    row2.style.justifyContent = 'center';

    var leftKey = createKeyElement('A');
    var sprintKey = createKeyElement('S');
    var rightKey = createKeyElement('D');

    var row3 = document.createElement('div');
    row3.style.display = 'flex';
    row3.style.justifyContent = 'center';

    var crouchKey = createKeyElement('Ctrl');
    var spaceKey = createKeyElement('Space');

    var row4 = document.createElement('div');
    row4.style.display = 'flex';
    row4.style.justifyContent = 'center';

    var lmbKey = createKeyElement('LEFT');
    var rmbKey = createKeyElement('RIGHT');

    row1.appendChild(upKey);
    row2.appendChild(leftKey);
    row2.appendChild(sprintKey);
    row2.appendChild(rightKey);
    row3.appendChild(crouchKey);
    row3.appendChild(spaceKey);
    row4.appendChild(lmbKey);
    row4.appendChild(rmbKey);
    container.appendChild(row1);
    container.appendChild(row2);
    container.appendChild(row3);
    container.appendChild(row4);

    document.body.appendChild(container);

    console.log('Key elements added to the container');

    function createKeyElement(keyText) {
        var keyElement = document.createElement('div');
        keyElement.style.backgroundColor = 'transparent';
        keyElement.style.color = 'white';
        keyElement.style.padding = '5px';
        keyElement.style.margin = '2px';
        keyElement.style.border = '1px solid white';
        keyElement.style.borderRadius = '2px';
        keyElement.style.fontFamily = 'Arial';
        keyElement.style.fontSize = '20px';
        keyElement.textContent = keyText;
        return keyElement;
    }

    document.addEventListener('keydown', function (event) {
        highlightKey(event.key, 'cyan');
    });

    document.addEventListener('keyup', function (event) {
        highlightKey(event.key, 'transparent');
    });

    document.addEventListener('mousedown', function (event) {
        if (event.button === 0) {
            lmbKey.style.backgroundColor = 'cyan';
            countClick();
        } else if (event.button === 2) {
            rmbKey.style.backgroundColor = 'cyan';
            countRightClick();
        }
    });

    document.addEventListener('mouseup', function (event) {
        if (event.button === 0) {
            lmbKey.style.backgroundColor = 'transparent';
        } else if (event.button === 2) {
            rmbKey.style.backgroundColor = 'transparent';
        }
    });

    function highlightKey(key, color) {
        switch (key) {
            case 'w':
                upKey.style.backgroundColor = color;
                break;
            case 'a':
                leftKey.style.backgroundColor = color;
                break;
            case 's':
                sprintKey.style.backgroundColor = color;
                break;
            case 'd':
                rightKey.style.backgroundColor = color;
                break;
            case 'Control':
                crouchKey.style.backgroundColor = color;
                break;
            case ' ':
                spaceKey.style.backgroundColor = color;
                break;
            default:
                break;
        }
    }

    var clickTimes = [];

    function countClick() {
        var currentTime = new Date().getTime();
        clickTimes.push(currentTime);
        updateCPS();
    }

    function updateCPS() {
        var currentTime = new Date().getTime();
        var oneSecondAgo = currentTime - 1000;
        var count = 0;

        for (var i = clickTimes.length - 1; i >= 0; i--) {
            if (clickTimes[i] >= oneSecondAgo) {
                count++;
            } else {
                break;
            }
        }

        cpsValue.textContent = count;
    }

    function resetClickCount() {
        clickTimes = [];
        updateCPS();
    }

    var cpsButton = document.createElement('div');
    cpsButton.style.position = 'fixed';
    cpsButton.style.bottom = '5px'; // Adjusted position for visibility
    cpsButton.style.left = '1166px'; // Adjusted position for visibility
    cpsButton.style.backgroundColor = 'rgba(0, 0, 0, 0)'; // Added background color for visibility
    cpsButton.style.color = 'white';
    cpsButton.style.padding = '5px';
    cpsButton.style.fontFamily = 'Arial';
    cpsButton.style.fontSize = '14px';
    cpsButton.style.zIndex = '9999';
    cpsButton.style.border = '1.5px solid white'; // Add a white border
    cpsButton.style.borderRadius = '3px';
    cpsButton.textContent = '';

    var cpsLabel = document.createElement('span');
    cpsLabel.textContent = 'LEFT CPS: ';
    var cpsValue = document.createElement('span');
    cpsValue.textContent = '0';

    cpsButton.appendChild(cpsLabel);
    cpsButton.appendChild(cpsValue);
    document.body.appendChild(cpsButton);

    cpsButton.addEventListener('click', function () {
        resetClickCount();
    });

    console.log('Left-click CPS counter added');

    // Create a div for right-click CPS
    var rmbCPSButton = document.createElement('div');
    rmbCPSButton.style.position = 'fixed';
    rmbCPSButton.style.bottom = '5px'; // Adjusted position for visibility
    rmbCPSButton.style.left = '1273px'; // Adjusted position for visibility
    rmbCPSButton.style.backgroundColor = 'rgba(0, 0, 0, 0)'; // Added background color for visibility
    rmbCPSButton.style.color = 'white';
    rmbCPSButton.style.padding = '5px';
    rmbCPSButton.style.fontFamily = 'Arial';
    rmbCPSButton.style.fontSize = '14px';
    rmbCPSButton.style.zIndex = '9999';
    rmbCPSButton.style.border = '1.5px solid white'; // Add a white border
    rmbCPSButton.style.borderRadius = '3px';
    rmbCPSButton.textContent = '';

    var rmbCPSLabel = document.createElement('span');
    rmbCPSLabel.textContent = 'RIGHT CPS: ';
    var rmbCPSValue = document.createElement('span');
    rmbCPSValue.textContent = '0';

    rmbCPSButton.appendChild(rmbCPSLabel);
    rmbCPSButton.appendChild(rmbCPSValue);
    document.body.appendChild(rmbCPSButton);

    // Event listeners for right-click
    var rmbClickTimes = [];

    function countRightClick() {
        var currentTime = new Date().getTime();
        rmbClickTimes.push(currentTime);
        updateRightClickCPS();
    }

    function updateRightClickCPS() {
        var currentTime = new Date().getTime();
        var oneSecondAgo = currentTime - 1000;
        var count = 0;

        for (var i = rmbClickTimes.length - 1; i >= 0; i--) {
            if (rmbClickTimes[i] >= oneSecondAgo) {
                count++;
            } else {
                break;
            }
        }

        rmbCPSValue.textContent = count;
    }

    console.log('Right-click CPS counter added');
})();

//Hotbar and Transparent name for games
(function() {
        'use strict';
        setInterval(function() {
            const hotBarItem = document.querySelectorAll(".HotBarItem");
            const selectedslot = document.querySelectorAll(".SelectedItem");
            if (hotBarItem) {
                hotBarItem.forEach(function(hotbar) {
                    hotbar.style.borderRadius = "8px";
                    hotbar.style.borderColor = "#000000";
                    hotbar.style.backgroundColor = "transparent";
                    hotbar.style.boxShadow = "none";
                    hotbar.style.outline = "transparent";
                });
            }
            if (selectedslot) {
                selectedslot.forEach(function(slot) {
                    slot.style.backgroundColor = "transparent";
                    slot.style.boxShadow = "none";
                    slot.style.borderRadius = "15px";
                    slot.style.borderColor = "#FFFFFF";
                    slot.style.outline = "transparent";
                });
            }
        }, 1);
    })();

document.addEventListener('DOMContentLoaded', modifyElements);
setInterval(modifyElements, 1000);

function modifyElements() {
    let names = document.getElementsByClassName("AvailableGameTextInner");
    let removebox = document.getElementsByClassName("AvailableGameTextWrapperBackground");
    let imgedits = document.getElementsByClassName("AvailableGame");

    document.querySelectorAll('.AvailableGame').forEach(item => {
        item.style.border = "none";
    });

    for (let i = 0; i < names.length; i++) {
        names[i].style.textShadow = "none";
        removebox[i].style.opacity = "0";
        imgedits[i].style.border = "none";
        imgedits[i].style.boxShadow = "0px 10px 20px rgba(0, 0, 0, 0.4)";
    }
}