Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Virtual Xbox controller
- const virtualController = {
- axes: [0, 0, 0, 0],
- buttons: Array(17).fill({ pressed: false, value: 0 }),
- connected: true,
- id: "Virtual Xbox Controller (Enhanced)",
- index: 0,
- timestamp: performance.now(),
- mapping: "standard",
- vibrationActuator: { type: "dual-rumble", startDelay: 0, strongMagnitude: 0, weakMagnitude: 0 }
- };
- // Controller and aim assist state
- let controllerInitialized = false;
- let aimAssistEnabled = true;
- // Enhanced getGamepads override
- const originalGetGamepads = navigator.getGamepads;
- navigator.getGamepads = function() {
- const gamepads = Object.create(Array.prototype);
- if (aimAssistEnabled) {
- Object.defineProperty(gamepads, '0', { enumerable: true, value: virtualController });
- }
- for (let i = aimAssistEnabled ? 1 : 0; i < 4; i++) {
- Object.defineProperty(gamepads, i.toString(), { enumerable: true, value: null });
- }
- gamepads.length = 4;
- return gamepads;
- };
- // Input variables with smoothing
- let moveX = 0, moveY = 0, aimX = 0, aimY = 0;
- let targetAimX = 0, targetAimY = 0, currentAimX = 0, currentAimY = 0;
- let aimSmoothing = 0.2, aimAcceleration = 1.5;
- // Toggle states
- let ultraLowDelay = false, highBitrate = false, zoomIn = false, crosshairOn = false, speedHack = false;
- let zoomOut = false, zoomMore = false, macroEnabled = false, guiVisible = true;
- // Macro configuration
- let editBindKey = null, selectEditBindKey = null;
- let configuringMacro = false, waitingForEditBind = false, waitingForSelectEditBind = false, macroActive = false;
- // GUI setup
- const gui = document.createElement('div');
- gui.style.cssText = `
- position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.8); color: white;
- padding: 10px; z-index: 9999; font-family: Arial, sans-serif; border-radius: 5px;
- box-shadow: 0 0 10px rgba(0,0,0,0.5);
- `;
- document.body.appendChild(gui);
- // Mini-indicator
- const miniIndicator = document.createElement('div');
- miniIndicator.style.cssText = `
- position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.6); color: #00ff00;
- padding: 5px 10px; z-index: 9999; font-family: Arial, sans-serif; border-radius: 5px;
- box-shadow: 0 0 5px rgba(0,0,0,0.5); font-size: 12px; display: none;
- `;
- miniIndicator.innerHTML = 'Cloud Gaming Cheat [END]';
- document.body.appendChild(miniIndicator);
- // Enhanced crosshair
- const enhancedCrosshair = document.createElement('div');
- enhancedCrosshair.style.cssText = `
- position: fixed; top: 50%; left: 50%; width: 24px; height: 24px;
- transform: translate(-50%, -50%); z-index: 9999; pointer-events: none; display: none;
- `;
- enhancedCrosshair.innerHTML = `
- <div style="position:absolute; top:50%; left:0; width:100%; height:2px; background:rgba(0,255,0,0.8); transform:translateY(-50%);"></div>
- <div style="position:absolute; top:0; left:50%; width:2px; height:100%; background:rgba(0,255,0,0.8); transform:translateX(-50%);"></div>
- <div style="position:absolute; top:50%; left:50%; width:4px; height:4px; background:rgba(255,0,0,0.8); border-radius:50%; transform:translate(-50%, -50%);"></div>
- `;
- document.body.appendChild(enhancedCrosshair);
- // Audio setup
- let audioContext, gainNode, bassFilter, audioSource;
- function setupAudio() {
- try {
- audioContext = new (window.AudioContext || window.webkitAudioContext)();
- gainNode = audioContext.createGain();
- gainNode.gain.value = 1;
- bassFilter = audioContext.createBiquadFilter();
- bassFilter.type = 'lowshelf';
- bassFilter.frequency.value = 200;
- bassFilter.gain.value = 0;
- const waitForVideo = setInterval(() => {
- const video = document.querySelector('video');
- if (video) {
- clearInterval(waitForVideo);
- audioSource = audioContext.createMediaElementSource(video);
- audioSource.connect(gainNode).connect(bassFilter).connect(audioContext.destination);
- console.log("Audio hooked to video element successfully.");
- }
- }, 500);
- setTimeout(() => {
- if (!audioSource && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
- console.log("No video found. Attempting tab audio capture...");
- navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
- audioSource = audioContext.createMediaStreamSource(stream);
- audioSource.connect(gainNode).connect(bassFilter).connect(audioContext.destination);
- console.log("Audio hooked via tab capture.");
- }).catch(e => console.error("Tab capture failed:", e));
- }
- }, 5000);
- } catch (e) {
- console.error("Audio setup failed:", e);
- }
- }
- setupAudio();
- // Anti-throttling with smoother keep-alive
- const keepAliveAudio = new Audio('data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=');
- keepAliveAudio.loop = true;
- keepAliveAudio.volume = 0.01;
- const keepAliveCanvas = document.createElement('canvas');
- keepAliveCanvas.style.cssText = 'position:absolute; top:-9999px; left:-9999px;';
- document.body.appendChild(keepAliveCanvas);
- const ctx = keepAliveCanvas.getContext('2d');
- function activateKeepAlive() {
- if (ultraLowDelay) {
- keepAliveAudio.play().catch(e => console.log("Keep-alive audio failed:", e));
- if (!window._keepAliveAnimation) {
- function animateKeepAlive() {
- ctx.clearRect(0, 0, 1, 1);
- ctx.fillStyle = '#000';
- ctx.fillRect(0, 0, 1, 1);
- virtualController.timestamp = performance.now();
- if (ultraLowDelay) requestAnimationFrame(animateKeepAlive);
- }
- window._keepAliveAnimation = requestAnimationFrame(animateKeepAlive);
- }
- } else {
- keepAliveAudio.pause();
- if (window._keepAliveAnimation) {
- cancelAnimationFrame(window._keepAliveAnimation);
- window._keepAliveAnimation = null;
- }
- }
- }
- // Toggle GUI visibility
- function toggleGUI() {
- guiVisible = !guiVisible;
- gui.style.display = guiVisible ? 'block' : 'none';
- miniIndicator.style.display = guiVisible ? 'none' : 'block';
- }
- // Video styling with smoothness
- function updateVideoStyle() {
- const videos = document.querySelectorAll('video');
- videos.forEach(video => {
- video.style.filter = highBitrate ? 'contrast(115%) saturate(105%) brightness(102%)' : '';
- video.style.imageRendering = highBitrate ? 'crisp-edges' : 'auto';
- let scale = zoomMore ? 2 : zoomIn ? 1.5 : zoomOut ? 0.75 : 1;
- video.style.transform = `scale(${scale})`;
- video.style.transition = ultraLowDelay ? 'transform 0.05s linear' : 'transform 0.1s ease';
- video.style.willChange = 'transform, filter';
- video.style.backfaceVisibility = 'hidden';
- video.style.transformStyle = 'preserve-3d'; // Force GPU acceleration
- });
- }
- // Update GUI display
- function updateGUIDisplay() {
- let macroStatus = macroEnabled ? 'ON' : 'OFF';
- if (macroEnabled) {
- if (waitingForEditBind) macroStatus = 'Press edit key...';
- else if (waitingForSelectEditBind) macroStatus = 'Press select edit key...';
- else if (editBindKey && selectEditBindKey) macroStatus = `ON [${editBindKey} + ${selectEditBindKey}]`;
- }
- gui.innerHTML = `
- <h3 style="margin: 0; font-size: 16px; color: #00ff00;">Cloud Gaming Cheat</h3>
- <div style="margin: 5px 0; height: 1px; background: rgba(255,255,255,0.3);"></div>
- <p>Ultra Low Delay [I]: <span style="color:${ultraLowDelay ? '#00ff00' : '#ff0000'}">${ultraLowDelay ? 'ON' : 'OFF'}</span></p>
- <p>Higher Bitrate [O]: <span style="color:${highBitrate ? '#00ff00' : '#ff0000'}">${highBitrate ? 'ON' : 'OFF'}</span></p>
- <p>Zoom In [P]: <span style="color:${zoomIn ? '#00ff00' : '#ff0000'}">${zoomIn ? 'ON' : 'OFF'}</span></p>
- <p>Zoom Out [L]: <span style="color:${zoomOut ? '#00ff00' : '#ff0000'}">${zoomOut ? 'ON' : 'OFF'}</span></p>
- <p>Zoom More [;]: <span style="color:${zoomMore ? '#00ff00' : '#ff0000'}">${zoomMore ? 'ON' : 'OFF'}</span></p>
- <p>Crosshair [K]: <span style="color:${crosshairOn ? '#00ff00' : '#ff0000'}">${crosshairOn ? 'ON' : 'OFF'}</span></p>
- <p>Speed Hack [U]: <span style="color:${speedHack ? '#00ff00' : '#ff0000'}">${speedHack ? 'ON' : 'OFF'}</span></p>
- <p>Controller [J]: <span style="color:${aimAssistEnabled ? '#00ff00' : '#ff0000'}">${aimAssistEnabled ? 'ON' : 'OFF'}</span></p>
- <p>Macro [M]: <span style="color:${macroEnabled ? '#00ff00' : '#ff0000'}">${macroStatus}</span></p>
- <p>Hold V for Volume Boost</p>
- <p style="font-size:12px;color:#aaa">Use G to activate edit macro</p>
- <p style="font-size:12px;color:#aaa">Press END to toggle this UI</p>
- `;
- }
- // Controller state update
- function updateController() {
- virtualController.timestamp = performance.now();
- if (Math.abs(targetAimX - currentAimX) > 0.01 || Math.abs(targetAimY - currentAimY) > 0.01) {
- const distX = targetAimX - currentAimX, distY = targetAimY - currentAimY;
- const accelX = Math.sign(distX) * Math.min(Math.abs(distX) * aimAcceleration, Math.abs(distX));
- const accelY = Math.sign(distY) * Math.min(Math.abs(distY) * aimAcceleration, Math.abs(distY));
- currentAimX += accelX * aimSmoothing;
- currentAimY += accelY * aimSmoothing;
- }
- virtualController.axes[0] = moveX;
- virtualController.axes[1] = moveY;
- virtualController.axes[2] = currentAimX;
- virtualController.axes[3] = currentAimY;
- if (aimAssistEnabled && !controllerInitialized) initializeController();
- }
- // Controller initialization
- function initializeController() {
- const connectEvent = new Event('gamepadconnected');
- Object.defineProperty(connectEvent, 'gamepad', { value: virtualController });
- window.dispatchEvent(connectEvent);
- controllerInitialized = true;
- console.log("Controller initialized.");
- }
- // Ultra-fast 5ms macro
- function executeMacro() {
- if (!macroEnabled || !editBindKey || !selectEditBindKey) return;
- console.log("Executing ultra-fast macro with Edit:", editBindKey, "Select:", selectEditBindKey);
- const targetElement = document.activeElement || document.body;
- const editDown = new KeyboardEvent('keydown', {
- key: editBindKey,
- code: `Key${editBindKey.toUpperCase()}`,
- keyCode: editBindKey.toUpperCase().charCodeAt(0),
- bubbles: true,
- cancelable: true
- });
- targetElement.dispatchEvent(editDown);
- setTimeout(() => {
- const selectDown = new KeyboardEvent('keydown', {
- key: selectEditBindKey,
- code: `Key${selectEditBindKey.toUpperCase()}`,
- keyCode: selectEditBindKey.toUpperCase().charCodeAt(0),
- bubbles: true,
- cancelable: true
- });
- targetElement.dispatchEvent(selectDown);
- const clickEvent = new MouseEvent('click', {
- button: 0,
- buttons: 1,
- clientX: window.innerWidth / 2,
- clientY: window.innerHeight / 2,
- bubbles: true,
- cancelable: true
- });
- targetElement.dispatchEvent(clickEvent);
- setTimeout(() => {
- const editUp = new KeyboardEvent('keyup', {
- key: editBindKey,
- code: `Key${editBindKey.toUpperCase()}`,
- keyCode: editBindKey.toUpperCase().charCodeAt(0),
- bubbles: true,
- cancelable: true
- });
- const selectUp = new KeyboardEvent('keyup', {
- key: selectEditBindKey,
- code: `Key${selectEditBindKey.toUpperCase()}`,
- keyCode: selectEditBindKey.toUpperCase().charCodeAt(0),
- bubbles: true,
- cancelable: true
- });
- targetElement.dispatchEvent(editUp);
- targetElement.dispatchEvent(selectUp);
- console.log("Ultra-fast macro completed.");
- }, 20);
- }, 5); // 5ms delay
- }
- // Macro configuration
- function configureMacro() {
- if (!macroEnabled) return;
- if (!editBindKey) {
- waitingForEditBind = true;
- waitingForSelectEditBind = false;
- updateGUIDisplay();
- return;
- }
- if (!selectEditBindKey) {
- waitingForEditBind = false;
- waitingForSelectEditBind = true;
- updateGUIDisplay();
- return;
- }
- waitingForEditBind = false;
- waitingForSelectEditBind = false;
- updateGUIDisplay();
- }
- // Input handler with lower latency
- let lastInputTime = 0;
- const debounceDelay = ultraLowDelay ? 2 : 5; // Tighter debounce in ultra low delay mode
- document.addEventListener('keydown', (e) => {
- const now = performance.now();
- if (now - lastInputTime < debounceDelay) return;
- lastInputTime = now;
- if (e.key === 'End') {
- toggleGUI();
- e.preventDefault();
- return;
- }
- if (waitingForEditBind) {
- editBindKey = e.key.toLowerCase();
- configureMacro();
- e.preventDefault();
- return;
- }
- if (waitingForSelectEditBind) {
- selectEditBindKey = e.key.toLowerCase();
- configureMacro();
- e.preventDefault();
- return;
- }
- if (e.key.toLowerCase() === 'g' && macroEnabled && editBindKey && selectEditBindKey) {
- macroActive = true;
- executeMacro();
- e.preventDefault();
- return;
- }
- e.preventDefault();
- switch (e.key.toLowerCase()) {
- case 'w': moveY = -1; break;
- case 's': moveY = 1; break;
- case 'a': moveX = -1; break;
- case 'd': moveX = 1; break;
- case 'shift': virtualController.buttons[10].pressed = true; virtualController.buttons[10].value = 1; break;
- case 't': virtualController.buttons[6].pressed = true; virtualController.buttons[6].value = 1; break;
- case 'arrowup': targetAimY = -1; break;
- case 'arrowdown': targetAimY = 1; break;
- case 'arrowleft': targetAimX = -1; break;
- case 'arrowright': targetAimX = 1; break;
- case ' ': virtualController.buttons[7].pressed = true; virtualController.buttons[7].value = 1; break;
- case 'v':
- if (gainNode && bassFilter) {
- gainNode.gain.value = 2.5;
- bassFilter.gain.value = 15;
- console.log("Volume Boost + Bass ON");
- } else {
- console.log("Audio not hooked yet.");
- }
- break;
- case 'i':
- ultraLowDelay = !ultraLowDelay;
- activateKeepAlive();
- updateVideoStyle();
- updateGUIDisplay();
- console.log("Ultra Low Delay:", ultraLowDelay ? "ON (125Hz, smooth)" : "OFF (60Hz)");
- break;
- case 'o': highBitrate = !highBitrate; updateVideoStyle(); updateGUIDisplay(); break;
- case 'p': zoomIn = !zoomIn; if (zoomIn) { zoomOut = false; zoomMore = false; } updateVideoStyle(); updateGUIDisplay(); break;
- case 'l': zoomOut = !zoomOut; if (zoomOut) { zoomIn = false; zoomMore = false; } updateVideoStyle(); updateGUIDisplay(); break;
- case ';': zoomMore = !zoomMore; if (zoomMore) { zoomIn = false; zoomOut = false; } updateVideoStyle(); updateGUIDisplay(); break;
- case 'k': crosshairOn = !crosshairOn; enhancedCrosshair.style.display = crosshairOn ? 'block' : 'none'; updateGUIDisplay(); break;
- case 'u': speedHack = !speedHack; document.querySelectorAll('video').forEach(v => v.playbackRate = speedHack ? 1.5 : 1); updateGUIDisplay(); break;
- case 'j':
- aimAssistEnabled = !aimAssistEnabled;
- if (!aimAssistEnabled && controllerInitialized) {
- const disconnectEvent = new Event('gamepaddisconnected');
- Object.defineProperty(disconnectEvent, 'gamepad', { value: virtualController });
- window.dispatchEvent(disconnectEvent);
- controllerInitialized = false;
- }
- updateGUIDisplay();
- break;
- case 'm':
- macroEnabled = !macroEnabled;
- if (macroEnabled) { editBindKey = null; selectEditBindKey = null; configureMacro(); } else { waitingForEditBind = false; waitingForSelectEditBind = false; }
- updateGUIDisplay();
- break;
- }
- updateController();
- });
- document.addEventListener('keyup', (e) => {
- const now = performance.now();
- if (now - lastInputTime < debounceDelay) return;
- lastInputTime = now;
- if (e.key.toLowerCase() === 'g' && macroActive) macroActive = false;
- e.preventDefault();
- switch (e.key.toLowerCase()) {
- case 'w': case 's': moveY = 0; break;
- case 'a': case 'd': moveX = 0; break;
- case 'shift': virtualController.buttons[10].pressed = false; virtualController.buttons[10].value = 0; break;
- case 't': virtualController.buttons[6].pressed = false; virtualController.buttons[6].value = 0; break;
- case 'arrowup': case 'arrowdown': targetAimY = 0; break;
- case 'arrowleft': case 'arrowright': targetAimX = 0; break;
- case ' ': virtualController.buttons[7].pressed = false; virtualController.buttons[7].value = 0; break;
- case 'v':
- if (gainNode && bassFilter) {
- gainNode.gain.value = 1;
- bassFilter.gain.value = 0;
- console.log("Volume Boost + Bass OFF");
- }
- break;
- }
- updateController();
- });
- // Optimized update loop
- let lastUpdateTime = 0;
- function updateLoop(timestamp) {
- const timeDelta = timestamp - lastUpdateTime;
- const updateInterval = ultraLowDelay ? 8 : 16; // 125Hz vs 60Hz
- if (timeDelta >= updateInterval) {
- lastUpdateTime = timestamp;
- updateController();
- }
- requestAnimationFrame(updateLoop);
- }
- // Initialize
- updateGUIDisplay();
- requestAnimationFrame(updateLoop);
- console.log("Cloud Gaming Cheat with smooth ultra low delay and 5ms macro active.");
Add Comment
Please, Sign In to add comment