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.

目前为 2025-04-10 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Canadian100's client (survev.io)
  3. // @namespace http://tampermonkey.net/
  4. // @version 4.3
  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.  
  12. (function () {
  13. // Default feature states
  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 espEnabled = false;
  22. let meleeAimbotEnabled = false; // Melee aimbot state
  23.  
  24. // FPS and Ping variables
  25. let fps = 0;
  26. let ping = 0;
  27. let lastTime = performance.now();
  28. let frames = 0;
  29.  
  30. // Canvas Overlay Setup
  31. const canvas = document.createElement('canvas');
  32. canvas.style.position = 'fixed';
  33. canvas.style.top = '0';
  34. canvas.style.left = '0';
  35. canvas.style.pointerEvents = 'none';
  36. canvas.style.zIndex = '9998';
  37. document.body.appendChild(canvas);
  38. const ctx = canvas.getContext('2d');
  39.  
  40. // Update Canvas Size
  41. function updateCanvasSize() {
  42. canvas.width = window.innerWidth;
  43. canvas.height = window.innerHeight;
  44. }
  45. window.addEventListener('resize', updateCanvasSize);
  46. updateCanvasSize();
  47.  
  48. // FPS Calculation
  49. function updateFPS() {
  50. const currentTime = performance.now();
  51. frames++;
  52. if (currentTime - lastTime >= 1000) {
  53. fps = frames;
  54. frames = 0;
  55. lastTime = currentTime;
  56. }
  57. }
  58.  
  59. // Ping Calculation
  60. function updatePing() {
  61. const startTime = performance.now();
  62. fetch("https://www.google.com/") // Simple ping test
  63. .then(response => response.text())
  64. .then(() => {
  65. const endTime = performance.now();
  66. ping = endTime - startTime;
  67. })
  68. .catch(() => ping = 0); // If request fails, set ping to 0
  69. }
  70.  
  71. // Stats Box Setup
  72. const statsBox = document.createElement('div');
  73. statsBox.style.position = 'fixed';
  74. statsBox.style.top = '20px';
  75. statsBox.style.left = '20px';
  76. statsBox.style.padding = '15px';
  77. statsBox.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  78. statsBox.style.borderRadius = '10px';
  79. statsBox.style.color = 'white';
  80. statsBox.style.fontFamily = 'Arial, sans-serif';
  81. statsBox.style.zIndex = '9999';
  82. statsBox.style.boxShadow = '0 0 10px rgba(255, 255, 255, 0.5)';
  83. document.body.appendChild(statsBox);
  84.  
  85. const fpsElement = document.createElement('div');
  86. const pingElement = document.createElement('div');
  87. const killsElement = document.createElement('div');
  88.  
  89. fpsElement.style.fontSize = '18px';
  90. pingElement.style.fontSize = '18px';
  91. killsElement.style.fontSize = '18px';
  92.  
  93. statsBox.appendChild(fpsElement);
  94. statsBox.appendChild(pingElement);
  95. statsBox.appendChild(killsElement);
  96.  
  97. // Update Stats Box
  98. function updateStats() {
  99. fpsElement.textContent = `FPS: ${fps}`;
  100. pingElement.textContent = `Ping: ${ping.toFixed(2)} ms`;
  101. killsElement.textContent = `Kills: ${unsafeWindow.activePlayer.kills}`;
  102. }
  103.  
  104. setInterval(() => {
  105. updateFPS();
  106. updatePing();
  107. updateStats();
  108. }, 1000 / 60); // Update every 60 FPS
  109.  
  110. // Create the Popup GUI
  111. const popupWindow = document.createElement('div');
  112. popupWindow.style.position = 'fixed';
  113. popupWindow.style.top = '50%';
  114. popupWindow.style.left = '50%';
  115. popupWindow.style.transform = 'translate(-50%, -50%)';
  116. popupWindow.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  117. popupWindow.style.color = 'white';
  118. popupWindow.style.padding = '20px';
  119. popupWindow.style.borderRadius = '10px';
  120. popupWindow.style.display = 'none';
  121. popupWindow.style.zIndex = '9999';
  122. document.body.appendChild(popupWindow);
  123.  
  124. popupWindow.innerHTML = `
  125. <h2>Enable Features</h2>
  126. <label><input type="checkbox" id="aimbotCheckbox"> Aimbot [X]</label><br>
  127. <label><input type="checkbox" id="autoShootCheckbox"> Auto-Shoot [Z]</label><br>
  128. <label><input type="checkbox" id="spinbotCheckbox"> Spinbot [C]</label><br>
  129. <label><input type="checkbox" id="explosiveWarningCheckbox"> Explosive Warning [I]</label><br>
  130. <label><input type="checkbox" id="enemyLinesCheckbox"> Red Lines to Enemies [K]</label><br>
  131. <label><input type="checkbox" id="seeThroughCheckbox"> See Through Buildings [Y]</label><br>
  132. <label><input type="checkbox" id="healthBarCheckbox"> Show Enemy Health Bars [H]</label><br>
  133. <label><input type="checkbox" id="espCheckbox"> ESP Line to Player [E]</label><br>
  134. <label><input type="checkbox" id="meleeAimbotCheckbox"> Melee Aimbot [M]</label><br> <!-- Melee checkbox -->
  135. <button id="closePopupButton">Close</button>
  136. `;
  137.  
  138. // Get references to checkboxes
  139. const aimbotCheckbox = document.getElementById('aimbotCheckbox');
  140. const autoShootCheckbox = document.getElementById('autoShootCheckbox');
  141. const spinbotCheckbox = document.getElementById('spinbotCheckbox');
  142. const explosiveWarningCheckbox = document.getElementById('explosiveWarningCheckbox');
  143. const enemyLinesCheckbox = document.getElementById('enemyLinesCheckbox');
  144. const seeThroughCheckbox = document.getElementById('seeThroughCheckbox');
  145. const healthBarCheckbox = document.getElementById('healthBarCheckbox');
  146. const espCheckbox = document.getElementById('espCheckbox');
  147. const meleeAimbotCheckbox = document.getElementById('meleeAimbotCheckbox'); // Melee checkbox reference
  148. const closePopupButton = document.getElementById('closePopupButton');
  149.  
  150. // Toggle Popup visibility
  151. function togglePopup() {
  152. popupWindow.style.display = popupWindow.style.display === 'none' ? 'block' : 'none';
  153. }
  154.  
  155. closePopupButton.addEventListener('click', togglePopup);
  156.  
  157. // Keybinds handling
  158. function handleKeyPress(event) {
  159. switch (event.key.toLowerCase()) {
  160. case 'x':
  161. aimbotEnabled = !aimbotEnabled;
  162. aimbotCheckbox.checked = aimbotEnabled;
  163. break;
  164. case 'z':
  165. autoShootEnabled = !autoShootEnabled;
  166. autoShootCheckbox.checked = autoShootEnabled;
  167. break;
  168. case 'c':
  169. spinbotEnabled = !spinbotEnabled;
  170. spinbotCheckbox.checked = spinbotEnabled;
  171. break;
  172. case 'i':
  173. explosiveWarningEnabled = !explosiveWarningEnabled;
  174. explosiveWarningCheckbox.checked = explosiveWarningEnabled;
  175. break;
  176. case 'k':
  177. drawEnemyLines = !drawEnemyLines;
  178. enemyLinesCheckbox.checked = drawEnemyLines;
  179. break;
  180. case 'y':
  181. seeThroughBuildingsEnabled = !seeThroughBuildingsEnabled;
  182. seeThroughCheckbox.checked = seeThroughBuildingsEnabled;
  183. break;
  184. case 'h':
  185. showHealthBars = !showHealthBars;
  186. healthBarCheckbox.checked = showHealthBars;
  187. break;
  188. case 'e':
  189. espEnabled = !espEnabled;
  190. espCheckbox.checked = espEnabled;
  191. break;
  192. case 'm': // Keybind for melee aimbot
  193. meleeAimbotEnabled = !meleeAimbotEnabled;
  194. meleeAimbotCheckbox.checked = meleeAimbotEnabled;
  195. break;
  196. case 't':
  197. togglePopup();
  198. break;
  199. }
  200. }
  201.  
  202. window.addEventListener('keydown', handleKeyPress);
  203.  
  204. // Synchronize checkboxes and feature states
  205. [aimbotCheckbox, autoShootCheckbox, spinbotCheckbox, explosiveWarningCheckbox, enemyLinesCheckbox, seeThroughCheckbox, healthBarCheckbox, espCheckbox, meleeAimbotCheckbox].forEach(cb => {
  206. cb.addEventListener('change', () => {
  207. aimbotEnabled = aimbotCheckbox.checked;
  208. autoShootEnabled = autoShootCheckbox.checked;
  209. spinbotEnabled = spinbotCheckbox.checked;
  210. explosiveWarningEnabled = explosiveWarningCheckbox.checked;
  211. drawEnemyLines = enemyLinesCheckbox.checked;
  212. seeThroughBuildingsEnabled = seeThroughCheckbox.checked;
  213. showHealthBars = healthBarCheckbox.checked;
  214. espEnabled = espCheckbox.checked;
  215. meleeAimbotEnabled = meleeAimbotCheckbox.checked;
  216. });
  217. });
  218. // Aimbot Function
  219. function aimbot() {
  220. if (aimbotEnabled) {
  221. let closestEnemy = null;
  222. let closestDistance = Infinity;
  223.  
  224. // Find the closest enemy within the player's view
  225. unsafeWindow.players.forEach(player => {
  226. if (player.team !== unsafeWindow.activePlayer.team) {
  227. // Check if the enemy is on screen
  228. const distance = Math.sqrt(Math.pow(unsafeWindow.activePlayer.x - player.x, 2) + Math.pow(unsafeWindow.activePlayer.y - player.y, 2));
  229. const screenBounds = {
  230. top: 0,
  231. left: 0,
  232. right: window.innerWidth,
  233. bottom: window.innerHeight
  234. };
  235.  
  236. // Check if the enemy is within screen bounds
  237. if (player.x > screenBounds.left && player.x < screenBounds.right && player.y > screenBounds.top && player.y < screenBounds.bottom) {
  238. if (distance < closestDistance) {
  239. closestDistance = distance;
  240. closestEnemy = player;
  241. }
  242. }
  243. }
  244. });
  245.  
  246. if (closestEnemy) {
  247. const angleToEnemy = Math.atan2(closestEnemy.y - unsafeWindow.activePlayer.y, closestEnemy.x - unsafeWindow.activePlayer.x);
  248. unsafeWindow.activePlayer.rotation = angleToEnemy;
  249. if (autoShootEnabled) {
  250. // Auto shoot if enabled
  251. unsafeWindow.activePlayer.shoot();
  252. }
  253. }
  254. }
  255. }
  256. // Spinbot Function
  257. function spinbot() {
  258. if (spinbotEnabled) {
  259. // Rotate the player character in a continuous spinning motion
  260. unsafeWindow.activePlayer.rotation += Math.PI / 180; // Rotate by 1 degree every frame
  261. }
  262. }
  263. // Melee Aimbot Function (Targets enemies within 50px distance)
  264. function meleeAimbot() {
  265. if (meleeAimbotEnabled) {
  266. let closestEnemy = null;
  267. let closestDistance = 50; // Distance threshold for melee aimbot
  268.  
  269. // Find the closest enemy within the melee range
  270. unsafeWindow.players.forEach(player => {
  271. if (player.team !== unsafeWindow.activePlayer.team) {
  272. const distance = Math.sqrt(Math.pow(unsafeWindow.activePlayer.x - player.x, 2) + Math.pow(unsafeWindow.activePlayer.y - player.y, 2));
  273. if (distance < closestDistance) {
  274. closestDistance = distance;
  275. closestEnemy = player;
  276. }
  277. }
  278. });
  279.  
  280. if (closestEnemy) {
  281. const angleToEnemy = Math.atan2(closestEnemy.y - unsafeWindow.activePlayer.y, closestEnemy.x - unsafeWindow.activePlayer.x);
  282. unsafeWindow.activePlayer.rotation = angleToEnemy;
  283. unsafeWindow.activePlayer.shoot(); // Perform melee attack or shooting
  284. }
  285. }
  286. }
  287. // Main loop to update features every frame
  288. setInterval(() => {
  289. if (aimbotEnabled || meleeAimbotEnabled) {
  290. aimbot();
  291. meleeAimbot(); // Check for melee aimbot at the same time
  292. }
  293. if (spinbotEnabled) {
  294. spinbot();
  295. }
  296. }, 1000 / 60); // Update every 60 FPS
  297.  
  298. })(); // Closing the IIFE
  299. (function () {
  300. // Optimize FPS performance in web-based games
  301. function optimizeFPS() {
  302. // Request animation frame to sync the FPS with the browser's refresh rate
  303. function loop() {
  304. // Remove unnecessary rendering/animations
  305. cancelAnimationFrame(loopID);
  306. loopID = requestAnimationFrame(loop);
  307. }
  308.  
  309. let loopID = requestAnimationFrame(loop);
  310.  
  311. // Reduce memory usage by disabling certain features that are not necessary
  312. function reduceMemoryUsage() {
  313. if (typeof window.performance !== 'undefined') {
  314. // Garbage collection is done automatically, but we can try to reduce memory-intensive operations
  315. window.performance.memory = null;
  316. }
  317. }
  318.  
  319. // Automatically lower graphics or display settings based on current performance
  320. function adjustGraphicsSettings() {
  321. const fpsThreshold = 30; // If FPS is below this threshold, lower the settings
  322. let currentFPS = 0;
  323.  
  324. // Calculate FPS (frames per second) in a more efficient way
  325. let frames = 0;
  326. let lastTime = performance.now();
  327. function calculateFPS() {
  328. frames++;
  329. let currentTime = performance.now();
  330. if (currentTime - lastTime >= 1000) {
  331. currentFPS = frames;
  332. frames = 0;
  333. lastTime = currentTime;
  334.  
  335. if (currentFPS < fpsThreshold) {
  336. // Reduce graphics (e.g., disable effects, lower resolution)
  337. console.log("FPS is low, lowering graphics settings...");
  338. // Example: Disable some graphical elements
  339. document.body.style.background = "#000"; // Simple example to darken the screen
  340. }
  341. }
  342. }
  343.  
  344. setInterval(calculateFPS, 1000); // Check FPS every second
  345. }
  346.  
  347. // Optimize the environment for performance
  348. function optimizeEnvironment() {
  349. // Disable unnecessary animations
  350. document.body.style.animation = 'none';
  351. document.body.style.transition = 'none';
  352.  
  353. // Disable unnecessary JavaScript timers (e.g., setInterval, setTimeout)
  354. const originalSetInterval = window.setInterval;
  355. window.setInterval = function (callback, delay) {
  356. if (delay > 1000) { // If the interval is too fast, delay or disable it
  357. return originalSetInterval(callback, 1000);
  358. }
  359. return originalSetInterval(callback, delay);
  360. };
  361. }
  362.  
  363. // Reduce background tasks and optimize the browser for gaming
  364. function optimizeBrowser() {
  365. // Disable unused tabs or reduce background tasks
  366. const visibleTabs = [...document.querySelectorAll('iframe')];
  367. visibleTabs.forEach(tab => {
  368. tab.style.visibility = 'hidden'; // Hide any hidden iframe or background content
  369. });
  370.  
  371. // Enable performance-enhancing modes like "requestAnimationFrame"
  372. window.requestAnimationFrame = (function () {
  373. return function (callback) {
  374. setTimeout(callback, 1000 / 60); // Cap the FPS at 60
  375. };
  376. })();
  377. }
  378.  
  379. // Start optimizations
  380. reduceMemoryUsage();
  381. adjustGraphicsSettings();
  382. optimizeEnvironment();
  383. optimizeBrowser();
  384. }
  385.  
  386. // Execute the function for optimizing FPS and lag reduction
  387. optimizeFPS();
  388. })();
  389. (function () {
  390. // Optimizing the ping by reducing unnecessary network requests
  391. function optimizeNetworkRequests() {
  392. // Prevent automatic background refreshes
  393. const originalFetch = window.fetch;
  394. window.fetch = function (url, options) {
  395. // Log requests to see if there are unnecessary fetches
  396. console.log('Fetching:', url);
  397.  
  398. // If the request is to an unnecessary endpoint, block it (this is just an example)
  399. if (url.includes('unnecessary_resource')) {
  400. return Promise.resolve(new Response(''));
  401. }
  402.  
  403. // Otherwise, allow the fetch to proceed normally
  404. return originalFetch(url, options);
  405. };
  406.  
  407. // Disable any unnecessary WebSocket connections or long-polling events
  408. const originalWebSocket = window.WebSocket;
  409. window.WebSocket = function (url, protocols) {
  410. // Block specific WebSocket connections (example)
  411. if (url.includes('unnecessary_socket')) {
  412. return null;
  413. }
  414. return new originalWebSocket(url, protocols);
  415. };
  416.  
  417. // Reduce background network usage by blocking certain requests
  418. function blockUnwantedRequests() {
  419. const originalXMLHttpRequest = window.XMLHttpRequest;
  420. window.XMLHttpRequest = function () {
  421. const xhr = new originalXMLHttpRequest();
  422. const originalSend = xhr.send;
  423. xhr.send = function (body) {
  424. // Block requests that aren't essential for gameplay
  425. if (xhr._url.includes('unwanted_resource')) {
  426. console.log('Blocking request:', xhr._url);
  427. return; // Don't send this request
  428. }
  429. return originalSend.call(xhr, body);
  430. };
  431. return xhr;
  432. };
  433. }
  434.  
  435. // Execute blocking function to minimize unnecessary traffic
  436. blockUnwantedRequests();
  437. }
  438.  
  439. // Optimize the game environment by reducing unnecessary resource loading
  440. function optimizeResourceLoading() {
  441. // Disable unnecessary image, script, or video loading
  442. const originalImage = HTMLImageElement.prototype.src;
  443. HTMLImageElement.prototype.src = function (src) {
  444. if (src.includes('high_resolution_image')) {
  445. console.log('Blocking high-resolution image load:', src);
  446. return;
  447. }
  448. return originalImage.apply(this, arguments);
  449. };
  450.  
  451. // Disable background processes that can increase latency
  452. function stopBackgroundTasks() {
  453. // Blocking certain animation or resource-intensive operations that may cause lag
  454. document.body.style.animation = 'none';
  455. document.body.style.transition = 'none';
  456. }
  457.  
  458. stopBackgroundTasks();
  459. }
  460.  
  461. // Reduce background process interference
  462. function manageBackgroundProcesses() {
  463. // Disable unused tabs or resources to reduce background interference
  464. const hiddenTabs = document.querySelectorAll('iframe');
  465. hiddenTabs.forEach(tab => {
  466. tab.style.visibility = 'hidden'; // Hide inactive tabs or iframes to reduce resources used
  467. });
  468.  
  469. // Disable animations and transitions that could increase load and delay
  470. document.body.style.animation = 'none';
  471. document.body.style.transition = 'none';
  472. }
  473.  
  474. // Improve the game experience by reducing unnecessary resources and improving connection handling
  475. function improveGameConnection() {
  476. // Automatically retry failed connections, ensuring more stable gameplay
  477. window.addEventListener('offline', () => {
  478. console.log('Connection lost, retrying...');
  479. // Try to reconnect when the connection is restored
  480. setTimeout(() => {
  481. location.reload();
  482. }, 5000);
  483. });
  484.  
  485. // Retry any important game-related requests if they fail
  486. function retryFailedRequests() {
  487. const originalFetch = window.fetch;
  488. window.fetch = function (url, options) {
  489. return originalFetch(url, options).catch((error) => {
  490. console.log('Fetch failed, retrying...', url);
  491. // Retry the fetch after a delay
  492. return new Promise((resolve) => {
  493. setTimeout(() => resolve(fetch(url, options)), 2000);
  494. });
  495. });
  496. };
  497. }
  498.  
  499. retryFailedRequests();
  500. }
  501.  
  502. // Initiate optimization functions
  503. function optimizePing() {
  504. optimizeNetworkRequests();
  505. optimizeResourceLoading();
  506. manageBackgroundProcesses();
  507. improveGameConnection();
  508. }
  509.  
  510. // Run the ping optimization every 5 seconds to continuously adjust settings
  511. setInterval(optimizePing, 5000); // Check every 5 seconds to optimize the game
  512.  
  513. console.log('Ping optimization started...');
  514. })();
  515. (function () {
  516. function showHealthPercentage(barElement, currentHealth, maxHealth) {
  517. if (!barElement || typeof currentHealth !== 'number' || typeof maxHealth !== 'number') return;
  518.  
  519. const percentage = Math.round((currentHealth / maxHealth) * 100);
  520.  
  521. let percentageText = barElement.querySelector('.health-percent');
  522. if (!percentageText) {
  523. percentageText = document.createElement('div');
  524. percentageText.className = 'health-percent';
  525.  
  526. Object.assign(percentageText.style, {
  527. position: 'absolute',
  528. width: '100%',
  529. height: '100%',
  530. display: 'flex',
  531. alignItems: 'center',
  532. justifyContent: 'center',
  533. top: '0',
  534. left: '0',
  535. color: 'white',
  536. fontWeight: 'bold',
  537. fontSize: '14px',
  538. textShadow: '0 0 5px black',
  539. pointerEvents: 'none',
  540. });
  541.  
  542. if (getComputedStyle(barElement).position === 'static') {
  543. barElement.style.position = 'relative';
  544. }
  545.  
  546. barElement.appendChild(percentageText);
  547. }
  548.  
  549. percentageText.textContent = `${percentage}%`;
  550. }
  551.  
  552. // 🔁 Example auto-update loop (modify as needed)
  553. setInterval(() => {
  554. const healthBar = document.getElementById('health-bar');
  555. const player = unsafeWindow.activePlayer;
  556.  
  557. if (player && healthBar) {
  558. showHealthPercentage(healthBar, player.health, player.maxHealth);
  559. }
  560. }, 200); // update every 200ms
  561. })();
  562. (function () {
  563. // Create the HUD
  564. const hud = document.createElement('div');
  565. hud.style.position = 'fixed';
  566. hud.style.top = '50%';
  567. hud.style.left = '50%';
  568. hud.style.transform = 'translate(-50%, -50%)';
  569. hud.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  570. hud.style.color = 'white';
  571. hud.style.padding = '20px';
  572. hud.style.borderRadius = '10px';
  573. hud.style.zIndex = '9999';
  574. hud.style.cursor = 'move';
  575. document.body.appendChild(hud);
  576.  
  577. // Make the HUD draggable
  578. let isDragging = false;
  579. let offsetX, offsetY;
  580.  
  581. hud.addEventListener('mousedown', (e) => {
  582. if (!locked) {
  583. isDragging = true;
  584. offsetX = e.clientX - hud.offsetLeft;
  585. offsetY = e.clientY - hud.offsetTop;
  586. document.addEventListener('mousemove', onMouseMove);
  587. }
  588. });
  589.  
  590. document.addEventListener('mouseup', () => {
  591. isDragging = false;
  592. document.removeEventListener('mousemove', onMouseMove);
  593. });
  594.  
  595. function onMouseMove(e) {
  596. if (isDragging && !locked) {
  597. hud.style.left = `${e.clientX - offsetX}px`;
  598. hud.style.top = `${e.clientY - offsetY}px`;
  599. }
  600. }
  601.  
  602. // HUD Content
  603. const naturalFeaturesElement = document.createElement('div');
  604. const featuresElement = document.createElement('div');
  605. const fpsElement = document.createElement('div');
  606. const pingElement = document.createElement('div');
  607. const devInfoElement = document.createElement('div');
  608. const disableTextElement = document.createElement('div'); // New line to disable HUD text
  609.  
  610. naturalFeaturesElement.textContent = 'L = Natural Game Features';
  611. featuresElement.textContent = 'T = Key Features 👀';
  612. fpsElement.textContent = 'FPS Rate: Adjusts every 100ms';
  613. pingElement.textContent = 'Ping: Developing at the moment';
  614. devInfoElement.textContent = 'This client is still under development at the moment please report bugs to canadian100.0 on discord';
  615. disableTextElement.textContent = "Press 'n' to disable this HUD"; // New text for 'n' keybind
  616.  
  617. hud.appendChild(naturalFeaturesElement);
  618. hud.appendChild(featuresElement);
  619. hud.appendChild(fpsElement);
  620. hud.appendChild(pingElement);
  621. hud.appendChild(devInfoElement);
  622. hud.appendChild(disableTextElement); // Add the new line to the HUD
  623.  
  624. // Checkbox to lock/unlock HUD
  625. const lockCheckbox = document.createElement('input');
  626. lockCheckbox.type = 'checkbox';
  627. lockCheckbox.id = 'lockHudCheckbox';
  628. const lockLabel = document.createElement('label');
  629. lockLabel.textContent = ' Lock HUD in Place';
  630. lockLabel.setAttribute('for', 'lockHudCheckbox');
  631. hud.appendChild(lockCheckbox);
  632. hud.appendChild(lockLabel);
  633.  
  634. // Lock functionality
  635. let locked = false;
  636. lockCheckbox.addEventListener('change', () => {
  637. locked = lockCheckbox.checked;
  638. });
  639.  
  640. // FPS Calculation (Adjusted every 100ms)
  641. let fps = 0;
  642. let frames = 0;
  643. let lastTime = performance.now();
  644.  
  645. function updateFPS() {
  646. const currentTime = performance.now();
  647. frames++;
  648. if (currentTime - lastTime >= 100) { // Update FPS every 100ms
  649. fps = frames;
  650. frames = 0;
  651. lastTime = currentTime;
  652. fpsElement.textContent = `FPS Rate: Adjusts every 100ms - ${fps}`;
  653. }
  654. }
  655.  
  656. setInterval(updateFPS, 100); // Update FPS every 100ms
  657.  
  658. // Keybind for toggling HUD visibility
  659. function handleKeyPress(event) {
  660. if (event.key.toLowerCase() === 'n') {
  661. hud.style.display = hud.style.display === 'none' ? 'block' : 'none';
  662. }
  663. }
  664.  
  665. window.addEventListener('keydown', handleKeyPress);
  666. })();
  667. (function () {
  668. // Declare the GUI container but don't append it yet
  669. let guiContainer;
  670.  
  671. // Function to create and display the GUI container when the 'L' key is pressed
  672. function createGUI() {
  673. // Create the draggable GUI container
  674. guiContainer = document.createElement('div');
  675. guiContainer.style.position = 'fixed';
  676. guiContainer.style.left = '50%';
  677. guiContainer.style.top = '50%';
  678. guiContainer.style.transform = 'translate(-50%, -50%)';
  679. guiContainer.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  680. guiContainer.style.padding = '20px';
  681. guiContainer.style.borderRadius = '10px';
  682. guiContainer.style.color = 'white';
  683. guiContainer.style.zIndex = '9999';
  684. guiContainer.style.display = 'none'; // Initially hidden
  685. guiContainer.style.display = 'flex';
  686. guiContainer.style.flexDirection = 'column'; // Stack elements vertically
  687. guiContainer.style.gap = '10px'; // Adds space between elements
  688. guiContainer.style.maxWidth = '150px'; // Max width of the HUD container
  689. guiContainer.style.width = '100%'; // Allows for responsive resizing while respecting max-width
  690. document.body.appendChild(guiContainer);
  691.  
  692. // Add title to the GUI
  693. const title = document.createElement('h2');
  694. title.innerText = 'Game Settings';
  695. guiContainer.appendChild(title);
  696.  
  697. // Brightness control label
  698. const brightnessLabel = document.createElement('label');
  699. brightnessLabel.innerText = 'Set Game Brightness: ';
  700. guiContainer.appendChild(brightnessLabel);
  701.  
  702. // Create brightness slider
  703. const brightnessSlider = document.createElement('input');
  704. brightnessSlider.type = 'range';
  705. brightnessSlider.min = '0';
  706. brightnessSlider.max = '2';
  707. brightnessSlider.step = '0.01';
  708. brightnessSlider.value = '1'; // Default brightness
  709. guiContainer.appendChild(brightnessSlider);
  710.  
  711. // Event listener for brightness slider
  712. brightnessSlider.addEventListener('input', function () {
  713. // Update the brightness of the game
  714. const brightnessValue = brightnessSlider.value;
  715. document.body.style.filter = `brightness(${brightnessValue})`;
  716. });
  717.  
  718. // Opacity control label for environment elements (trees, buildings, containers, bushes)
  719. const opacityLabel = document.createElement('label');
  720. opacityLabel.innerText = 'Set Environment Opacity: ';
  721. guiContainer.appendChild(opacityLabel);
  722.  
  723. // Create opacity slider
  724. const opacitySlider = document.createElement('input');
  725. opacitySlider.type = 'range';
  726. opacitySlider.min = '0';
  727. opacitySlider.max = '1';
  728. opacitySlider.step = '0.01';
  729. opacitySlider.value = '1'; // Default opacity
  730. guiContainer.appendChild(opacitySlider);
  731.  
  732. // Event listener for opacity slider
  733. opacitySlider.addEventListener('input', function () {
  734. // Update opacity of in-game objects (trees, buildings, containers, bushes)
  735. const opacityValue = opacitySlider.value;
  736. const environmentObjects = document.querySelectorAll('.tree, .building, .container, .bush'); // Example classes
  737. environmentObjects.forEach(object => {
  738. object.style.opacity = opacityValue; // Apply opacity to each object
  739. });
  740. });
  741.  
  742. // Max FPS control label
  743. const fpsLabel = document.createElement('label');
  744. fpsLabel.innerText = 'Set Max FPS: ';
  745. guiContainer.appendChild(fpsLabel);
  746.  
  747. // Create FPS slider
  748. const fpsSlider = document.createElement('input');
  749. fpsSlider.type = 'range';
  750. fpsSlider.min = '0';
  751. fpsSlider.max = '500';
  752. fpsSlider.step = '1';
  753. fpsSlider.value = '60'; // Default FPS
  754. guiContainer.appendChild(fpsSlider);
  755.  
  756. // Event listener for FPS slider
  757. fpsSlider.addEventListener('input', function () {
  758. // Set the max FPS based on slider value
  759. const fpsValue = fpsSlider.value;
  760. // Example FPS limiter (adjust as needed)
  761. document.querySelector('canvas').style['max-fps'] = fpsValue;
  762. });
  763.  
  764. // Add Lock HUD checkbox (placed under the last slider)
  765. const lockHudLabel = document.createElement('label');
  766. lockHudLabel.innerText = 'Lock HUD in Place: ';
  767. guiContainer.appendChild(lockHudLabel);
  768.  
  769. const lockHudCheckbox = document.createElement('input');
  770. lockHudCheckbox.type = 'checkbox';
  771. guiContainer.appendChild(lockHudCheckbox);
  772.  
  773. // Draggable HUD logic
  774. let isDragging = false;
  775. let offsetX, offsetY;
  776. let isHudLocked = false;
  777.  
  778. // Make the GUI container draggable (if not locked)
  779. guiContainer.addEventListener('mousedown', (e) => {
  780. if (!isHudLocked) {
  781. isDragging = true;
  782. offsetX = e.clientX - guiContainer.offsetLeft;
  783. offsetY = e.clientY - guiContainer.offsetTop;
  784. }
  785. });
  786.  
  787. document.addEventListener('mousemove', (e) => {
  788. if (isDragging && !isHudLocked) {
  789. guiContainer.style.left = `${e.clientX - offsetX}px`;
  790. guiContainer.style.top = `${e.clientY - offsetY}px`;
  791. }
  792. });
  793.  
  794. document.addEventListener('mouseup', () => {
  795. isDragging = false;
  796. });
  797.  
  798. // Listen for lock/unlock checkbox change
  799. lockHudCheckbox.addEventListener('change', function () {
  800. isHudLocked = lockHudCheckbox.checked; // Lock or unlock the HUD based on checkbox state
  801. });
  802. }
  803.  
  804. // Toggle GUI visibility with "L" key
  805. let guiVisible = false;
  806. function toggleGUI() {
  807. if (!guiVisible) {
  808. createGUI(); // Create the GUI if not already created
  809. }
  810. guiVisible = !guiVisible;
  811. guiContainer.style.display = guiVisible ? 'block' : 'none'; // Show/hide the container
  812. }
  813.  
  814. // Keybind for showing/hiding the GUI
  815. window.addEventListener('keydown', (event) => {
  816. if (event.key.toLowerCase() === 'l') {
  817. toggleGUI();
  818. }
  819. });
  820. })();
  821.  
  822. (function () {
  823. // Anti-tracking / Privacy Helper for browser games
  824. console.log("[Privacy Helper] Initializing...");
  825.  
  826. // Clear local storage and session storage
  827. localStorage.clear();
  828. sessionStorage.clear();
  829. console.log("[Privacy Helper] Cleared local and session storage");
  830.  
  831. // Override common fingerprinting methods
  832. Object.defineProperty(navigator, 'userAgent', {
  833. get: () => "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
  834. });
  835.  
  836. Object.defineProperty(navigator, 'language', {
  837. get: () => "en-US",
  838. });
  839.  
  840. Object.defineProperty(navigator, 'languages', {
  841. get: () => ["en-US", "en"],
  842. });
  843.  
  844. Object.defineProperty(navigator, 'platform', {
  845. get: () => "Win32",
  846. });
  847.  
  848. // Block WebRTC IP leak
  849. if (window.RTCPeerConnection) {
  850. const original = window.RTCPeerConnection;
  851. window.RTCPeerConnection = function (...args) {
  852. const pc = new original(...args);
  853. pc.createDataChannel('');
  854. pc.createOffer().then(offer => {
  855. offer.sdp = offer.sdp.replace(/a=candidate:.*\r\n/g, '');
  856. pc.setLocalDescription(offer);
  857. });
  858. return pc;
  859. };
  860. console.log("[Privacy Helper] WebRTC protection enabled");
  861. }
  862.  
  863. // Remove cookies for domain
  864. document.cookie.split(";").forEach(c => {
  865. document.cookie = c.trim().replace(/^ +/, "").replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/");
  866. });
  867. console.log("[Privacy Helper] Cookies cleared");
  868.  
  869. // Optional: make fingerprint less reliable
  870. window.devicePixelRatio = 1;
  871.  
  872. console.log("[Privacy Helper] Initialization complete.");
  873. })();