Viros Cheating

idk why u need cheats for this. But uh here xd

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name         Viros Cheating
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  idk why u need cheats for this. But uh here xd
// @author       Viros
// @match        https://www.whatbeatsrock.com/*
// @grant        GM_xmlhttpRequest
// ==/UserScript==

(function() {
    'use strict';

    // Create container for the terminal and its background
    const container = document.createElement('div');
    container.style.cssText = `
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 9999;
        width: 320px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    `;

    // Canvas for dots & lines (background)
    const canvas = document.createElement('canvas');
    canvas.style.cssText = `
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 1;
    `;

    // Terminal panel (white, on top of canvas)
    const panel = document.createElement('div');
    panel.style.cssText = `
        position: relative;
        z-index: 2;
        background: #fff;
        color: #000;
        font-family: 'Courier New', 'Fira Code', monospace;
        font-size: 12px;
        padding: 12px;
        border-radius: 8px;
        border: 1px solid #aaa;
        backdrop-filter: none;
    `;

    panel.innerHTML = `
        <div style="margin-bottom: 8px; border-bottom: 1px solid #ccc; padding-bottom: 4px;">
            <span style="font-weight: bold; font-size: 14px;">$ viros-cheat</span>
            <span style="float: right;">v1.2</span>
        </div>
        <div style="font-size: 11px; margin-bottom: 12px; color: #555;">idk why u need cheats for this. But uh here xd</div>
        <div style="margin-bottom: 10px;">
            <button id="viros-show-answers" style="width: 100%; padding: 6px; margin-bottom: 6px; background: #eee; color: #000; border: 1px solid #aaa; border-radius: 4px; font-family: monospace; cursor: pointer;">> show_answers</button>
            <button id="viros-auto-submit" style="width: 100%; padding: 6px; margin-bottom: 6px; background: #eee; color: #000; border: 1px solid #aaa; border-radius: 4px; font-family: monospace; cursor: pointer;">> quick_submit</button>
            <div style="margin-top: 8px;">
                <input type="text" id="viros-custom-beats" placeholder="what beats current?" style="width: 100%; padding: 6px; margin-bottom: 6px; border-radius: 4px; border: 1px solid #aaa; font-family: monospace; box-sizing: border-box;">
                <button id="viros-submit-custom" style="width: 100%; padding: 6px; background: #eee; color: #000; border: 1px solid #aaa; border-radius: 4px; font-family: monospace; cursor: pointer;">> submit_new</button>
            </div>
        </div>
        <div id="viros-status" style="font-size: 11px; background: #f5f5f5; padding: 6px; border-radius: 4px; margin-top: 5px; word-wrap: break-word; border-left: 3px solid #888;">Ready</div>
    `;

    container.appendChild(canvas);
    container.appendChild(panel);
    document.body.appendChild(container);

    // Draw dots and lines on canvas
    function drawNetwork() {
        const rect = container.getBoundingClientRect();
        canvas.width = rect.width;
        canvas.height = rect.height;
        const ctx = canvas.getContext('2d');
        ctx.clearRect(0, 0, canvas.width, canvas.height);

        const dotCount = 45;
        const dots = [];
        const minDistance = 45; // connect dots closer than this
        const maxDistance = 80;

        // Generate random dots within canvas bounds
        for (let i = 0; i < dotCount; i++) {
            dots.push({
                x: Math.random() * canvas.width,
                y: Math.random() * canvas.height
            });
        }

        // Draw lines (connect dots if distance within range)
        ctx.beginPath();
        ctx.strokeStyle = '#ccc';
        ctx.lineWidth = 1;
        for (let i = 0; i < dots.length; i++) {
            for (let j = i + 1; j < dots.length; j++) {
                const dx = dots[i].x - dots[j].x;
                const dy = dots[i].y - dots[j].y;
                const dist = Math.sqrt(dx * dx + dy * dy);
                if (dist < maxDistance && dist > minDistance) {
                    ctx.beginPath();
                    ctx.moveTo(dots[i].x, dots[i].y);
                    ctx.lineTo(dots[j].x, dots[j].y);
                    ctx.stroke();
                }
            }
        }

        // Draw dots
        ctx.fillStyle = '#aaa';
        for (let dot of dots) {
            ctx.beginPath();
            ctx.arc(dot.x, dot.y, 2, 0, Math.PI * 2);
            ctx.fill();
        }
    }

    // Redraw on resize or any changes
    const resizeObserver = new ResizeObserver(() => drawNetwork());
    resizeObserver.observe(container);
    drawNetwork();

    // Helper functions (same as before, with minor tweaks)
    function getCurrentPrompt() {
        const promptElement = document.querySelector('h1, .prompt, [class*="prompt"], [class*="question"]');
        if (promptElement) return promptElement.innerText.trim();
        const mainText = document.body.innerText.split('\n')[0];
        return mainText || "rock";
    }

    function showCorrectAnswers() {
        const statusDiv = document.getElementById('viros-status');
        statusDiv.innerHTML = "> scanning...";
        
        const currentPrompt = getCurrentPrompt();
        const answers = [];
        
        document.querySelectorAll('[class*="entry"], .card, [class*="item"], .beats-item').forEach(el => {
            const text = el.innerText;
            if (text && text.length > 0 && text.length < 200) {
                const voteMatch = text.match(/(\d+(?:\.\d+)?[KM]?)/);
                const votes = voteMatch ? voteMatch[1] : '0';
                answers.push({ text: text.substring(0, 100), votes: votes });
            }
        });
        
        const allText = document.body.innerText.split('\n');
        for (let line of allText) {
            line = line.trim();
            if (line && line.length > 2 && line.length < 100 && !line.includes('score:') && !line.includes('powered by')) {
                if (line.match(/\d+[KM]?/) && !answers.some(a => a.text === line)) {
                    answers.push({ text: line, votes: line.match(/\d+[KM]?/)[0] });
                }
            }
        }
        
        if (answers.length > 0) {
            const topAnswers = answers.slice(0, 5);
            statusDiv.innerHTML = `[${currentPrompt}]\n` + topAnswers.map(a => `  • ${a.text}`).join('\n');
        } else {
            statusDiv.innerHTML = `> no answers found for "${currentPrompt}". try clicking a question.`;
        }
    }

    function submitNewEntry(beatsText) {
        const statusDiv = document.getElementById('viros-status');
        if (!beatsText || beatsText.trim() === '') {
            statusDiv.innerHTML = "> error: empty input";
            return;
        }
        
        statusDiv.innerHTML = "> submitting...";
        
        const inputs = document.querySelectorAll('input[type="text"], textarea');
        let submissionInput = null;
        for (let input of inputs) {
            if (input.placeholder && (input.placeholder.toLowerCase().includes('beats') || input.placeholder.toLowerCase().includes('what'))) {
                submissionInput = input;
                break;
            }
        }
        if (!submissionInput && inputs.length > 0) submissionInput = inputs[0];
        
        if (submissionInput) {
            submissionInput.value = beatsText;
            submissionInput.dispatchEvent(new Event('input', { bubbles: true }));
            
            const buttons = document.querySelectorAll('button');
            let submitBtn = null;
            for (let btn of buttons) {
                const txt = btn.innerText.toLowerCase();
                if (txt.includes('sub') || txt.includes('add') || txt.includes('post') || txt.includes('create')) {
                    submitBtn = btn;
                    break;
                }
            }
            
            if (submitBtn) {
                submitBtn.click();
                statusDiv.innerHTML = `> submitted: "${beatsText}" beats current.`;
            } else {
                statusDiv.innerHTML = `> input filled, but no submit button found. try manually.`;
            }
        } else {
            statusDiv.innerHTML = `> could not find input field. make sure you're on a submission page.`;
        }
    }

    // Attach event listeners
    document.getElementById('viros-show-answers').addEventListener('click', showCorrectAnswers);
    document.getElementById('viros-submit-custom').addEventListener('click', () => {
        const input = document.getElementById('viros-custom-beats');
        submitNewEntry(input.value);
        input.value = '';
    });
    document.getElementById('viros-auto-submit').addEventListener('click', () => {
        const prompt = getCurrentPrompt();
        const suggested = `something that beats ${prompt}`;
        const input = document.getElementById('viros-custom-beats');
        input.value = suggested;
        submitNewEntry(suggested);
    });

    // Initial status
    setTimeout(() => {
        const statusDiv = document.getElementById('viros-status');
        const input = document.querySelector('input[type="text"], textarea');
        if (input) statusDiv.innerHTML = "> ready. use commands above.";
        else statusDiv.innerHTML = "> not on a submission page? show_answers works anywhere.";
    }, 1000);

    console.log("Viros Cheating terminal loaded — dots & lines active.");
})();