Kour.io FLIXWARE 2025

Umfangreiches Menü für Kour.io: Profile Modder, Waffen, Rage Menü (passwortgeschützt), KP Gen, ESP.

// ==UserScript==
// @name         Kour.io FLIXWARE 2025
// @match        *://kour.io/*
// @version      2.6 // Button Farb Anpassungen
// @author       Dark Shadow
// @license      Dark Shadow FLIXWARE
// @icon         https://i.imgur.com/11sYWVM.png
// @description  Umfangreiches Menü für Kour.io: Profile Modder, Waffen, Rage Menü (passwortgeschützt), KP Gen, ESP.
// @run-at       document-start
// @grant        unsafeWindow
// @grant        window.prompt
// @namespace    http://tampermonkey.net/
// ==/UserScript==

(function () {
    'use strict';

    // Globale Referenzen & Zustände
    let firebase;
    let showUserDetails;
    let kourInstance = { config: {} };
    unsafeWindow.kourInstance = kourInstance;

    let rageConfig = { unlocked: false, invisible: false, speed: false, instakill: false };
    let kpGeneratorInterval = null;
    let kpGeneratorActive = false;
    window.espEnabled = false;

    const RAGE_SPEED_MULTIPLIER = 2.5;
    const RAGE_MODE_PASSWORD = "8888";

    let openDialogIds = [];
    let originalPerfNow = null;

    let customMenu, profileModderSubMenu, rageSubMenu;
    let isMenuOpen = false;

    const waitForGlobalsInterval = setInterval(() => {
        if (unsafeWindow.firebase && unsafeWindow.firebase.auth && typeof unsafeWindow.showUserDetails === 'function' && unsafeWindow.performance && typeof unsafeWindow.performance.now === 'function') {
            firebase = unsafeWindow.firebase;
            showUserDetails = unsafeWindow.showUserDetails;
            originalPerfNow = unsafeWindow.performance.now.bind(unsafeWindow.performance);
            updatePerformanceNow(1);
            clearInterval(waitForGlobalsInterval);
            console.log("[Custom Profile Menu DS v2.6] Firebase und Spielfunktionen initialisiert.");
            initializeMenuAndFeatures();
            showInitializationMessage();
        }
    }, 200);

    function showInitializationMessage() {
        const dialogDuration = 5500; const progressBarDuration = 5000;
        const initDialog = document.createElement("div"); initDialog.id = "initMessageDialog";
        Object.assign(initDialog.style, { backgroundColor: "#222222", color: "#FFFFFF", border: "2px solid #007bff", borderRadius: "10px", padding: "25px", zIndex: "10005", fontFamily: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", boxShadow: "0 5px 25px rgba(0,0,0,0.5)", textAlign: "center", opacity: "0", transition: "opacity 0.5s ease-in-out", position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)", width: "300px" });
        const titleText = document.createElement("div"); titleText.textContent = "Kour.io Cheat by Dark Shadow"; Object.assign(titleText.style, { color: "#00A0FF", fontSize: "20px", fontWeight: "bold", marginBottom: "10px" });
        const injectedText = document.createElement("div"); injectedText.textContent = "Injected"; Object.assign(injectedText.style, { color: "#50C878", fontSize: "24px", fontWeight: "bold", marginBottom: "15px" });
        const progressBarContainer = document.createElement("div"); Object.assign(progressBarContainer.style, { width: "100%", backgroundColor: "#555", borderRadius: "5px", height: "20px", overflow: "hidden", marginTop: "5px" });
        const progressBar = document.createElement("div"); Object.assign(progressBar.style, { width: "0%", height: "100%", backgroundColor: "#28a745", borderRadius: "5px", transition: `width ${progressBarDuration / 1000}s linear` });
        progressBarContainer.appendChild(progressBar); initDialog.append(titleText, injectedText, progressBarContainer); document.body.appendChild(initDialog);
        setTimeout(() => { initDialog.style.opacity = "1"; setTimeout(() => { progressBar.style.width = "100%"; }, 100); }, 100);
        setTimeout(() => { initDialog.style.opacity = "0"; setTimeout(() => { if (initDialog.parentNode) initDialog.parentNode.removeChild(initDialog); }, 500); }, dialogDuration);
    }

    function updatePerformanceNow(multiplier) { if (!originalPerfNow) { console.error("[Custom Profile Menu DS] originalPerfNow ist nicht init!"); return; } if (multiplier === 1) { unsafeWindow.performance.now = originalPerfNow; } else { unsafeWindow.performance.now = new Proxy(originalPerfNow, { apply(target, thisArg, argArray) { try { throw new Error(); } catch (e) { if (e.stack && !e.stack.includes("invoke_")) { return target.apply(thisArg, argArray) * multiplier; } } return target.apply(thisArg, argArray); }, }); } }
    const Signatures = { damageTaken: "f3 04 c8 02 f5 15 04", updateState: "f3 02 fd 02 f4 03 c8", };
    function hexOf(buf) { return Array.from(new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, "0")).join(" "); }
    function shouldBlockDamage(ev) { return (ev.data instanceof ArrayBuffer && hexOf(ev.data).startsWith(Signatures.damageTaken) && rageConfig.invisible); }
    function hookWS() { if (unsafeWindow.WebSocket.prototype._hookedByDarkShadow) return; const OrigWS = unsafeWindow.WebSocket; unsafeWindow.WebSocket = function (...args) { const ws = new OrigWS(...args); const { addEventListener: originalAddEventListener } = ws; ws.addEventListener = (type, fn, opts) => originalAddEventListener.call(ws, type, type === "message" ? (ev) => shouldBlockDamage(ev) || fn(ev) : fn, opts); const protoDesc = Object.getOwnPropertyDescriptor(OrigWS.prototype, "onmessage"); if (protoDesc) { Object.defineProperty(ws, "onmessage", { configurable: true, set(fn) { protoDesc.set.call(this, fn ? (ev) => shouldBlockDamage(ev) || fn(ev) : null); }, get() { return protoDesc.get.call(this); }, });} const originalSend = ws.send; ws.send = function (data) { if (data instanceof ArrayBuffer && hexOf(data).startsWith(Signatures.updateState) && rageConfig.instakill) { for (let i = 0; i < 41; i++) originalSend.call(ws, data); return; } return originalSend.call(ws, data); }; return ws; }; unsafeWindow.WebSocket.prototype = OrigWS.prototype; unsafeWindow.WebSocket.prototype._hookedByDarkShadow = true; console.log("[Custom Profile Menu DS] WebSocket für Rage-Funktionen gehookt."); }
    const MIN_VERTICES_ESP = 1450; const MAX_VERTICES_ESP = 1490;
    function initializeESP() { if (unsafeWindow.WebGL2RenderingContext.prototype._espPatchedByDarkShadow) return; const WebGL = unsafeWindow.WebGL2RenderingContext.prototype; if (!HTMLCanvasElement.prototype._getContextPatchedByDarkShadow) { HTMLCanvasElement.prototype.getContext = new Proxy(HTMLCanvasElement.prototype.getContext, { apply(target, thisArgs, args) { return Reflect.apply(target, thisArgs, args); } }); HTMLCanvasElement.prototype._getContextPatchedByDarkShadow = true; } const drawHandler = { apply(target, thisArgs, args) { const program = thisArgs.getParameter(thisArgs.CURRENT_PROGRAM); if (program && !program.uniforms) { program.uniforms = { vertexCount: thisArgs.getUniformLocation(program, "vertexCount"), espToggle: thisArgs.getUniformLocation(program, "espToggle"), }; } if (program && program.uniforms) { const count = args[1]; if (program.uniforms.vertexCount) thisArgs.uniform1f(program.uniforms.vertexCount, count); if (program.uniforms.espToggle) thisArgs.uniform1f(program.uniforms.espToggle, window.espEnabled ? 1.0 : 0.0); } return Reflect.apply(target, thisArgs, args); }, }; WebGL.drawElements = new Proxy(WebGL.drawElements, drawHandler); WebGL.drawElementsInstanced = new Proxy(WebGL.drawElementsInstanced, drawHandler); WebGL.shaderSource = new Proxy(WebGL.shaderSource, { apply(target, thisArgs, args) { let [shader, src] = args; const espUniformNameInShader = "espToggle"; if (src.includes("gl_Position")) { src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float vertexCount;\nuniform float ${espUniformNameInShader};\nout float vVertexCount;\nvoid main() {\nvVertexCount = vertexCount;\n`); src = src.replace(/(gl_Position\s*=.+;)/, `$1\nif (${espUniformNameInShader} > 0.5 && vertexCount >= ${MIN_VERTICES_ESP}.0 && vertexCount <= ${MAX_VERTICES_ESP}.0) {\n    gl_Position.z = 0.01 + gl_Position.z * 0.1;\n}`); } if (src.includes("SV_Target0")) { src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float ${espUniformNameInShader};\nin float vVertexCount;\nvoid main() {`); src = src.replace(/return;/, `if(${espUniformNameInShader} > 0.5 && vVertexCount >= ${MIN_VERTICES_ESP}.0 && vVertexCount <= ${MAX_VERTICES_ESP}.0 && SV_Target0.a > 0.99) {\n    SV_Target0 = vec4(1.0, 0.0, 0.0, 1.0);\n}\nreturn;`); } args[1] = src; return Reflect.apply(target, thisArgs, args); }, }); unsafeWindow.WebGL2RenderingContext.prototype._espPatchedByDarkShadow = true; console.log("[Custom Profile Menu DS] ESP WebGL Hooks initialisiert."); }
    const weapons = [ { name: "AK-47", id: "0" }, { name: "Deagle", id: "1" }, { name: "AWP", id: "2" }, { name: "Bayonet", id: "3" }, { name: "Uzi", id: "4" }, { name: "PKM", id: "5" }, { name: "Revolver", id: "6" }, { name: "RPG", id: "7" }, { name: "USPS", id: "8" }, { name: "MP5", id: "9" }, { name: "Shotgun", id: "10" }, { name: "Glock", id: "11" }, { name: "Karambit", id: "12" }, { name: "Knife", id: "13" }, { name: "Scar", id: "14" }, { name: "Minigun", id: "15" }, { name: "Famas", id: "16" }, { name: "Vector", id: "17" }, { name: "Flamethrower", id: "18" }, { name: "Kar98k", id: "19" }, { name: "M4A4", id: "20" }, { name: "Tec-9", id: "21" }, { name: "CZ", id: "22" }, { name: "Berretta92fs", id: "23" }, { name: "AK-109", id: "24" }, { name: "P90", id: "25" }, { name: "Thompson", id: "26" }, { name: "UMP45", id: "27" }, { name: "XM1014", id: "28" }, { name: "Butterfly", id: "29" }, { name: "Laser Gun", id: "30" }, { name: "Bomb", id: "31" }, { name: "Smoke Grenade", id: "32" }, { name: "Molotov", id: "33" }, { name: "Grenade", id: "34" }, { name: "Flashbang", id: "35" }, { name: "Glizzy", id: "36" }, { name: "Axe", id: "37" }, { name: "Bare Fists", id: "38" }];
    function setFirebaseWeapon(weaponID, pathSuffix, weaponType) { if (!firebase || !firebase.auth().currentUser) { createCustomAlertDialog("Bitte zuerst im Spiel anmelden."); return; } firebase.database().ref(`users/${firebase.auth().currentUser.uid}/${pathSuffix}`).set(weaponID).then(() => { if (showUserDetails) showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); createCustomAlertDialog(`${weaponType} erfolgreich auf Waffe ID ${weaponID} gesetzt.`); }).catch(err => { console.error(`[Custom Profile Menu DS] Fehler beim Setzen von ${weaponType}:`, err); createCustomAlertDialog(`Fehler beim Setzen von ${weaponType}.`); }); }
    function setSecondaryWeapon(weaponID) { setFirebaseWeapon(weaponID, "overrideWeaponIndexes1", "Sekundärwaffe"); }
    function setMeleeWeapon(weaponID) { setFirebaseWeapon(weaponID, "overrideWeaponIndexes2", "Nahkampfwaffe"); }
    function createWeaponSelectionDialog(titleText, isMelee) { const dialogId = isMelee ? "setMeleeWeaponDialog" : "setSecondaryWeaponDialog"; closeCurrentlyOpenDialog(dialogId); const dialog = document.createElement("div"); dialog.id = dialogId; dialog.className = "customDialog"; Object.assign(dialog.style, { width: "400px", maxHeight: "80vh", overflowY: "auto", backgroundColor: "#000000", borderColor: "#FFFFFF", padding: "15px" }); const title = document.createElement("div"); title.className = "customMenuHeader"; title.textContent = titleText; Object.assign(title.style, { color: "#FFFFFF", borderBottom: "1px solid #FFFFFF", marginBottom: "15px", marginTop:"-5px"}); const closeButton = createDialogCloseButton(() => removeDialogFromOpenList(dialogId)); const weaponButtonContainer = document.createElement("div"); Object.assign(weaponButtonContainer.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "8px", marginTop: "10px" }); weapons.forEach(weapon => { const btn = createMenuButton(`${weapon.name} (${weapon.id})`, () => { if (isMelee) { setMeleeWeapon(weapon.id); } else { setSecondaryWeapon(weapon.id); } removeDialogFromOpenList(dialogId); }); btn.style.fontSize = "12px"; btn.style.padding = "6px"; btn.style.margin = "0"; weaponButtonContainer.appendChild(btn); }); dialog.append(title, closeButton, weaponButtonContainer); document.body.appendChild(dialog); makeDraggable(dialog, title); openDialogWithId(dialogId); }
    const classMap = { Soldier: "class0kills", Hitman: "class1kills", Gunner: "class2kills", Heavy: "class3kills", Rocketeer: "class4kills", Agent: "class5kills", Brawler: "class6kills", Investor: "class7kills", Assassin: "class8kills", Juggernaut: "class9kills", Recon: "class10kills", Pyro: "class11kills", Rayblader: "class15kills"};
    function updateClassKills(classField, killCount, suppressDialog = false) { if (!firebase || !firebase.auth().currentUser) { if (!suppressDialog) createCustomAlertDialog("Bitte zuerst im Spiel anmelden."); return Promise.reject("User not logged in"); } const updateData = {}; updateData[classField] = killCount; return firebase.database().ref(`users/${firebase.auth().currentUser.uid}`).update(updateData).then(() => { if (showUserDetails) showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); if (!suppressDialog) createCustomAlertDialog(`${classField.replace("kills","").replace("class","Klasse ")} Kills auf ${killCount} gesetzt.`); }).catch(err => { console.error(`[Custom Profile Menu DS] Update-Fehler für ${classField}:`, err); if (!suppressDialog) createCustomAlertDialog(`Fehler beim Update von ${classField.replace("kills","").replace("class","Klasse ")}.`); return Promise.reject(err); }); }
    function setClassKillsDialog() { closeCurrentlyOpenDialog("customClassSelectionDialog"); const dialogId = "customClassSelectionDialog"; const dialog = document.createElement("div"); dialog.id = dialogId; dialog.className = "customDialog"; Object.assign(dialog.style, { width: "360px", maxHeight: "80vh", overflowY: "auto", backgroundColor: "#000000", borderColor: "#FFFFFF", padding: "15px" }); const title = document.createElement("div"); title.className = "customMenuHeader"; title.textContent = "Klassen Kills setzen"; Object.assign(title.style, { color: "#FFFFFF", borderBottom: "1px solid #FFFFFF", marginBottom: "15px", marginTop:"-5px" }); const closeButton = createDialogCloseButton(() => removeDialogFromOpenList(dialogId)); const buttonContainer = document.createElement("div"); Object.assign(buttonContainer.style, { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: "8px" }); Object.keys(classMap).forEach(className => { const btn = createMenuButton(className, () => { const killsValue = prompt(`Anzahl Kills für ${className} eingeben:`, "10000"); if (killsValue === null) return; const numKills = Number(killsValue); if (isNaN(numKills)) { createCustomAlertDialog("Ungültige Zahl!"); return; } updateClassKills(classMap[className], numKills).catch(() => {}); }); btn.style.fontSize = "13px"; btn.style.padding = "8px"; btn.style.margin = "0"; buttonContainer.appendChild(btn); }); dialog.append(title, closeButton, buttonContainer); document.body.appendChild(dialog); makeDraggable(dialog, title); openDialogWithId(dialogId); }
    function updateKDStats(newStats, suppressDialog = false) { if (!firebase || !firebase.auth().currentUser) { if (!suppressDialog) createCustomAlertDialog("Bitte zuerst im Spiel anmelden."); return Promise.reject("User not logged in"); } return firebase.database().ref(`users/${firebase.auth().currentUser.uid}`).update(newStats).then(() => { if (showUserDetails) showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); if (!suppressDialog) createCustomAlertDialog("Profil-Stats erfolgreich aktualisiert!"); }).catch(err => { console.error(`[Custom Profile Menu DS] Fehler beim Update der Stats:`, err); if (!suppressDialog) createCustomAlertDialog("Fehler beim Update der Stats."); return Promise.reject(err); });}
    function setKDStatsDialog() { closeCurrentlyOpenDialog("setKDStatsCustomDialog"); const dialogId = "setKDStatsCustomDialog"; const dialog = document.createElement("div"); dialog.id = dialogId; dialog.className = "customDialog"; Object.assign(dialog.style, { width: "380px", backgroundColor: "#000000", borderColor: "#FFFFFF", padding: "20px" }); const title = document.createElement("div"); title.className = "customMenuHeader"; title.textContent = "Profil Stats ändern"; Object.assign(title.style, { color: "#FFFFFF", borderBottom: "1px solid #FFFFFF", marginBottom: "20px", marginTop:"-5px" }); const closeButton = createDialogCloseButton(() => removeDialogFromOpenList(dialogId)); const form = document.createElement("form"); form.style.display = "flex"; form.style.flexDirection = "column"; form.style.gap = "10px"; const createStatInputRow = (labelText, inputId, initialValue) => { const row = document.createElement("div"); Object.assign(row.style, { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "5px" }); const label = document.createElement("label"); label.htmlFor = inputId; label.textContent = labelText + ":"; Object.assign(label.style, { color: "#FFFFFF", marginRight: "10px", flexBasis: "130px", cursor: "pointer" }); const inputDisplay = document.createElement("input"); inputDisplay.type = "text"; inputDisplay.id = inputId; inputDisplay.value = initialValue; inputDisplay.readOnly = true; Object.assign(inputDisplay.style, { backgroundColor: "#333", color: "#FFF", border: "1px solid #555", borderRadius: "4px", padding: "8px", flexGrow: "1", textAlign: "right", cursor: "pointer" }); const openPromptForInput = () => { const newValue = prompt(`Neuen Wert für "${labelText}" eingeben:`, inputDisplay.value); if (newValue !== null) { if (newValue.trim() === "" || isNaN(Number(newValue))) { createCustomAlertDialog("Ungültige Eingabe. Bitte eine Zahl eingeben."); } else { inputDisplay.value = Number(newValue); } } }; label.onclick = openPromptForInput; inputDisplay.onclick = openPromptForInput; row.appendChild(label); row.appendChild(inputDisplay); return row; }; let currentStats = { totalKills: "1337", totalDeaths: "420", totalScore: "10000000", elo: "30000" }; const killsRow = createStatInputRow("Gesamt Kills", "kd_kills_display", currentStats.totalKills); const deathsRow = createStatInputRow("Gesamt Tode", "kd_deaths_display", currentStats.totalDeaths); const scoreRow = createStatInputRow("Gesamt Score (XP)", "kd_score_display", currentStats.totalScore); const eloRow = createStatInputRow("Elo", "kd_elo_display", currentStats.elo); form.append(killsRow, deathsRow, scoreRow, eloRow); const buttonContainer = document.createElement("div"); buttonContainer.className = "customDialogButtonContainer"; buttonContainer.style.marginTop = "20px"; const submitBtn = createMenuButton("Speichern", () => { const parsedStats = { totalKills: Number(document.getElementById("kd_kills_display").value), totalDeaths: Number(document.getElementById("kd_deaths_display").value), totalScore: Number(document.getElementById("kd_score_display").value), elo: Number(document.getElementById("kd_elo_display").value) }; if (Object.values(parsedStats).some(val => typeof val !== 'number' || isNaN(val))) { createCustomAlertDialog("Fehler: Eines der Felder enthält keinen gültigen Zahlenwert."); return; } updateKDStats(parsedStats).then(() => removeDialogFromOpenList(dialogId)); }); submitBtn.classList.add("confirm"); submitBtn.style.backgroundColor = "#28a745"; const cancelBtn = createMenuButton("Abbrechen", () => removeDialogFromOpenList(dialogId)); cancelBtn.style.backgroundColor = "#333"; cancelBtn.classList.add("cancel"); buttonContainer.append(submitBtn, cancelBtn); dialog.append(title, closeButton, form, buttonContainer); document.body.appendChild(dialog); makeDraggable(dialog, title); openDialogWithId(dialogId); }
    function setLevel1000() { createConfirmationDialog( "XP auf 1 Milliarde (Level ~1000) setzen?", () => updateKDStats({ totalScore: 1000000000 }), "setLevel1000ConfirmDialog" ); }
    async function setMaxAccount() { createConfirmationDialog( "Max Account: Kills, XP, Elo auf 1 Mrd., Klassen-Kills auf 999 Mio. setzen? (Tode bleiben unberührt)", async () => { const MAX_VALUE_PRIMARY = 1000000000; const MAX_VALUE_CLASS_KILLS = 999999999; let allSuccessful = true; showLoadingOverlay("Max Account wird gesetzt..."); try { const userSnapshot = await firebase.database().ref(`users/${firebase.auth().currentUser.uid}/totalDeaths`).once('value'); const currentDeaths = userSnapshot.val() || 0; await updateKDStats({ totalKills: MAX_VALUE_PRIMARY, totalScore: MAX_VALUE_PRIMARY, elo: MAX_VALUE_PRIMARY, totalDeaths: currentDeaths }, true); const classPromises = Object.values(classMap).map(classField => updateClassKills(classField, MAX_VALUE_CLASS_KILLS, true) ); await Promise.all(classPromises); } catch (error) { allSuccessful = false; console.error("[Custom Profile Menu DS] Max Account Fehler:", error); } finally { hideLoadingOverlay(); if (allSuccessful) { createCustomAlertDialog("Max Account Werte erfolgreich gesetzt!"); } else { createCustomAlertDialog("Einige Max Account Werte konnten nicht gesetzt werden. Siehe Konsole."); } if (showUserDetails && firebase.auth().currentUser) { showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); } } }, "setMaxAccountConfirmDialog" ); }
    function showKpGeneratorInstructions() { closeCurrentlyOpenDialog("kpGeneratorInstructionsDialog"); const dialogId = "kpGeneratorInstructionsDialog"; const instructionsDialog = document.createElement("div"); instructionsDialog.id = dialogId; instructionsDialog.className = "customDialog"; Object.assign(instructionsDialog.style, { width: "340px", maxHeight: "450px", overflowY: "auto", backgroundColor: "#1e1e1e", borderColor: "#FFFFFF", padding: "20px", }); const title = document.createElement("div"); title.className = "customMenuHeader"; title.textContent = "✨ KP Generator Anleitung ✨"; Object.assign(title.style, { fontSize: "20px", marginBottom: "15px", textShadow: "0 0 5px rgba(255,255,255,0.3)", }); const closeButton = createDialogCloseButton(() => removeDialogFromOpenList(dialogId)); const instructionsContent = document.createElement("div"); instructionsContent.innerHTML = `<div style="margin-bottom: 15px; background-color: #2a2a2a; padding: 15px; border-radius: 8px; border-left: 4px solid #007bff;"><div style="font-weight: bold; font-size: 16px; margin-bottom: 10px; color: #FFD700;">🚀 How to Use:</div><ol style="margin-top: 5px; padding-left: 25px; line-height: 1.5; color: #eee;"><li style="margin-bottom: 8px;">📋 Go to the missions section and claim the Christmas one</li><li style="margin-bottom: 8px;">⏱️ Close it and wait 5 seconds</li><li style="margin-bottom: 8px;">🔄 Go back</li><li style="margin-bottom: 8px;">🔁 Rinse and Repeat</li></ol></div><div style="margin-top: 15px; background-color: #2a2a2a; padding: 15px; border-radius: 8px; border-left: 4px solid #FFA500;"><div style="font-weight: bold; font-size: 16px; margin-bottom: 10px; color: #FFD700;">⚠️ Important Notes:</div><ul style="margin-top: 5px; padding-left: 25px; line-height: 1.5; color: #eee;"><li style="margin-bottom: 8px;">⏳ You may need to wait a minute or two for it to begin adding, give it a few tries. Please be patient.</li><li style="margin-bottom: 8px;">🔄 Sometimes the KP on the top will start going back or looks like it gets stuck, reload the page and it will add again as this is not with the code but with the game.</li></ul></div>`; const okBtn = createMenuButton("Verstanden!", () => removeDialogFromOpenList(dialogId)); okBtn.style.width = "100%"; okBtn.style.marginTop = "20px"; okBtn.style.padding = "10px"; okBtn.style.backgroundColor = "#007bff"; okBtn.onmouseover = () => okBtn.style.backgroundColor = "#0056b3"; okBtn.onmouseout = () => okBtn.style.backgroundColor = "#007bff"; instructionsDialog.append(title, closeButton, instructionsContent, okBtn); document.body.appendChild(instructionsDialog); makeDraggable(instructionsDialog, title); openDialogWithId(dialogId); }
    function toggleKpGenerator() { kpGeneratorActive = !kpGeneratorActive; updateToggleButton("kpGeneratorBtn", "KP Generator", kpGeneratorActive); if (kpGeneratorActive) { showKpGeneratorInstructions(); kpGeneratorInterval = setInterval(() => { if (!firebase.auth().currentUser) return; const uid = firebase.auth().currentUser.uid; firebase.database().ref(`users/${uid}/mission-1claimDate`).remove(); firebase.database().ref(`users/${uid}/mission-1claimed`).remove(); firebase.database().ref(`users/${uid}/mission-1kills`).set("5000"); if (showUserDetails) { showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); } console.log("[Custom Profile Menu DS] KP Generator Tick."); }, 5000); } else { if (kpGeneratorInterval) clearInterval(kpGeneratorInterval); kpGeneratorInterval = null; } }
    function toggleESP() { window.espEnabled = !window.espEnabled; updateToggleButton("espBtn", "ESP", window.espEnabled); console.log(`[Custom Profile Menu DS] ESP ${window.espEnabled ? "aktiviert" : "deaktiviert"}.`); }
    function attemptOpenRageMenu() { closeAllDialogsAndSubmenus(true); createPasswordDialog(RAGE_MODE_PASSWORD, () => { rageConfig.unlocked = true; toggleRageSubMenu(true); }, "ragePasswordAccessDialog"); }
    function toggleRageSubMenu(forceOpen = null) { if (!rageConfig.unlocked && forceOpen) { createCustomAlertDialog("Rage Menü ist passwortgeschützt."); return; } const isOpen = rageSubMenu.classList.contains("open"); const shouldOpen = forceOpen !== null ? forceOpen : !isOpen; if (shouldOpen) { closeCurrentlyOpenDialog("customRageSubMenu", true); if(profileModderSubMenu.classList.contains("open")) toggleProfileModderSubMenu(false); rageSubMenu.classList.add("open"); const menuRect = customMenu.getBoundingClientRect(); rageSubMenu.style.top = menuRect.top + "px"; rageSubMenu.style.left = (menuRect.left - rageSubMenu.offsetWidth - 10) + "px"; if (parseInt(rageSubMenu.style.left) < 10) { rageSubMenu.style.left = menuRect.right + 10 + "px"; } makeDraggable(rageSubMenu, rageSubMenu.querySelector(".customMenuHeader")); addDialogToOpenList("customRageSubMenu"); } else { removeDialogFromOpenList("customRageSubMenu"); } }
    function toggleRageInvisible() { rageConfig.invisible = !rageConfig.invisible; updateToggleButton("rageInvisibleBtn", "Invisible", rageConfig.invisible); console.log(`[Custom Profile Menu DS] Rage Invisible: ${rageConfig.invisible}`); }
    function toggleRageSpeed() { rageConfig.speed = !rageConfig.speed; updateToggleButton("rageSpeedBtn", "Speed Hack", rageConfig.speed); if (rageConfig.speed) { updatePerformanceNow(RAGE_SPEED_MULTIPLIER); } else { updatePerformanceNow(1); } console.log(`[Custom Profile Menu DS] Rage Speed: ${rageConfig.speed}`); }
    function toggleRageInstakill() { rageConfig.instakill = !rageConfig.instakill; updateToggleButton("rageInstakillBtn", "Instakill", rageConfig.instakill); console.log(`[Custom Profile Menu DS] Rage Instakill: ${rageConfig.instakill}`); }

    function initializeMenuAndFeatures() {
        if (originalPerfNow) { updatePerformanceNow(1); }
        initializeESP(); hookWS();
        const styleSheet = document.createElement("style");
        styleSheet.textContent = `
            .customMenuAuthorTop { text-align: center; color: #FFFFFF; font-size: 11px; margin-bottom: 3px; }
            #customKourMenu, #customProfileModderSubMenu, #customRageSubMenu { position: fixed; background-color: #000000; color: #FFFFFF; border: 2px solid #FFFFFF; border-radius: 8px; padding: 12px; z-index: 10001; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; box-shadow: 0 0 12px rgba(255, 255, 255, 0.25); opacity: 0; transform: scale(0.98); pointer-events: none; transition: opacity 0.25s ease-out, transform 0.25s ease-out; }
            #customKourMenu.open, #customProfileModderSubMenu.open, #customRageSubMenu.open { opacity: 1; transform: scale(1); pointer-events: auto; }
            .customMenuHeader { font-size: 18px; font-weight: bold; margin-bottom: 12px; text-align: center; color: #FFFFFF; border-bottom: 1px solid #FFFFFF; padding-bottom: 8px; }
            .customMenuButton { background-color: #000000; color: #FFFFFF; border: 1px solid #FFFFFF; padding: 8px 12px; margin: 6px 0; border-radius: 4px; cursor: pointer; display: block; width: 100%; text-align: center; font-size: 14px; font-weight: 500; transition: transform 0.15s ease-out, border-color 0.15s ease-out, background-color 0.15s ease; }
            .customMenuButton:hover { transform: scale(1.03); border-color: #007bff; background-color: #1a1a1a; }
            .customMenuButton.active { background-color: #28a745; border-color: #1e7e34; color: white; } .customMenuButton.active:hover { transform: scale(1.03); border-color: #007bff; background-color: #218838; }
            .customMenuButton.inactive { background-color: #dc3545; border-color: #b02a37; color: white; } .customMenuButton.inactive:hover { transform: scale(1.03); border-color: #007bff; background-color: #c82333; }
            .customMenuButton.subtle { background-color: #181818; border-color: #555;} .customMenuButton.subtle:hover { background-color: #282828; border-color: #007bff;}
            .customDialog { position: fixed; background-color: #000000; color: #FFFFFF; border: 2px solid #FFFFFF; border-radius: 8px; padding: 20px; z-index: 10002; font-family: 'Segoe UI', sans-serif; box-shadow: 0 5px 25px rgba(0,0,0,0.7); opacity: 0; transform: translate(-50%, -50%) scale(0.98); pointer-events: none; transition: opacity 0.25s ease-out, transform 0.25s ease-out; top: 50%; left: 50%; }
            .customDialog.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; } .customDialog p { margin-bottom: 15px; font-size: 15px; text-align: center; color: #FFFFFF; }
            .customDialog input[type="text"], .customDialog input[type="number"] { background-color: #333; color: #FFF; border: 1px solid #555; border-radius: 4px; padding: 8px; width: calc(100% - 18px); margin-bottom: 5px; box-sizing: border-box;}
            .customDialogButtonContainer { display: flex; justify-content: space-around; gap: 10px; }
        `;
        document.head.appendChild(styleSheet);
        customMenu = document.createElement("div"); customMenu.id = "customKourMenu"; Object.assign(customMenu.style, { top: "40px", right: "15px", width: "240px" });
        const authorTextTop = document.createElement("div"); authorTextTop.className = "customMenuAuthorTop"; authorTextTop.textContent = "By Dark Shadow"; customMenu.appendChild(authorTextTop);
        const menuHeader = createMenuHeader("Kour.io Cheat 2025"); customMenu.appendChild(menuHeader);

        const btnKpGenerator = createToggleButton("KP Generator", () => toggleKpGenerator(), "kpGeneratorBtn", kpGeneratorActive);
        const btnSetSecondary = createMenuButton("Sekundärwaffe", () => createWeaponSelectionDialog("Sekundärwaffe wählen", false));
        const btnSetMelee = createMenuButton("Nahkampfwaffe", () => createWeaponSelectionDialog("Nahkampfwaffe wählen", true));

        const btnProfileModder = createMenuButton("Profile Modder", () => toggleProfileModderSubMenu());
        btnProfileModder.style.backgroundColor = "#00008B"; // Dunkelblau
        btnProfileModder.style.borderColor = "#0000CD"; // Medium Blau für den Rand
        btnProfileModder.onmouseover = function() { this.style.backgroundColor = "#0000A0"; }; // Etwas heller bei Hover
        btnProfileModder.onmouseout = function() { this.style.backgroundColor = "#00008B"; };

        const btnLevel1000 = createMenuButton("LvL 1000 (XP)", () => setLevel1000());
        btnLevel1000.style.backgroundColor = "#FFA500"; // Orange
        btnLevel1000.style.borderColor = "#FF8C00";   // Dunkleres Orange für Rand
        btnLevel1000.onmouseover = function() { this.style.backgroundColor = "#FFB732"; };
        btnLevel1000.onmouseout = function() { this.style.backgroundColor = "#FFA500"; };

        const btnMaxAccount = createMenuButton("Max Account Werte", () => setMaxAccount());
        btnMaxAccount.style.backgroundColor = "#8A2BE2"; // Violett (BlueViolet)
        btnMaxAccount.style.borderColor = "#9400D3";    // Dunkleres Violett
        btnMaxAccount.onmouseover = function() { this.style.backgroundColor = "#9932CC"; };
        btnMaxAccount.onmouseout = function() { this.style.backgroundColor = "#8A2BE2"; };

        const btnEsp = createToggleButton("ESP", () => toggleESP(), "espBtn", window.espEnabled);

        const btnRageMenu = createMenuButton("Rage Menü", () => attemptOpenRageMenu());
        btnRageMenu.style.backgroundColor = "#FFD700"; // Gold (Gelb)
        btnRageMenu.style.color = "#333"; // Dunklerer Text für besseren Kontrast auf Gelb
        btnRageMenu.style.borderColor = "#DAA520";    // Dunkleres Gold
        btnRageMenu.onmouseover = function() { this.style.backgroundColor = "#FFFF00"; }; // Helleres Gelb
        btnRageMenu.onmouseout = function() { this.style.backgroundColor = "#FFD700"; };


        customMenu.append(btnKpGenerator, btnSetSecondary, btnSetMelee, btnProfileModder, btnLevel1000, btnMaxAccount, btnEsp, btnRageMenu);
        document.body.appendChild(customMenu);

        profileModderSubMenu = document.createElement("div"); profileModderSubMenu.id = "customProfileModderSubMenu"; Object.assign(profileModderSubMenu.style, { width: "210px" });
        const subMenuHeader = createMenuHeader("Profile Editor"); const closeSubMenuBtn = createDialogCloseButton(() => toggleProfileModderSubMenu(false));
        const btnClassKills = createMenuButton("Klassen Kills", () => setClassKillsDialog());
        const btnKDStats = createMenuButton("Stats (K/D etc.)", () => setKDStatsDialog());
        profileModderSubMenu.append(subMenuHeader, closeSubMenuBtn, btnClassKills, btnKDStats);
        document.body.appendChild(profileModderSubMenu);

        rageSubMenu = document.createElement("div"); rageSubMenu.id = "customRageSubMenu"; Object.assign(rageSubMenu.style, { width: "210px" });
        const rageMenuHeader = createMenuHeader("Rage Menü"); const closeRageMenuBtn = createDialogCloseButton(() => toggleRageSubMenu(false));
        const btnRageInvisible = createToggleButton("Invisible", () => toggleRageInvisible(), "rageInvisibleBtn", rageConfig.invisible);
        const btnRageSpeed = createToggleButton("Speed Hack", () => toggleRageSpeed(), "rageSpeedBtn", rageConfig.speed);
        const btnRageInstakill = createToggleButton("Instakill", () => toggleRageInstakill(), "rageInstakillBtn", rageConfig.instakill);
        rageSubMenu.append(rageMenuHeader, closeRageMenuBtn, btnRageInvisible, btnRageSpeed, btnRageInstakill);
        document.body.appendChild(rageSubMenu);

        document.addEventListener("keydown", (e) => { if (e.key === "Shift" && e.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT && !e.target.matches('input, textarea, [contenteditable]')) { e.preventDefault(); toggleMainMenu(); } if (e.key === "Escape" && (isMenuOpen || openDialogIds.length > 0 )) { e.preventDefault(); closeAllDialogsAndSubmenus(); if(isMenuOpen) toggleMainMenu(false); } if (e.key.toLowerCase() === 'p' && !e.target.matches('input, textarea, [contenteditable]')) { toggleESP(); } });
        console.log("[Custom Profile Menu DS] UI v2.6 initialisiert. Rechts-Shift zum Öffnen/Schließen.");
    }

    function createMenuButton(text, onClick, id = null) { const btn = document.createElement("button"); btn.className = "customMenuButton"; btn.textContent = text; btn.onclick = () => { if (onClick) { if ((text.includes("LvL") || text.includes("Max Account") || text.includes("KP Gen") || text.includes("Kills") || text.includes("Stats") || text.includes("waffe") || text.includes("Sekundär") || text.includes("Nahkampf")) && (!firebase || !firebase.auth().currentUser)) { createCustomAlertDialog("Bitte zuerst im Spiel anmelden."); return; } onClick(); } }; if (id) btn.id = id; return btn; }
    function createToggleButton(baseText, onClick, id, initialState) { const btn = document.createElement("button"); btn.id = id; btn.className = "customMenuButton"; btn.textContent = `${baseText}: ${initialState ? "AN" : "AUS"}`; btn.classList.toggle("active", initialState); btn.classList.toggle("inactive", !initialState); btn.onclick = onClick; return btn; }
    function updateToggleButton(buttonId, baseText, isActive) { const btn = document.getElementById(buttonId); if (btn) { btn.textContent = `${baseText}: ${isActive ? "AN" : "AUS"}`; btn.classList.toggle("active", isActive); btn.classList.toggle("inactive", !isActive); } }
    function createMenuHeader(text){ const header = document.createElement("div"); header.className = "customMenuHeader"; header.textContent = text; return header; }
    function toggleMainMenu(forceState) { isMenuOpen = (forceState !== undefined) ? forceState : !isMenuOpen; if (isMenuOpen) { customMenu.classList.add("open"); } else { customMenu.classList.remove("open"); closeAllDialogsAndSubmenus(false); } }
    function toggleProfileModderSubMenu(forceOpen = null) { const isOpen = profileModderSubMenu.classList.contains("open"); const shouldOpen = forceOpen !== null ? forceOpen : !isOpen; if (shouldOpen) { closeCurrentlyOpenDialog("customProfileModderSubMenu", true); if(rageSubMenu.classList.contains("open")) toggleRageSubMenu(false); profileModderSubMenu.classList.add("open"); const menuRect = customMenu.getBoundingClientRect(); profileModderSubMenu.style.top = menuRect.top + "px"; let potentialLeft = menuRect.left - profileModderSubMenu.offsetWidth - 10; profileModderSubMenu.style.left = (potentialLeft < 10 ? menuRect.right + 10 : potentialLeft) + "px"; profileModderSubMenu.style.right = "auto"; makeDraggable(profileModderSubMenu, profileModderSubMenu.querySelector(".customMenuHeader")); addDialogToOpenList("customProfileModderSubMenu"); } else { removeDialogFromOpenList("customProfileModderSubMenu"); } }
    function addDialogToOpenList(dialogId) { const dialogElement = document.getElementById(dialogId); if (dialogElement) { if (!openDialogIds.includes(dialogId)) { openDialogIds.push(dialogId); } } }
    function removeDialogFromOpenList(dialogId, keepOpen = false) { const dialogElement = document.getElementById(dialogId); if (dialogElement && !keepOpen) { dialogElement.classList.remove("open"); if (dialogElement.classList.contains('customDialog') && dialogId !== "customProfileModderSubMenu" && dialogId !== "customRageSubMenu") { setTimeout(() => { if(dialogElement.parentNode && !dialogElement.classList.contains("open")) dialogElement.parentNode.removeChild(dialogElement); }, 300); } } openDialogIds = openDialogIds.filter(id => id !== dialogId); }
    function closeCurrentlyOpenDialog(excludeId = null, onlyModalsNotSubmenus = false) { const idsToClose = [...openDialogIds]; idsToClose.forEach(id => { if (id !== excludeId) { const dialogElement = document.getElementById(id); if (dialogElement) { if (onlyModalsNotSubmenus && (id === "customProfileModderSubMenu" || id === "customRageSubMenu")) { return; } removeDialogFromOpenList(id); } } });}
    function closeAllDialogsAndSubmenus(keepMainMenuOpen = false) { closeCurrentlyOpenDialog(); if (profileModderSubMenu && profileModderSubMenu.classList.contains("open")) toggleProfileModderSubMenu(false); if (rageSubMenu && rageSubMenu.classList.contains("open")) toggleRageSubMenu(false); }
    function openDialogWithId(dialogId) { closeCurrentlyOpenDialog(dialogId, true); const dialogElement = document.getElementById(dialogId); if(dialogElement) { addDialogToOpenList(dialogId); setTimeout(() => dialogElement.classList.add("open"), 10); } }
    function createDialogCloseButton(onClickAction) { const closeButton = document.createElement("button"); closeButton.textContent = "×"; Object.assign(closeButton.style, { position: "absolute", top: "10px", right: "10px", background: "transparent", border: "1px solid #FFFFFF", color: "#FFFFFF", borderRadius: "50%", width: "25px", height: "25px", cursor: "pointer", lineHeight: "22px", fontSize:"16px", zIndex: "10" }); closeButton.onclick = onClickAction; return closeButton; }
    function createConfirmationDialog(message, onConfirm, dialogId, onCancel = null) { closeCurrentlyOpenDialog(dialogId, true); const dialog = document.createElement("div"); dialog.id = dialogId; dialog.className = "customDialog customConfirmationDialog"; const title = createMenuHeader("Bestätigung"); Object.assign(title.style, {marginTop:"-5px", marginBottom:"10px", fontSize:"16px"}); const closeButton = createDialogCloseButton(() => { if(onCancel) onCancel(); removeDialogFromOpenList(dialogId); }); const msgElement = document.createElement("p"); msgElement.textContent = message; const buttonContainer = document.createElement("div"); buttonContainer.className = "customDialogButtonContainer"; const confirmBtn = createMenuButton("Bestätigen", () => { onConfirm(); removeDialogFromOpenList(dialogId); }); confirmBtn.classList.add("confirm"); confirmBtn.style.backgroundColor = "#28a745"; const cancelBtn = createMenuButton("Abbrechen", () => { if (onCancel) onCancel(); removeDialogFromOpenList(dialogId); }); cancelBtn.style.backgroundColor = "#333"; cancelBtn.classList.add("cancel"); buttonContainer.append(confirmBtn, cancelBtn); dialog.append(title, closeButton, msgElement, buttonContainer); document.body.appendChild(dialog); makeDraggable(dialog,title); openDialogWithId(dialogId); }
    function createCustomAlertDialog(message, dialogId = "customAlertDialog") { closeCurrentlyOpenDialog(dialogId, true); const dialog = document.createElement("div"); dialog.id = dialogId; dialog.className = "customDialog customAlertDialog"; const title = createMenuHeader("Hinweis"); Object.assign(title.style, {marginTop:"-5px", marginBottom:"10px", fontSize:"16px"}); const closeButton = createDialogCloseButton(() => removeDialogFromOpenList(dialogId)); const msgElement = document.createElement("p"); msgElement.textContent = message; const buttonContainer = document.createElement("div"); buttonContainer.className = "customDialogButtonContainer"; const okBtn = createMenuButton("OK", () => removeDialogFromOpenList(dialogId)); okBtn.classList.add("confirm"); okBtn.style.backgroundColor = "#007bff"; buttonContainer.appendChild(okBtn); dialog.append(title, closeButton, msgElement, buttonContainer); document.body.appendChild(dialog); makeDraggable(dialog,title); openDialogWithId(dialogId); }
    function createPasswordDialog(correctPassword, onSuccessCallback, dialogId, onCancelCallback = null) { closeCurrentlyOpenDialog(dialogId, true); const enteredPassword = prompt("Passwort erforderlich:", ""); if (enteredPassword === null) { if (onCancelCallback) onCancelCallback(); } else if (enteredPassword === correctPassword) { onSuccessCallback(); } else { createCustomAlertDialog("Falsches Passwort!", "passwordErrorDialog"); } }
    function makeDraggable(elmnt, dragHeader = null) { let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; const headerToDrag = dragHeader || elmnt; if(headerToDrag) headerToDrag.style.cursor = 'move'; if(headerToDrag) headerToDrag.onmousedown = dragMouseDown; function dragMouseDown(e) { const targetTagName = e.target.tagName; if (targetTagName === 'BUTTON' || targetTagName === 'INPUT' || targetTagName === 'SELECT' || targetTagName === 'TEXTAREA' || e.target.isContentEditable || (e.target.closest && e.target.closest('.customMenuButton'))) { return; } e = e || window.event; pos3 = e.clientX; pos4 = e.clientY; document.onmouseup = closeDragElement; document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); pos1 = pos3 - e.clientX; pos2 = pos4 - e.clientY; pos3 = e.clientX; pos4 = e.clientY; elmnt.style.top = (elmnt.offsetTop - pos2) + "px"; elmnt.style.left = (elmnt.offsetLeft - pos1) + "px"; if (elmnt.classList.contains('customDialog') || elmnt.id === 'customProfileModderSubMenu' || elmnt.id === 'customRageSubMenu') { elmnt.style.transform = 'translate(0, 0) scale(1)'; } else { elmnt.style.transform = 'scale(1)'; } } function closeDragElement() { document.onmouseup = null; document.onmousemove = null; } }
    function showLoadingOverlay(message = "Lade...") { let overlay = document.getElementById("loadingOverlay"); if (!overlay) { overlay = document.createElement("div"); overlay.id = "loadingOverlay"; overlay.className = "loadingOverlay"; document.body.appendChild(overlay); } overlay.textContent = message; overlay.classList.add("visible"); }
    function hideLoadingOverlay() { const overlay = document.getElementById("loadingOverlay"); if (overlay) overlay.classList.remove("visible"); }

})();