Renderosity Tools

Custom tools for Renderosity

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name        Renderosity Tools
// @namespace   Violentmonkey Scripts
// @match       https://www.renderosity.com/*
// @icon        https://www.renderosity.com/favicon.ico
// @grant       none
// @version     1.2
// @description Custom tools for Renderosity
// @license     MIT
// ==/UserScript==

(function () {

    // ----------------------------------------------------
    // Helper: convert spaces → plus signs
    // ----------------------------------------------------
    function plusify(str) {
        return str.trim().split(" ").join("+");
    }

    // ----------------------------------------------------
    // Helper: extract product title from page
    // ----------------------------------------------------
    function getProductTitle() {
        const el = document.querySelector(".rr-mktproduct-title");
        if (!el) return null;
        return el.textContent.trim();
    }

    // ----------------------------------------------------
    // Only show floating buttons on product pages
    // ----------------------------------------------------
    if (location.href.startsWith("https://www.renderosity.com/marketplace/products/")) {

        // -----------------------------
        // Button 1: Search Render-State
        // -----------------------------
        const btn1 = document.createElement("button");
        btn1.textContent = "Search Render‑State";
        btn1.style.position = "fixed";
        btn1.style.top = "10px";
        btn1.style.right = "10px";
        btn1.style.zIndex = "999999";
        btn1.style.padding = "8px 12px";
        btn1.style.background = "#1e90ff";
        btn1.style.color = "#fff";
        btn1.style.border = "none";
        btn1.style.borderRadius = "6px";
        btn1.style.cursor = "pointer";
        btn1.style.fontSize = "14px";
        btn1.style.boxShadow = "0 2px 6px rgba(0,0,0,0.3)";
        btn1.style.opacity = "0.85";
        btn1.style.transition = "opacity 0.2s";

        btn1.onmouseenter = () => btn1.style.opacity = "1";
        btn1.onmouseleave = () => btn1.style.opacity = "0.85";

        btn1.onclick = () => {
            const title = getProductTitle();
            if (!title) return alert("Product title not found on page.");
            const query = plusify(title);
            const url = `https://render-state.to/?s=${query}&post_type=post`;
            window.open(url, "_blank");
        };

        document.body.appendChild(btn1);


        // -----------------------------
        // Button 2: Search 3D‑Load
        // -----------------------------
        const btn2 = document.createElement("button");
        btn2.textContent = "Search 3D‑Load";
        btn2.style.position = "fixed";
        btn2.style.top = "50px"; // below the first button
        btn2.style.right = "10px";
        btn2.style.zIndex = "999999";
        btn2.style.padding = "8px 12px";
        btn2.style.background = "#28a745";
        btn2.style.color = "#fff";
        btn2.style.border = "none";
        btn2.style.borderRadius = "6px";
        btn2.style.cursor = "pointer";
        btn2.style.fontSize = "14px";
        btn2.style.boxShadow = "0 2px 6px rgba(0,0,0,0.3)";
        btn2.style.opacity = "0.85";
        btn2.style.transition = "opacity 0.2s";

        btn2.onmouseenter = () => btn2.style.opacity = "1";
        btn2.onmouseleave = () => btn2.style.opacity = "0.85";

        btn2.onclick = () => {
            const title = getProductTitle();
            if (!title) return alert("Product title not found on page.");
            const query = plusify(title);
            const url = `https://3d-load.net/?s=${query}&asp_active=1&p_asid=1&p_asp_data=1&filters_initial=1&filters_changed=0&qtranslate_lang=0&asp_highlight=1&current_page_id=169737`;
            window.open(url, "_blank");
        };

        document.body.appendChild(btn2);
    }


    // ----------------------------------------------------
    // reCAPTCHA Removal (site-wide)
    // ----------------------------------------------------
    function removeCaptcha() {
        const candidates = document.querySelectorAll("div[style*='z-index: 2000000000']");
        for (const el of candidates) {
            if (el.querySelector("iframe[src*='recaptcha']")) {
                el.remove();
                console.log("reCAPTCHA block removed.");
            }
        }
    }

    removeCaptcha();

    const observer = new MutationObserver(removeCaptcha);
    observer.observe(document.documentElement, { childList: true, subtree: true });

})();