Canadian100's client (survev.io)

Aimbot, Auto-Shoot, Spinbot, Explosive Warning, Red Lines, See Through Buildings, Enemy Health Bars for Survev.io with GUI toggle system, brightness changer, opacity changerr, fps regualtor, and other key features.

  1. // ==UserScript==
  2. // @name Canadian100's client (survev.io)
  3. // @namespace http://tampermonkey.net/
  4. // @version 4.5
  5. // @description Aimbot, Auto-Shoot, Spinbot, Explosive Warning, Red Lines, See Through Buildings, Enemy Health Bars for Survev.io with GUI toggle system, brightness changer, opacity changerr, fps regualtor, and other key features.
  6. // @author Canadian100
  7. // @match *://survev.io/*
  8. // @grant unsafeWindow
  9. // @run-at document-end
  10. // ==/UserScript==
  11. (function () {
  12. // Default feature states
  13. let espEnabled = false;
  14. let aimbotEnabled = false;
  15. let autoShootEnabled = false;
  16. let spinbotEnabled = false;
  17. let explosiveWarningEnabled = true;
  18. let drawEnemyLines = false;
  19. let seeThroughBuildingsEnabled = false;
  20. let showHealthBars = false;
  21. let meleeAimbotEnabled = false;
  22.  
  23. // FPS and Ping variables
  24. let fps = 0;
  25. let ping = 0;
  26. let lastTime = performance.now();
  27. let frames = 0;
  28.  
  29. // Canvas Overlay Setup
  30. const canvas = document.createElement('canvas');
  31. canvas.style.position = 'fixed';
  32. canvas.style.top = '0';
  33. canvas.style.left = '0';
  34. canvas.style.pointerEvents = 'none';
  35. canvas.style.zIndex = '9998';
  36. document.body.appendChild(canvas);
  37. const ctx = canvas.getContext('2d');
  38.  
  39. // Update Canvas Size
  40. function updateCanvasSize() {
  41. canvas.width = window.innerWidth;
  42. canvas.height = window.innerHeight;
  43. }
  44. window.addEventListener('resize', updateCanvasSize);
  45. updateCanvasSize();
  46. // FPS Calculation
  47. function updateFPS() {
  48. const currentTime = performance.now();
  49. frames++;
  50. if (currentTime - lastTime >= 1000) {
  51. fps = frames;
  52. frames = 0;
  53. lastTime = currentTime;
  54. }
  55. }
  56.  
  57. // Ping Calculation
  58. function updatePing() {
  59. const startTime = performance.now();
  60. fetch("https://www.google.com/")
  61. .then(response => response.text())
  62. .then(() => {
  63. const endTime = performance.now();
  64. ping = endTime - startTime;
  65. })
  66. .catch(() => ping = 0);
  67. }
  68.  
  69. // Stats Box Setup
  70. const statsBox = document.createElement('div');
  71. statsBox.style.position = 'fixed';
  72. statsBox.style.top = '300px';
  73. statsBox.style.left = '20px';
  74. statsBox.style.padding = '15px';
  75. statsBox.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  76. statsBox.style.borderRadius = '10px';
  77. statsBox.style.color = 'white';
  78. statsBox.style.fontFamily = 'Arial, sans-serif';
  79. statsBox.style.zIndex = '9999';
  80. statsBox.style.boxShadow = '0 0 10px rgba(255, 255, 255, 0.5)';
  81. document.body.appendChild(statsBox);
  82. const fpsElement = document.createElement('div');
  83. const pingElement = document.createElement('div');
  84. const killsElement = document.createElement('div');
  85.  
  86. fpsElement.style.fontSize = '18px';
  87. pingElement.style.fontSize = '18px';
  88. killsElement.style.fontSize = '18px';
  89.  
  90. statsBox.appendChild(fpsElement);
  91. statsBox.appendChild(pingElement);
  92. statsBox.appendChild(killsElement);
  93.  
  94. function updateStats() {
  95. fpsElement.textContent = `FPS: ${fps}`;
  96. pingElement.textContent = `Ping: ${ping.toFixed(2)} ms`;
  97. killsElement.textContent = `Kills: ${unsafeWindow.activePlayer?.kills || 0}`;
  98. }
  99.  
  100. setInterval(() => {
  101. updateFPS();
  102. updatePing();
  103. updateStats();
  104. }, 1000 / 60);
  105. const popupWindow = document.createElement('div');
  106. popupWindow.style.position = 'fixed';
  107. popupWindow.style.top = '50%';
  108. popupWindow.style.left = '50%';
  109. popupWindow.style.transform = 'translate(-50%, -50%)';
  110. popupWindow.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  111. popupWindow.style.color = 'white';
  112. popupWindow.style.padding = '20px';
  113. popupWindow.style.borderRadius = '10px';
  114. popupWindow.style.display = 'none';
  115. popupWindow.style.zIndex = '9999';
  116. document.body.appendChild(popupWindow);
  117.  
  118. popupWindow.innerHTML = `
  119. <h2>Enable Features</h2>
  120. <label><input type="checkbox" id="aimbotCheckbox"> Aimbot [X]</label><br>
  121. <label><input type="checkbox" id="autoShootCheckbox"> Trigger Bot [Z]</label><br>
  122. <label><input type="checkbox" id="spinbotCheckbox"> Spinbot [C]</label><br>
  123. <label><input type="checkbox" id="explosiveWarningCheckbox"> Explosive Warning [I]</label><br>
  124. <label><input type="checkbox" id="enemyLinesCheckbox"> Red Lines to Enemies [K]</label><br>
  125. <label><input type="checkbox" id="seeThroughCheckbox"> See Through Buildings [Y]</label><br>
  126. <label><input type="checkbox" id="healthBarCheckbox"> Show Enemy Health Bars [H]</label><br>
  127. <label><input type="checkbox" id="espCheckbox"> ESP Line to Player [E]</label><br>
  128. <label><input type="checkbox" id="meleeAimbotCheckbox"> Melee Aimbot [M]</label><br>
  129. <button id="closePopupButton">Close</button>
  130. `;
  131. const espCheckbox = document.getElementById('espCheckbox');
  132. const aimbotCheckbox = document.getElementById('aimbotCheckbox');
  133. const autoShootCheckbox = document.getElementById('autoShootCheckbox');
  134. const spinbotCheckbox = document.getElementById('spinbotCheckbox');
  135. const explosiveWarningCheckbox = document.getElementById('explosiveWarningCheckbox');
  136. const enemyLinesCheckbox = document.getElementById('enemyLinesCheckbox');
  137. const seeThroughCheckbox = document.getElementById('seeThroughCheckbox');
  138. const healthBarCheckbox = document.getElementById('healthBarCheckbox');
  139. const meleeAimbotCheckbox = document.getElementById('meleeAimbotCheckbox');
  140. const closePopupButton = document.getElementById('closePopupButton');
  141.  
  142. function togglePopup() {
  143. popupWindow.style.display = popupWindow.style.display === 'none' ? 'block' : 'none';
  144. }
  145.  
  146. closePopupButton.addEventListener('click', togglePopup);
  147.  
  148. window.addEventListener('keydown', (e) => {
  149. switch (e.key.toLowerCase()) {
  150. case 'e': espEnabled = !espEnabled; espCheckbox.checked = espEnabled; break;
  151. case 'x': aimbotEnabled = !aimbotEnabled; aimbotCheckbox.checked = aimbotEnabled; break;
  152. case 'z': autoShootEnabled = !autoShootEnabled; autoShootCheckbox.checked = autoShootEnabled; break;
  153. case 'c': spinbotEnabled = !spinbotEnabled; spinbotCheckbox.checked = spinbotEnabled; break;
  154. case 'i': explosiveWarningEnabled = !explosiveWarningEnabled; explosiveWarningCheckbox.checked = explosiveWarningEnabled; break;
  155. case 'k': drawEnemyLines = !drawEnemyLines; enemyLinesCheckbox.checked = drawEnemyLines; break;
  156. case 'y': seeThroughBuildingsEnabled = !seeThroughBuildingsEnabled; seeThroughCheckbox.checked = seeThroughBuildingsEnabled; break;
  157. case 'h': showHealthBars = !showHealthBars; healthBarCheckbox.checked = showHealthBars; break;
  158. case 'm': meleeAimbotEnabled = !meleeAimbotEnabled; meleeAimbotCheckbox.checked = meleeAimbotEnabled; break;
  159. case 't': togglePopup(); break;
  160. }
  161. });
  162. function triggerBot(player) {
  163. if (!autoShootEnabled || !player || !player.weapon || !player.weapon.canShoot) return;
  164.  
  165. const enemies = unsafeWindow.players.filter(p =>
  166. p && p.isAlive && p.team !== player.team && isVisible(player, p)
  167. );
  168.  
  169. const target = enemies.find(enemy => {
  170. const dist = distance(player.x, player.y, enemy.x, enemy.y);
  171. return dist < 400;
  172. });
  173.  
  174. if (target) player.weapon.shoot();
  175. }
  176. function drawExplosiveWarning(ctx, player) {
  177. if (!explosiveWarningEnabled) return;
  178.  
  179. unsafeWindow.projectiles.forEach(proj => {
  180. if (proj.type === 'explosive') {
  181. const dist = distance(player.x, player.y, proj.x, proj.y);
  182. if (dist < 200) {
  183. ctx.beginPath();
  184. ctx.arc(proj.x, proj.y, 30, 0, 2 * Math.PI);
  185. ctx.strokeStyle = 'red';
  186. ctx.lineWidth = 2;
  187. ctx.stroke();
  188. }
  189. }
  190. });
  191. }
  192. function drawHealthBars(ctx, player) {
  193. if (!showHealthBars) return;
  194.  
  195. unsafeWindow.players.forEach(enemy => {
  196. if (enemy.team !== player.team && enemy.isAlive) {
  197. ctx.fillStyle = 'green';
  198. ctx.fillRect(enemy.x - 20, enemy.y - 40, 40 * (enemy.health / enemy.maxHealth), 5);
  199. ctx.strokeStyle = 'black';
  200. ctx.strokeRect(enemy.x - 20, enemy.y - 40, 40, 5);
  201. }
  202. });
  203. }
  204. function drawESP(ctx, player) {
  205. if (!espEnabled) return;
  206. ctx.lineWidth = 2;
  207. ctx.strokeStyle = 'lime';
  208.  
  209. unsafeWindow.players.forEach(enemy => {
  210. if (enemy.team !== player.team && enemy.isAlive) {
  211. ctx.beginPath();
  212. ctx.moveTo(player.x, player.y);
  213. ctx.lineTo(enemy.x, enemy.y);
  214. ctx.stroke();
  215. }
  216. });
  217. }
  218. function seeThroughBuildings() {
  219. if (!seeThroughBuildingsEnabled) return;
  220.  
  221. const obstacles = document.querySelectorAll('.bunker, .building');
  222. obstacles.forEach(obs => {
  223. obs.style.opacity = '0.3';
  224. });
  225. }
  226. function aimbot(player) {
  227. if (!aimbotEnabled || !player || !player.weapon) return;
  228.  
  229. const enemies = unsafeWindow.players.filter(p =>
  230. p && p.isAlive && p.team !== player.team && isVisible(player, p)
  231. );
  232.  
  233. let closest = null;
  234. let closestDist = Infinity;
  235.  
  236. enemies.forEach(enemy => {
  237. const dist = distance(player.x, player.y, enemy.x, enemy.y);
  238. if (dist < closestDist) {
  239. closestDist = dist;
  240. closest = enemy;
  241. }
  242. });
  243.  
  244. if (closest) {
  245. const dx = closest.x - player.x;
  246. const dy = closest.y - player.y;
  247. const angle = Math.atan2(dy, dx);
  248. player.aimAngle = angle;
  249. }
  250. }
  251. function meleeAimbot(player) {
  252. if (!meleeAimbotEnabled || !player || !player.weapon || player.weapon.type !== 'melee') return;
  253.  
  254. const enemies = unsafeWindow.players.filter(p =>
  255. p && p.isAlive && p.team !== player.team && isVisible(player, p)
  256. );
  257.  
  258. let closest = null;
  259. let closestDist = Infinity;
  260.  
  261. enemies.forEach(enemy => {
  262. const dist = distance(player.x, player.y, enemy.x, enemy.y);
  263. if (dist < closestDist) {
  264. closestDist = dist;
  265. closest = enemy;
  266. }
  267. });
  268.  
  269. if (closest) {
  270. const dx = closest.x - player.x;
  271. const dy = closest.y - player.y;
  272. player.aimAngle = Math.atan2(dy, dx);
  273.  
  274. player.moveX = Math.sign(dx);
  275. player.moveY = Math.sign(dy);
  276.  
  277. if (closestDist < 50 && player.weapon.canAttack) {
  278. player.weapon.attack();
  279. }
  280. }
  281. }
  282. let spinAngle = 0;
  283. function spinbot(player) {
  284. if (!spinbotEnabled || !player) return;
  285. spinAngle += 0.3;
  286. player.aimAngle = spinAngle;
  287. }
  288. function drawTracerLines(ctx, player) {
  289. if (!drawEnemyLines) return;
  290.  
  291. ctx.strokeStyle = 'red';
  292. ctx.lineWidth = 10;
  293.  
  294. unsafeWindow.players.forEach(enemy => {
  295. if (enemy.isAlive && enemy.team !== player.team) {
  296. ctx.beginPath();
  297. ctx.moveTo(player.x, player.y);
  298. ctx.lineTo(enemy.x + enemy.vx * 3, enemy.y + enemy.vy * 3); // Predictive
  299. ctx.stroke();
  300. }
  301. });
  302. }
  303. function distance(x1, y1, x2, y2) {
  304. return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
  305. }
  306.  
  307. function isVisible(player, enemy) {
  308. return true; // Placeholder: add raycast/visibility check here if needed
  309. }
  310. setInterval(() => {
  311. const player = unsafeWindow.activePlayer;
  312. if (!player) return;
  313.  
  314. ctx.clearRect(0, 0, canvas.width, canvas.height);
  315. aimbot(player);
  316. meleeAimbot(player);
  317. triggerBot(player);
  318. spinbot(player);
  319. seeThroughBuildings();
  320. drawESP(ctx, player);
  321. drawTracerLines(ctx, player);
  322. drawExplosiveWarning(ctx, player);
  323. drawHealthBars(ctx, player);
  324. }, 1000 / 60);
  325. })(); // END of entire userscript
  326.  
  327. (function () {
  328. // Declare the GUI container but don't append it yet
  329. let guiContainer;
  330.  
  331. // Function to create and display the GUI container when the 'L' key is pressed
  332. function createGUI() {
  333. // Create the draggable GUI container
  334. guiContainer = document.createElement('div');
  335. guiContainer.style.position = 'fixed';
  336. guiContainer.style.left = '50%';
  337. guiContainer.style.top = '50%';
  338. guiContainer.style.transform = 'translate(-50%, -50%)';
  339. guiContainer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  340. guiContainer.style.padding = '20px';
  341. guiContainer.style.borderRadius = '10px';
  342. guiContainer.style.color = 'white';
  343. guiContainer.style.zIndex = '9999';
  344. guiContainer.style.display = 'none'; // Initially hidden
  345. guiContainer.style.display = 'flex';
  346. guiContainer.style.flexDirection = 'column'; // Stack elements vertically
  347. guiContainer.style.gap = '10px'; // Adds space between elements
  348. guiContainer.style.maxWidth = '150px'; // Max width of the HUD container
  349. guiContainer.style.width = '100%'; // Allows for responsive resizing while respecting max-width
  350. document.body.appendChild(guiContainer);
  351.  
  352. // Add title to the GUI
  353. const title = document.createElement('h2');
  354. title.innerText = 'Game Settings';
  355. guiContainer.appendChild(title);
  356.  
  357. // Brightness control label
  358. const brightnessLabel = document.createElement('label');
  359. brightnessLabel.innerText = 'Set Game Brightness: ';
  360. guiContainer.appendChild(brightnessLabel);
  361.  
  362. // Create brightness slider
  363. const brightnessSlider = document.createElement('input');
  364. brightnessSlider.type = 'range';
  365. brightnessSlider.min = '0';
  366. brightnessSlider.max = '2';
  367. brightnessSlider.step = '0.01';
  368. brightnessSlider.value = '1'; // Default brightness
  369. guiContainer.appendChild(brightnessSlider);
  370.  
  371. // Event listener for brightness slider
  372. brightnessSlider.addEventListener('input', function () {
  373. // Update the brightness of the game
  374. const brightnessValue = brightnessSlider.value;
  375. document.body.style.filter = `brightness(${brightnessValue})`;
  376. });
  377.  
  378. // Opacity control label for environment elements (trees, buildings, containers, bushes)
  379. const opacityLabel = document.createElement('label');
  380. opacityLabel.innerText = 'Set Environment Opacity: ';
  381. guiContainer.appendChild(opacityLabel);
  382.  
  383. // Create opacity slider
  384. const opacitySlider = document.createElement('input');
  385. opacitySlider.type = 'range';
  386. opacitySlider.min = '0';
  387. opacitySlider.max = '1';
  388. opacitySlider.step = '0.01';
  389. opacitySlider.value = '1'; // Default opacity
  390. guiContainer.appendChild(opacitySlider);
  391.  
  392. // Event listener for opacity slider
  393. opacitySlider.addEventListener('input', function () {
  394. // Update opacity of in-game objects (trees, buildings, containers, bushes)
  395. const opacityValue = opacitySlider.value;
  396. const environmentObjects = document.querySelectorAll('.tree, .building, .container, .bush'); // Example classes
  397. environmentObjects.forEach(object => {
  398. object.style.opacity = opacityValue; // Apply opacity to each object
  399. });
  400. });
  401.  
  402. // Max FPS control label
  403. const fpsLabel = document.createElement('label');
  404. fpsLabel.innerText = 'Set Max FPS: ';
  405. guiContainer.appendChild(fpsLabel);
  406.  
  407. // Create FPS slider
  408. const fpsSlider = document.createElement('input');
  409. fpsSlider.type = 'range';
  410. fpsSlider.min = '0';
  411. fpsSlider.max = '500';
  412. fpsSlider.step = '1';
  413. fpsSlider.value = '60'; // Default FPS
  414. guiContainer.appendChild(fpsSlider);
  415.  
  416. // Event listener for FPS slider
  417. fpsSlider.addEventListener('input', function () {
  418. // Set the max FPS based on slider value
  419. const fpsValue = fpsSlider.value;
  420. // Example FPS limiter (adjust as needed)
  421. document.querySelector('canvas').style['max-fps'] = fpsValue;
  422. });
  423.  
  424. // Add Lock HUD checkbox (placed under the last slider)
  425. const lockHudLabel = document.createElement('label');
  426. lockHudLabel.innerText = 'Lock HUD in Place: ';
  427. guiContainer.appendChild(lockHudLabel);
  428.  
  429. const lockHudCheckbox = document.createElement('input');
  430. lockHudCheckbox.type = 'checkbox';
  431. guiContainer.appendChild(lockHudCheckbox);
  432.  
  433. // Draggable HUD logic
  434. let isDragging = false;
  435. let offsetX, offsetY;
  436. let isHudLocked = false;
  437.  
  438. // Make the GUI container draggable (if not locked)
  439. guiContainer.addEventListener('mousedown', (e) => {
  440. if (!isHudLocked) {
  441. isDragging = true;
  442. offsetX = e.clientX - guiContainer.offsetLeft;
  443. offsetY = e.clientY - guiContainer.offsetTop;
  444. }
  445. });
  446.  
  447. document.addEventListener('mousemove', (e) => {
  448. if (isDragging && !isHudLocked) {
  449. guiContainer.style.left = `${e.clientX - offsetX}px`;
  450. guiContainer.style.top = `${e.clientY - offsetY}px`;
  451. }
  452. });
  453.  
  454. document.addEventListener('mouseup', () => {
  455. isDragging = false;
  456. });
  457.  
  458. // Listen for lock/unlock checkbox change
  459. lockHudCheckbox.addEventListener('change', function () {
  460. isHudLocked = lockHudCheckbox.checked; // Lock or unlock the HUD based on checkbox state
  461. });
  462. }
  463.  
  464. // Toggle GUI visibility with "L" key
  465. let guiVisible = false;
  466. function toggleGUI() {
  467. if (!guiVisible) {
  468. createGUI(); // Create the GUI if not already created
  469. }
  470. guiVisible = !guiVisible;
  471. guiContainer.style.display = guiVisible ? 'block' : 'none'; // Show/hide the container
  472. }
  473.  
  474. // Keybind for showing/hiding the GUI
  475. window.addEventListener('keydown', (event) => {
  476. if (event.key.toLowerCase() === 'l') {
  477. toggleGUI();
  478. }
  479. });
  480. })();
  481. (function () {
  482. let locked = false;
  483.  
  484. // 🧹 Remove any existing HUD first
  485. const existingHud = document.getElementById('customHud');
  486. if (existingHud) {
  487. existingHud.remove();
  488. }
  489.  
  490. // Create the HUD
  491. const hud = document.createElement('div');
  492. hud.id = 'customHud'; // Unique ID to detect duplicates
  493. Object.assign(hud.style, {
  494. position: 'fixed',
  495. top: '50%',
  496. left: '50%',
  497. transform: 'translate(-50%, -50%)',
  498. backgroundColor: 'rgba(0, 0, 0, 0.8)',
  499. color: 'white',
  500. padding: '20px',
  501. borderRadius: '10px',
  502. zIndex: '9999',
  503. cursor: 'move',
  504. display: 'block'
  505. });
  506. document.body.appendChild(hud);
  507.  
  508. // Draggable logic
  509. let isDragging = false;
  510. let offsetX = 0, offsetY = 0;
  511.  
  512. hud.addEventListener('mousedown', (e) => {
  513. if (!locked) {
  514. isDragging = true;
  515. offsetX = e.clientX - hud.offsetLeft;
  516. offsetY = e.clientY - hud.offsetTop;
  517. document.addEventListener('mousemove', onMouseMove);
  518. }
  519. });
  520.  
  521. document.addEventListener('mouseup', () => {
  522. isDragging = false;
  523. document.removeEventListener('mousemove', onMouseMove);
  524. });
  525.  
  526. function onMouseMove(e) {
  527. if (isDragging && !locked) {
  528. hud.style.left = `${e.clientX - offsetX}px`;
  529. hud.style.top = `${e.clientY - offsetY}px`;
  530. }
  531. }
  532.  
  533. // HUD content
  534. const naturalFeaturesElement = document.createElement('div');
  535. const featuresElement = document.createElement('div');
  536. const quickSwitchElement = document.createElement('div');
  537. const fpsElement = document.createElement('div');
  538. const pingElement = document.createElement('div');
  539. const devInfoElement = document.createElement('div');
  540. const disableTextElement = document.createElement('div');
  541.  
  542. naturalFeaturesElement.textContent = 'L = Natural Game Features';
  543. featuresElement.textContent = 'T = Key Features 👀';
  544. quickSwitchElement.textContent = 'O = Quick Switch Feature';
  545. fpsElement.textContent = 'FPS Rate: Adjusts every 100ms';
  546. pingElement.textContent = 'Ping: Developing at the moment';
  547. devInfoElement.textContent = 'This client is still under development. Report bugs to canadian100.0 on Discord.';
  548. disableTextElement.textContent = "Press 'n' to disable this HUD";
  549.  
  550. hud.appendChild(naturalFeaturesElement);
  551. hud.appendChild(featuresElement);
  552. hud.appendChild(quickSwitchElement);
  553. hud.appendChild(fpsElement);
  554. hud.appendChild(pingElement);
  555. hud.appendChild(devInfoElement);
  556. hud.appendChild(disableTextElement);
  557.  
  558. // Lock checkbox
  559. const lockCheckbox = document.createElement('input');
  560. lockCheckbox.type = 'checkbox';
  561. lockCheckbox.id = 'lockHudCheckbox';
  562. const lockLabel = document.createElement('label');
  563. lockLabel.textContent = ' Lock HUD in Place';
  564. lockLabel.setAttribute('for', 'lockHudCheckbox');
  565. hud.appendChild(lockCheckbox);
  566. hud.appendChild(lockLabel);
  567.  
  568. lockCheckbox.addEventListener('change', () => {
  569. locked = lockCheckbox.checked;
  570. });
  571.  
  572. // FPS tracking
  573. let fps = 0;
  574. let frames = 0;
  575. let lastTime = performance.now();
  576.  
  577. function updateFPS() {
  578. const currentTime = performance.now();
  579. frames++;
  580. if (currentTime - lastTime >= 100) {
  581. fps = frames;
  582. frames = 0;
  583. lastTime = currentTime;
  584. fpsElement.textContent = `FPS Rate: Adjusts every 100ms - ${fps}`;
  585. }
  586. }
  587.  
  588. setInterval(updateFPS, 100);
  589.  
  590. // Toggle HUD visibility with 'n'
  591. window.addEventListener('keydown', (e) => {
  592. if (e.key.toLowerCase() === 'n') {
  593. hud.style.display = hud.style.display === 'none' ? 'block' : 'none';
  594. }
  595. });
  596. })();
  597. (function () {
  598. let isHudVisible = false;
  599. let isLocked = false;
  600. let switchDelay = 1000;
  601. let singleShotEnabled = false;
  602. let outOfAmmoEnabled = false;
  603.  
  604. // Create HUD
  605. const hud = document.createElement('div');
  606. Object.assign(hud.style, {
  607. position: 'fixed',
  608. left: '50%',
  609. top: '50%',
  610. transform: 'translate(-50%, -50%)',
  611. background: 'rgba(0,0,0,0.8)',
  612. color: '#fff',
  613. padding: '15px',
  614. borderRadius: '10px',
  615. maxWidth: '180px',
  616. zIndex: 9999,
  617. fontSize: '12px',
  618. userSelect: 'none',
  619. flexDirection: 'column',
  620. gap: '8px',
  621. cursor: 'move',
  622. display: 'none'
  623. });
  624. hud.style.display = 'none';
  625. hud.style.display = 'flex';
  626. hud.style.display = 'none'; // Make sure it starts hidden
  627. document.body.appendChild(hud);
  628.  
  629. // Delay Slider
  630. const delayLabel = document.createElement('label');
  631. delayLabel.textContent = 'Switch Delay (ms)';
  632. const delaySlider = document.createElement('input');
  633. delaySlider.type = 'range';
  634. delaySlider.min = 100;
  635. delaySlider.max = 3000;
  636. delaySlider.step = 100;
  637. delaySlider.value = switchDelay;
  638. delaySlider.addEventListener('input', () => {
  639. switchDelay = parseInt(delaySlider.value);
  640. });
  641.  
  642. // Checkbox: After Single Shot
  643. const singleShotBox = document.createElement('input');
  644. singleShotBox.type = 'checkbox';
  645. singleShotBox.addEventListener('change', () => {
  646. singleShotEnabled = singleShotBox.checked;
  647. });
  648. const singleShotLabel = document.createElement('label');
  649. singleShotLabel.textContent = 'After Single Shot';
  650. singleShotLabel.prepend(singleShotBox);
  651.  
  652. // Checkbox: Out of Ammo
  653. const outOfAmmoBox = document.createElement('input');
  654. outOfAmmoBox.type = 'checkbox';
  655. outOfAmmoBox.addEventListener('change', () => {
  656. outOfAmmoEnabled = outOfAmmoBox.checked;
  657. });
  658. const outOfAmmoLabel = document.createElement('label');
  659. outOfAmmoLabel.textContent = 'Out of Ammo';
  660. outOfAmmoLabel.prepend(outOfAmmoBox);
  661.  
  662. // Checkbox: Lock HUD
  663. const lockBox = document.createElement('input');
  664. lockBox.type = 'checkbox';
  665. lockBox.addEventListener('change', () => {
  666. isLocked = lockBox.checked;
  667. });
  668. const lockLabel = document.createElement('label');
  669. lockLabel.textContent = 'Lock HUD';
  670. lockLabel.prepend(lockBox);
  671.  
  672. // Append to HUD
  673. hud.appendChild(delayLabel);
  674. hud.appendChild(delaySlider);
  675. hud.appendChild(singleShotLabel);
  676. hud.appendChild(outOfAmmoLabel);
  677. hud.appendChild(lockLabel);
  678.  
  679. // Drag logic
  680. let isDragging = false, offsetX = 0, offsetY = 0;
  681. hud.addEventListener('mousedown', (e) => {
  682. if (isLocked) return;
  683. isDragging = true;
  684. offsetX = e.clientX - hud.offsetLeft;
  685. offsetY = e.clientY - hud.offsetTop;
  686. });
  687. document.addEventListener('mousemove', (e) => {
  688. if (isDragging && !isLocked) {
  689. hud.style.left = `${e.clientX - offsetX}px`;
  690. hud.style.top = `${e.clientY - offsetY}px`;
  691. }
  692. });
  693. document.addEventListener('mouseup', () => isDragging = false);
  694.  
  695. // Toggle HUD with 'O'
  696. window.addEventListener('keydown', (e) => {
  697. if (e.key.toLowerCase() === 'o') {
  698. isHudVisible = !isHudVisible;
  699. hud.style.display = isHudVisible ? 'flex' : 'none';
  700. }
  701. });
  702.  
  703. // Dummy game interaction simulation (replace with real logic)
  704. function switchWeaponSlot() {
  705. const slots = [1, 2, 3].filter(slot => true); // All usable
  706. let currentSlot = getCurrentSlot(); // Replace this
  707. let nextIndex = (slots.indexOf(currentSlot) + 1) % slots.length;
  708. simulateKeyPress(slots[nextIndex].toString());
  709. }
  710.  
  711. function getCurrentSlot() {
  712. return 1; // Replace with actual game detection
  713. }
  714.  
  715. function simulateKeyPress(key) {
  716. document.dispatchEvent(new KeyboardEvent('keydown', { key }));
  717. }
  718.  
  719. function switchWeaponSlotWithDelay() {
  720. setTimeout(() => switchWeaponSlot(), switchDelay);
  721. }
  722.  
  723. // Trigger test loop (replace with actual game events)
  724. setInterval(() => {
  725. if (singleShotEnabled || outOfAmmoEnabled) {
  726. switchWeaponSlotWithDelay();
  727. }
  728. }, 3000);
  729. })();