Josiahiscool73

cloud gaming cheat v2

Mar 19th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.08 KB | None | 0 0
  1. // Virtual Xbox controller
  2. const virtualController = {
  3. axes: [0, 0, 0, 0],
  4. buttons: Array(17).fill({ pressed: false, value: 0 }),
  5. connected: true,
  6. id: "Virtual Xbox Controller (Enhanced)",
  7. index: 0,
  8. timestamp: performance.now(),
  9. mapping: "standard",
  10. vibrationActuator: { type: "dual-rumble", startDelay: 0, strongMagnitude: 0, weakMagnitude: 0 }
  11. };
  12.  
  13. // Controller and aim assist state
  14. let controllerInitialized = false;
  15. let aimAssistEnabled = true;
  16.  
  17. // Enhanced getGamepads override
  18. const originalGetGamepads = navigator.getGamepads;
  19. navigator.getGamepads = function() {
  20. const gamepads = Object.create(Array.prototype);
  21. if (aimAssistEnabled) {
  22. Object.defineProperty(gamepads, '0', { enumerable: true, value: virtualController });
  23. }
  24. for (let i = aimAssistEnabled ? 1 : 0; i < 4; i++) {
  25. Object.defineProperty(gamepads, i.toString(), { enumerable: true, value: null });
  26. }
  27. gamepads.length = 4;
  28. return gamepads;
  29. };
  30.  
  31. // Input variables with smoothing
  32. let moveX = 0, moveY = 0, aimX = 0, aimY = 0;
  33. let targetAimX = 0, targetAimY = 0, currentAimX = 0, currentAimY = 0;
  34. let aimSmoothing = 0.2, aimAcceleration = 1.5;
  35.  
  36. // Toggle states
  37. let ultraLowDelay = false, highBitrate = false, zoomIn = false, crosshairOn = false, speedHack = false;
  38. let zoomOut = false, zoomMore = false, macroEnabled = false, guiVisible = true;
  39.  
  40. // Macro configuration
  41. let editBindKey = null, selectEditBindKey = null;
  42. let configuringMacro = false, waitingForEditBind = false, waitingForSelectEditBind = false, macroActive = false;
  43.  
  44. // GUI setup
  45. const gui = document.createElement('div');
  46. gui.style.cssText = `
  47. position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.8); color: white;
  48. padding: 10px; z-index: 9999; font-family: Arial, sans-serif; border-radius: 5px;
  49. box-shadow: 0 0 10px rgba(0,0,0,0.5);
  50. `;
  51. document.body.appendChild(gui);
  52.  
  53. // Mini-indicator
  54. const miniIndicator = document.createElement('div');
  55. miniIndicator.style.cssText = `
  56. position: fixed; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.6); color: #00ff00;
  57. padding: 5px 10px; z-index: 9999; font-family: Arial, sans-serif; border-radius: 5px;
  58. box-shadow: 0 0 5px rgba(0,0,0,0.5); font-size: 12px; display: none;
  59. `;
  60. miniIndicator.innerHTML = 'Cloud Gaming Cheat [END]';
  61. document.body.appendChild(miniIndicator);
  62.  
  63. // Enhanced crosshair
  64. const enhancedCrosshair = document.createElement('div');
  65. enhancedCrosshair.style.cssText = `
  66. position: fixed; top: 50%; left: 50%; width: 24px; height: 24px;
  67. transform: translate(-50%, -50%); z-index: 9999; pointer-events: none; display: none;
  68. `;
  69. enhancedCrosshair.innerHTML = `
  70. <div style="position:absolute; top:50%; left:0; width:100%; height:2px; background:rgba(0,255,0,0.8); transform:translateY(-50%);"></div>
  71. <div style="position:absolute; top:0; left:50%; width:2px; height:100%; background:rgba(0,255,0,0.8); transform:translateX(-50%);"></div>
  72. <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>
  73. `;
  74. document.body.appendChild(enhancedCrosshair);
  75.  
  76. // Audio setup
  77. let audioContext, gainNode, bassFilter, audioSource;
  78. function setupAudio() {
  79. try {
  80. audioContext = new (window.AudioContext || window.webkitAudioContext)();
  81. gainNode = audioContext.createGain();
  82. gainNode.gain.value = 1;
  83. bassFilter = audioContext.createBiquadFilter();
  84. bassFilter.type = 'lowshelf';
  85. bassFilter.frequency.value = 200;
  86. bassFilter.gain.value = 0;
  87.  
  88. const waitForVideo = setInterval(() => {
  89. const video = document.querySelector('video');
  90. if (video) {
  91. clearInterval(waitForVideo);
  92. audioSource = audioContext.createMediaElementSource(video);
  93. audioSource.connect(gainNode).connect(bassFilter).connect(audioContext.destination);
  94. console.log("Audio hooked to video element successfully.");
  95. }
  96. }, 500);
  97.  
  98. setTimeout(() => {
  99. if (!audioSource && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
  100. console.log("No video found. Attempting tab audio capture...");
  101. navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
  102. audioSource = audioContext.createMediaStreamSource(stream);
  103. audioSource.connect(gainNode).connect(bassFilter).connect(audioContext.destination);
  104. console.log("Audio hooked via tab capture.");
  105. }).catch(e => console.error("Tab capture failed:", e));
  106. }
  107. }, 5000);
  108. } catch (e) {
  109. console.error("Audio setup failed:", e);
  110. }
  111. }
  112. setupAudio();
  113.  
  114. // Anti-throttling with smoother keep-alive
  115. const keepAliveAudio = new Audio('data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=');
  116. keepAliveAudio.loop = true;
  117. keepAliveAudio.volume = 0.01;
  118. const keepAliveCanvas = document.createElement('canvas');
  119. keepAliveCanvas.style.cssText = 'position:absolute; top:-9999px; left:-9999px;';
  120. document.body.appendChild(keepAliveCanvas);
  121. const ctx = keepAliveCanvas.getContext('2d');
  122. function activateKeepAlive() {
  123. if (ultraLowDelay) {
  124. keepAliveAudio.play().catch(e => console.log("Keep-alive audio failed:", e));
  125. if (!window._keepAliveAnimation) {
  126. function animateKeepAlive() {
  127. ctx.clearRect(0, 0, 1, 1);
  128. ctx.fillStyle = '#000';
  129. ctx.fillRect(0, 0, 1, 1);
  130. virtualController.timestamp = performance.now();
  131. if (ultraLowDelay) requestAnimationFrame(animateKeepAlive);
  132. }
  133. window._keepAliveAnimation = requestAnimationFrame(animateKeepAlive);
  134. }
  135. } else {
  136. keepAliveAudio.pause();
  137. if (window._keepAliveAnimation) {
  138. cancelAnimationFrame(window._keepAliveAnimation);
  139. window._keepAliveAnimation = null;
  140. }
  141. }
  142. }
  143.  
  144. // Toggle GUI visibility
  145. function toggleGUI() {
  146. guiVisible = !guiVisible;
  147. gui.style.display = guiVisible ? 'block' : 'none';
  148. miniIndicator.style.display = guiVisible ? 'none' : 'block';
  149. }
  150.  
  151. // Video styling with smoothness
  152. function updateVideoStyle() {
  153. const videos = document.querySelectorAll('video');
  154. videos.forEach(video => {
  155. video.style.filter = highBitrate ? 'contrast(115%) saturate(105%) brightness(102%)' : '';
  156. video.style.imageRendering = highBitrate ? 'crisp-edges' : 'auto';
  157. let scale = zoomMore ? 2 : zoomIn ? 1.5 : zoomOut ? 0.75 : 1;
  158. video.style.transform = `scale(${scale})`;
  159. video.style.transition = ultraLowDelay ? 'transform 0.05s linear' : 'transform 0.1s ease';
  160. video.style.willChange = 'transform, filter';
  161. video.style.backfaceVisibility = 'hidden';
  162. video.style.transformStyle = 'preserve-3d'; // Force GPU acceleration
  163. });
  164. }
  165.  
  166. // Update GUI display
  167. function updateGUIDisplay() {
  168. let macroStatus = macroEnabled ? 'ON' : 'OFF';
  169. if (macroEnabled) {
  170. if (waitingForEditBind) macroStatus = 'Press edit key...';
  171. else if (waitingForSelectEditBind) macroStatus = 'Press select edit key...';
  172. else if (editBindKey && selectEditBindKey) macroStatus = `ON [${editBindKey} + ${selectEditBindKey}]`;
  173. }
  174. gui.innerHTML = `
  175. <h3 style="margin: 0; font-size: 16px; color: #00ff00;">Cloud Gaming Cheat</h3>
  176. <div style="margin: 5px 0; height: 1px; background: rgba(255,255,255,0.3);"></div>
  177. <p>Ultra Low Delay [I]: <span style="color:${ultraLowDelay ? '#00ff00' : '#ff0000'}">${ultraLowDelay ? 'ON' : 'OFF'}</span></p>
  178. <p>Higher Bitrate [O]: <span style="color:${highBitrate ? '#00ff00' : '#ff0000'}">${highBitrate ? 'ON' : 'OFF'}</span></p>
  179. <p>Zoom In [P]: <span style="color:${zoomIn ? '#00ff00' : '#ff0000'}">${zoomIn ? 'ON' : 'OFF'}</span></p>
  180. <p>Zoom Out [L]: <span style="color:${zoomOut ? '#00ff00' : '#ff0000'}">${zoomOut ? 'ON' : 'OFF'}</span></p>
  181. <p>Zoom More [;]: <span style="color:${zoomMore ? '#00ff00' : '#ff0000'}">${zoomMore ? 'ON' : 'OFF'}</span></p>
  182. <p>Crosshair [K]: <span style="color:${crosshairOn ? '#00ff00' : '#ff0000'}">${crosshairOn ? 'ON' : 'OFF'}</span></p>
  183. <p>Speed Hack [U]: <span style="color:${speedHack ? '#00ff00' : '#ff0000'}">${speedHack ? 'ON' : 'OFF'}</span></p>
  184. <p>Controller [J]: <span style="color:${aimAssistEnabled ? '#00ff00' : '#ff0000'}">${aimAssistEnabled ? 'ON' : 'OFF'}</span></p>
  185. <p>Macro [M]: <span style="color:${macroEnabled ? '#00ff00' : '#ff0000'}">${macroStatus}</span></p>
  186. <p>Hold V for Volume Boost</p>
  187. <p style="font-size:12px;color:#aaa">Use G to activate edit macro</p>
  188. <p style="font-size:12px;color:#aaa">Press END to toggle this UI</p>
  189. `;
  190. }
  191.  
  192. // Controller state update
  193. function updateController() {
  194. virtualController.timestamp = performance.now();
  195. if (Math.abs(targetAimX - currentAimX) > 0.01 || Math.abs(targetAimY - currentAimY) > 0.01) {
  196. const distX = targetAimX - currentAimX, distY = targetAimY - currentAimY;
  197. const accelX = Math.sign(distX) * Math.min(Math.abs(distX) * aimAcceleration, Math.abs(distX));
  198. const accelY = Math.sign(distY) * Math.min(Math.abs(distY) * aimAcceleration, Math.abs(distY));
  199. currentAimX += accelX * aimSmoothing;
  200. currentAimY += accelY * aimSmoothing;
  201. }
  202. virtualController.axes[0] = moveX;
  203. virtualController.axes[1] = moveY;
  204. virtualController.axes[2] = currentAimX;
  205. virtualController.axes[3] = currentAimY;
  206. if (aimAssistEnabled && !controllerInitialized) initializeController();
  207. }
  208.  
  209. // Controller initialization
  210. function initializeController() {
  211. const connectEvent = new Event('gamepadconnected');
  212. Object.defineProperty(connectEvent, 'gamepad', { value: virtualController });
  213. window.dispatchEvent(connectEvent);
  214. controllerInitialized = true;
  215. console.log("Controller initialized.");
  216. }
  217.  
  218. // Ultra-fast 5ms macro
  219. function executeMacro() {
  220. if (!macroEnabled || !editBindKey || !selectEditBindKey) return;
  221. console.log("Executing ultra-fast macro with Edit:", editBindKey, "Select:", selectEditBindKey);
  222.  
  223. const targetElement = document.activeElement || document.body;
  224.  
  225. const editDown = new KeyboardEvent('keydown', {
  226. key: editBindKey,
  227. code: `Key${editBindKey.toUpperCase()}`,
  228. keyCode: editBindKey.toUpperCase().charCodeAt(0),
  229. bubbles: true,
  230. cancelable: true
  231. });
  232. targetElement.dispatchEvent(editDown);
  233.  
  234. setTimeout(() => {
  235. const selectDown = new KeyboardEvent('keydown', {
  236. key: selectEditBindKey,
  237. code: `Key${selectEditBindKey.toUpperCase()}`,
  238. keyCode: selectEditBindKey.toUpperCase().charCodeAt(0),
  239. bubbles: true,
  240. cancelable: true
  241. });
  242. targetElement.dispatchEvent(selectDown);
  243.  
  244. const clickEvent = new MouseEvent('click', {
  245. button: 0,
  246. buttons: 1,
  247. clientX: window.innerWidth / 2,
  248. clientY: window.innerHeight / 2,
  249. bubbles: true,
  250. cancelable: true
  251. });
  252. targetElement.dispatchEvent(clickEvent);
  253.  
  254. setTimeout(() => {
  255. const editUp = new KeyboardEvent('keyup', {
  256. key: editBindKey,
  257. code: `Key${editBindKey.toUpperCase()}`,
  258. keyCode: editBindKey.toUpperCase().charCodeAt(0),
  259. bubbles: true,
  260. cancelable: true
  261. });
  262. const selectUp = new KeyboardEvent('keyup', {
  263. key: selectEditBindKey,
  264. code: `Key${selectEditBindKey.toUpperCase()}`,
  265. keyCode: selectEditBindKey.toUpperCase().charCodeAt(0),
  266. bubbles: true,
  267. cancelable: true
  268. });
  269. targetElement.dispatchEvent(editUp);
  270. targetElement.dispatchEvent(selectUp);
  271. console.log("Ultra-fast macro completed.");
  272. }, 20);
  273. }, 5); // 5ms delay
  274. }
  275.  
  276. // Macro configuration
  277. function configureMacro() {
  278. if (!macroEnabled) return;
  279. if (!editBindKey) {
  280. waitingForEditBind = true;
  281. waitingForSelectEditBind = false;
  282. updateGUIDisplay();
  283. return;
  284. }
  285. if (!selectEditBindKey) {
  286. waitingForEditBind = false;
  287. waitingForSelectEditBind = true;
  288. updateGUIDisplay();
  289. return;
  290. }
  291. waitingForEditBind = false;
  292. waitingForSelectEditBind = false;
  293. updateGUIDisplay();
  294. }
  295.  
  296. // Input handler with lower latency
  297. let lastInputTime = 0;
  298. const debounceDelay = ultraLowDelay ? 2 : 5; // Tighter debounce in ultra low delay mode
  299. document.addEventListener('keydown', (e) => {
  300. const now = performance.now();
  301. if (now - lastInputTime < debounceDelay) return;
  302. lastInputTime = now;
  303.  
  304. if (e.key === 'End') {
  305. toggleGUI();
  306. e.preventDefault();
  307. return;
  308. }
  309.  
  310. if (waitingForEditBind) {
  311. editBindKey = e.key.toLowerCase();
  312. configureMacro();
  313. e.preventDefault();
  314. return;
  315. }
  316. if (waitingForSelectEditBind) {
  317. selectEditBindKey = e.key.toLowerCase();
  318. configureMacro();
  319. e.preventDefault();
  320. return;
  321. }
  322.  
  323. if (e.key.toLowerCase() === 'g' && macroEnabled && editBindKey && selectEditBindKey) {
  324. macroActive = true;
  325. executeMacro();
  326. e.preventDefault();
  327. return;
  328. }
  329.  
  330. e.preventDefault();
  331. switch (e.key.toLowerCase()) {
  332. case 'w': moveY = -1; break;
  333. case 's': moveY = 1; break;
  334. case 'a': moveX = -1; break;
  335. case 'd': moveX = 1; break;
  336. case 'shift': virtualController.buttons[10].pressed = true; virtualController.buttons[10].value = 1; break;
  337. case 't': virtualController.buttons[6].pressed = true; virtualController.buttons[6].value = 1; break;
  338. case 'arrowup': targetAimY = -1; break;
  339. case 'arrowdown': targetAimY = 1; break;
  340. case 'arrowleft': targetAimX = -1; break;
  341. case 'arrowright': targetAimX = 1; break;
  342. case ' ': virtualController.buttons[7].pressed = true; virtualController.buttons[7].value = 1; break;
  343. case 'v':
  344. if (gainNode && bassFilter) {
  345. gainNode.gain.value = 2.5;
  346. bassFilter.gain.value = 15;
  347. console.log("Volume Boost + Bass ON");
  348. } else {
  349. console.log("Audio not hooked yet.");
  350. }
  351. break;
  352. case 'i':
  353. ultraLowDelay = !ultraLowDelay;
  354. activateKeepAlive();
  355. updateVideoStyle();
  356. updateGUIDisplay();
  357. console.log("Ultra Low Delay:", ultraLowDelay ? "ON (125Hz, smooth)" : "OFF (60Hz)");
  358. break;
  359. case 'o': highBitrate = !highBitrate; updateVideoStyle(); updateGUIDisplay(); break;
  360. case 'p': zoomIn = !zoomIn; if (zoomIn) { zoomOut = false; zoomMore = false; } updateVideoStyle(); updateGUIDisplay(); break;
  361. case 'l': zoomOut = !zoomOut; if (zoomOut) { zoomIn = false; zoomMore = false; } updateVideoStyle(); updateGUIDisplay(); break;
  362. case ';': zoomMore = !zoomMore; if (zoomMore) { zoomIn = false; zoomOut = false; } updateVideoStyle(); updateGUIDisplay(); break;
  363. case 'k': crosshairOn = !crosshairOn; enhancedCrosshair.style.display = crosshairOn ? 'block' : 'none'; updateGUIDisplay(); break;
  364. case 'u': speedHack = !speedHack; document.querySelectorAll('video').forEach(v => v.playbackRate = speedHack ? 1.5 : 1); updateGUIDisplay(); break;
  365. case 'j':
  366. aimAssistEnabled = !aimAssistEnabled;
  367. if (!aimAssistEnabled && controllerInitialized) {
  368. const disconnectEvent = new Event('gamepaddisconnected');
  369. Object.defineProperty(disconnectEvent, 'gamepad', { value: virtualController });
  370. window.dispatchEvent(disconnectEvent);
  371. controllerInitialized = false;
  372. }
  373. updateGUIDisplay();
  374. break;
  375. case 'm':
  376. macroEnabled = !macroEnabled;
  377. if (macroEnabled) { editBindKey = null; selectEditBindKey = null; configureMacro(); } else { waitingForEditBind = false; waitingForSelectEditBind = false; }
  378. updateGUIDisplay();
  379. break;
  380. }
  381. updateController();
  382. });
  383.  
  384. document.addEventListener('keyup', (e) => {
  385. const now = performance.now();
  386. if (now - lastInputTime < debounceDelay) return;
  387. lastInputTime = now;
  388.  
  389. if (e.key.toLowerCase() === 'g' && macroActive) macroActive = false;
  390.  
  391. e.preventDefault();
  392. switch (e.key.toLowerCase()) {
  393. case 'w': case 's': moveY = 0; break;
  394. case 'a': case 'd': moveX = 0; break;
  395. case 'shift': virtualController.buttons[10].pressed = false; virtualController.buttons[10].value = 0; break;
  396. case 't': virtualController.buttons[6].pressed = false; virtualController.buttons[6].value = 0; break;
  397. case 'arrowup': case 'arrowdown': targetAimY = 0; break;
  398. case 'arrowleft': case 'arrowright': targetAimX = 0; break;
  399. case ' ': virtualController.buttons[7].pressed = false; virtualController.buttons[7].value = 0; break;
  400. case 'v':
  401. if (gainNode && bassFilter) {
  402. gainNode.gain.value = 1;
  403. bassFilter.gain.value = 0;
  404. console.log("Volume Boost + Bass OFF");
  405. }
  406. break;
  407. }
  408. updateController();
  409. });
  410.  
  411. // Optimized update loop
  412. let lastUpdateTime = 0;
  413. function updateLoop(timestamp) {
  414. const timeDelta = timestamp - lastUpdateTime;
  415. const updateInterval = ultraLowDelay ? 8 : 16; // 125Hz vs 60Hz
  416. if (timeDelta >= updateInterval) {
  417. lastUpdateTime = timestamp;
  418. updateController();
  419. }
  420. requestAnimationFrame(updateLoop);
  421. }
  422.  
  423. // Initialize
  424. updateGUIDisplay();
  425. requestAnimationFrame(updateLoop);
  426. console.log("Cloud Gaming Cheat with smooth ultra low delay and 5ms macro active.");
Add Comment
Please, Sign In to add comment