VN Mod v2 BY BLUCKGUY EZEZEZEZEZZZZZZZZZZZ

Revolver killer

  1. // ==UserScript==
  2. // @name VN Mod v2 BY BLUCKGUY EZEZEZEZEZZZZZZZZZZZ
  3. // @namespace none
  4. // @version 3
  5. // @description Revolver killer
  6. // @author BLUCKGUY SKIDDED IT EZZZZZZZ, og mod HaxKillerMacro
  7. // @license MIT
  8. // @icon https://cdn.discordapp.com/attachments/942291806740160552/1187992941306855544/Untitled_design_23.png?ex=6598e7a5&is=658672a5&hm=3b02984cc121d8feced3ba084129cbb21f3b3be25bd8d7c9964f4f176eeeecba&
  9. // @match *://moomoo.io/*
  10. // @match *://sandbox.moomoo.io/*
  11. // @match *://dev.moomoo.io/*
  12. // @require https://gf.qytechs.cn/scripts/368273-msgpack/code/msgpack.js?version=598723
  13. // @require http://code.jquery.com/jquery-3.3.1.min.js
  14. // @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
  15. // @require https://cdn.jsdelivr.net/npm/fontfaceobserver@2.1.0/fontfaceobserver.standalone.min.js
  16. // @grant none
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. // Add custom CSS styles for the scrollbar
  23. const style = document.createElement('style');
  24. style.textContent = `
  25. /* Custom scrollbar styling */
  26. #musicMenuContainer::-webkit-scrollbar {
  27. width: 15px;
  28. }
  29. #musicMenuContainer::-webkit-scrollbar-thumb {
  30. background-color: black;
  31. border-radius: 15px;
  32. border: 2px solid black;
  33. }
  34. #musicMenuContainer::-webkit-scrollbar-track {
  35. background-color: black;
  36. border-radius: 10px;
  37. }
  38. `;
  39. document.head.appendChild(style);
  40.  
  41. // Create the menu container
  42. const menuContainer = document.createElement('div');
  43. menuContainer.id = 'musicMenuContainer'; // Assign ID for custom scrollbar
  44. menuContainer.style.position = 'fixed';
  45. menuContainer.style.top = '50%';
  46. menuContainer.style.left = '50%';
  47. menuContainer.style.transform = 'translate(-50%, -50%)';
  48. menuContainer.style.backgroundColor = 'GREY';
  49. menuContainer.style.color = 'black';
  50. menuContainer.style.padding = '35px';
  51. menuContainer.style.borderRadius = '15px';
  52. menuContainer.style.display = 'none'; // Hidden by default
  53. menuContainer.style.zIndex = '9999'; // Ensure it's on top of other elements
  54. menuContainer.style.boxShadow = '0 0 15px black'; // Glowing shadow
  55. menuContainer.style.border = '2px solid black'; // Glowing border
  56. menuContainer.style.overflowY = 'auto';
  57. menuContainer.style.maxHeight = '80vh'; // Limit height to viewport height
  58. menuContainer.style.transition = 'opacity 0.5s ease-in-out, transform 1s ease-in-out'; // Transition effect
  59. menuContainer.style.opacity = '0'; // Start with invisible
  60. menuContainer.style.transform = 'translate(-50%, -60%)'; // Start from above
  61.  
  62. // Create the menu header
  63. const menuHeader = document.createElement('h3');
  64. menuHeader.textContent = 'music menu / BluckGuY c:';
  65. menuHeader.style.margin = '10';
  66. menuHeader.style.paddingBottom = '15px';
  67. menuHeader.style.borderBottom = '0px solid black';
  68. menuContainer.appendChild(menuHeader);
  69.  
  70. // List of music genres and their YouTube links
  71. const musicList = [
  72. { name: 'Party girl', url: 'https://youtu.be/s5AoSQeYmzU?si=90DM0X1oMbcUy4oQ' },
  73. { name: 'xxxtencaion 22min songs', url: 'https://youtu.be/szScXOEkkFw?si=YT_S3dFKod4BzlJ6' },
  74. { name: '10 hour honey pie for bluckguy', url: 'https://youtu.be/lBrp7v4PE0c?si=iuGZorhhn4st6zny' },
  75. { name: 'suavemente', url: 'https://youtu.be/S8i64rSAVIo?si=huqKKUNSP_eNNsP8' },
  76. { name: '1 hour miss if u got a bomba', url: 'https://youtu.be/AcatRdNlaoc?si=GAwLj6IDHP1ncZp-' },
  77. { name: 'funk', url: 'https://youtu.be/XcI5AwfjDzA?si=Zy3kLF18k7IP8zEP' },
  78. { name: 'z-beta', url: 'https://youtu.be/W_kxsPzH3PE?si=aueeNn5bcNdJBURY' },
  79. { name: 'shonci - CHEGOU 3', url: 'https://www.youtube.com/embed/jMcV_OP8LSw' },
  80. { name: 'Benzz - Je Mappelle', url: 'https://www.youtube.com/embed/_83AOaZ3Iyg' },
  81. { name: 'whine in brazil', url: 'https://www.youtube.com/watch?v=QBhA669Umbk' },
  82. ];
  83.  
  84. // Track the currently playing video ID
  85. let currentPlayingID = null;
  86. let currentButton = null;
  87.  
  88. // Add buttons for each music genre
  89. musicList.forEach(music => {
  90. const musicItem = document.createElement('div');
  91. musicItem.style.display = 'flex';
  92. musicItem.style.alignItems = 'center';
  93. musicItem.style.marginBottom = '10px';
  94.  
  95. const musicButton = document.createElement('button');
  96. musicButton.textContent = music.name + ' (Play)';
  97. musicButton.style.flex = '1';
  98. musicButton.style.marginRight = '10px';
  99. musicButton.style.padding = '10px';
  100. musicButton.style.backgroundColor = 'Black';
  101. musicButton.style.color = 'white';
  102. musicButton.style.border = '1px solid black';
  103. musicButton.style.borderRadius = '10px';
  104. musicButton.style.cursor = 'pointer';
  105. musicButton.style.transition = 'background-color 0.3s'; // Transition for background color
  106.  
  107. const stopButton = document.createElement('button');
  108. stopButton.textContent = 'Stop';
  109. stopButton.style.width = '50px';
  110. stopButton.style.padding = '10px';
  111. stopButton.style.backgroundColor = 'Black';
  112. stopButton.style.color = 'white';
  113. stopButton.style.border = '1px solid white';
  114. stopButton.style.borderRadius = '5px';
  115. stopButton.style.cursor = 'pointer';
  116.  
  117. stopButton.addEventListener('click', () => {
  118. if (currentPlayingID) {
  119. player.stopVideo();
  120. currentPlayingID = null;
  121. if (currentButton) {
  122. currentButton.textContent = currentButton.textContent.replace(' (Playing)', ' (Play)');
  123. currentButton.style.backgroundColor = 'white';
  124. }
  125. }
  126. });
  127.  
  128. musicButton.addEventListener('click', () => {
  129. if (currentPlayingID && currentButton) {
  130. player.stopVideo();
  131. currentButton.textContent = currentButton.textContent.replace(' (Playing)', ' (Play)');
  132. currentButton.style.backgroundColor = 'black';
  133. }
  134. const videoID = extractVideoID(music.url);
  135. if (videoID) {
  136. player.loadVideoById(videoID);
  137. player.playVideo();
  138. currentPlayingID = videoID;
  139. currentButton = musicButton;
  140. musicButton.textContent = music.name + ' (Playing)';
  141. musicButton.style.backgroundColor = 'black'; // Highlight color for playing
  142. }
  143. });
  144.  
  145. musicItem.appendChild(musicButton);
  146. musicItem.appendChild(stopButton);
  147. menuContainer.appendChild(musicItem);
  148. });
  149.  
  150. // Add the menu to the page
  151. document.body.appendChild(menuContainer);
  152.  
  153. // Create an invisible player container
  154. const playerContainer = document.createElement('div');
  155. playerContainer.id = 'musicPlayer';
  156. playerContainer.style.position = 'fixed';
  157. playerContainer.style.bottom = '0';
  158. playerContainer.style.right = '0';
  159. playerContainer.style.width = '0';
  160. playerContainer.style.height = '0';
  161. document.body.appendChild(playerContainer);
  162.  
  163. // Load YouTube IFrame Player API
  164. let tag = document.createElement('script');
  165. tag.src = "https://www.youtube.com/iframe_api";
  166. let firstScriptTag = document.getElementsByTagName('script')[0];
  167. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  168.  
  169. // Create YouTube player
  170. let player;
  171. window.onYouTubeIframeAPIReady = function() {
  172. player = new YT.Player('musicPlayer', {
  173. height: '0',
  174. width: '0',
  175. videoId: '',
  176. playerVars: { 'autoplay': 1, 'controls': 0, 'mute': 0 },
  177. events: {
  178. 'onReady': onPlayerReady
  179. }
  180. });
  181. };
  182.  
  183. function onPlayerReady(event) {
  184. console.log('YouTube Player is ready');
  185. }
  186.  
  187. // Function to extract video ID from YouTube URL
  188. function extractVideoID(url) {
  189. const videoIDMatch = url.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);
  190. return videoIDMatch ? videoIDMatch[1] : null;
  191. }
  192.  
  193. // Handle TAB key to toggle the menu
  194. document.addEventListener('keydown', (event) => {
  195. if (event.key === 'Tab') {
  196. event.preventDefault(); // Prevent default TAB behavior
  197. if (menuContainer.style.display === 'none') {
  198. menuContainer.style.display = 'block';
  199. setTimeout(() => {
  200. menuContainer.style.opacity = '1'; // Fade in effect
  201. menuContainer.style.transform = 'translate(-50%, -50%)'; // Move to final position
  202. }, 10); // Small delay to apply transition
  203. } else {
  204. menuContainer.style.opacity = '0'; // Fade out effect
  205. menuContainer.style.transform = 'translate(-50%, -60%)'; // Move to starting position
  206. setTimeout(() => {
  207. menuContainer.style.display = 'none';
  208. }, 500); // Match transition duration
  209. }
  210. }
  211. });
  212. })();
  213.  
  214. setInterval(() => window.follmoo && follmoo(), 10);
  215.  
  216. if(location.hostname == "sandbox.moomoo.io") {
  217. document.getElementById("foodDisplay").style.display = "none";
  218. document.getElementById("woodDisplay").style.display = "none";
  219. document.getElementById("stoneDisplay").style.display = "none";
  220. }
  221.  
  222. document.getElementById("enterGame").addEventListener("click", autohide);
  223. function autohide() {
  224. $("#ot-sdk-btn-floating").hide();
  225. }
  226. document.getElementById("linksContainer2").innerHTML = " ";
  227. let changes = `<div id="subConfirmationElement"><a href="https://discord.gg/BVx8EWfBny">Join Discord!</a></div>`;
  228. $('#linksContainer2').prepend(changes);
  229. $('#subConfirmationElement').click( () => {
  230. try { window.follmoo(); } catch(e){};
  231. localStorage["moofoll"] = "1"; localStorage["moofol"] = "1";
  232. });
  233. document.querySelector("#joinPartyButton").remove();
  234. document.querySelector("#pre-content-container").remove(); //ANTI AD
  235. document.getElementById("gameName").innerHTML = "VN Mod";
  236. let changes2 = `<div id="customMenuName"><h3 style="font-size: 50px;" class = "indent">By Mrlag & HaX</a></div>`;
  237. $('#gameName').prepend(changes2);
  238. $("#gameName").css({
  239. color: "#333",
  240. "text-shadow": "0 1px 0 #181818, 0 2px 0 #181818, 0 3px 0 #181818, 0 4px 0 #181818, 0 5px 0 #181818, 0 6px 0 #181818, 0 7px 0 #181818, 0 8px 0 #181818, 0 9px 0 #181818, rgba(0, 0, 0, 0.4) 1px 1px 40px",
  241. "text-align": "center",
  242. "font-size": "156px",
  243. "margin-bottom": "-30px",
  244. });
  245. document.getElementById("loadingText").innerHTML = `<div id="MRLAGPRO" class="loader">`
  246. //document.getElementById("loadingText").innerHTML = "VN Loading";
  247. document.getElementById("diedText").innerHTML = "VN Died :C";
  248. document.getElementById("diedText").style.color = "#ffffff";
  249. document.title = " VN Mod";
  250. document.getElementById("leaderboard").append("VN Mod");
  251. $("#mapDisplay").css("background", "url('https://wormax.org/chrome3kafa/moomooio-background.png')");
  252. document.getElementById("storeHolder").style = "height: 1150px; width: 400px;";
  253. document.getElementById('promoImgHolder').innerHTML =
  254. `
  255. <style>
  256. p { font-size: 20px;}#noticationDisplay {
  257. vertical-align: top;
  258. position: absolute;
  259. right: 85%;
  260. top: 10%;
  261. text-align: right;
  262. } .menuButton { transition: 0.5s; border-radius: 0px;
  263. } .menuButton:hover { transform: scale(1.11); box-shadow: 0 0 20px #333;
  264. } #linksContainer2 { background: #ccc; border-top: 5px solid; border-image: linear-gradient(to right,#333,#333) 1 1 0 0; height: 18px; top: 0%; color: #333; transition: 0.3s;
  265. } #linksContainer2:hover { background: #ccc; box-shadow: 0 0 20px #333;
  266. } #top-wrap-right { color: #333;
  267. } .check-box {transform: scale(1.1);
  268. } .inParty {display: none;
  269. } input[type="checkbox"] { position: relative; appearance: none; width: 33px; height: 15.5px; border-radius: 50px; box-shadow: inset 0 0 5px rgba(41, 41, 41, 0.2); cursor: pointer; top: 7.5px; transition: 0.4s;
  270. } input:checked[type="checkbox"] { background: #333;
  271. } input[type="checkbox"]::after { position: absolute; content: ""; width: 15.5px; height: 15.5px; top: 0; left: 0; background: #fff; border-radius: 50%; box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); transform: scale(1.1); transition: 0.4s;
  272. } input:checked[type="checkbox"]::after { left: 50%;
  273. } .menuCard { background-color: #181818; border-top: 5px solid; border-image: linear-gradient(to right,#333,#303030) 1 0 0 0; color: #333; margin-top:0px; border-radius: 0px; border-bottom: 0px solid red; transition: all 1s; transform: scale(1); box-shadow: 0px 0px #333; transform: translateX(0px);
  274. } .menuCard:hover { transform: scale(1.05); box-shadow: 0 0 20px #333;
  275. } .menuCard.active { transform: translateX(0px);
  276. } #adCard { display: none;
  277. } #promoImgHolder { overflow-y: scroll; -ms-overflow-style: none; scrollbar-width: none; height: 90px; max-height: 90px; }
  278. </style>
  279. </head>
  280. <div>
  281. <i class="fa-solid fa-rectangle-list"style="font-size: 25px";></i><p>Update V2</p> <div style="font-size: 15px">
  282. - added boost tick<br>
  283. - added normal insta<br>
  284. - added sync detect test<br>
  285. - added sync heal q hold-beta)<br>
  286. - added a lot of visuals<br>
  287. - major bug fixes<br>
  288. - optimised heal<br>
  289. - removed autobreaker secondary<br>
  290. - added biome hat<br>
  291. - fixed heal bugs <br>
  292. - made logo <br>
  293. - changed autobreaker to tankclick<br>
  294. - added menu! <br>
  295. - added stack insta<br>
  296. - added autoaim<br>
  297. - optimised heals<br>
  298. - added bullspam detect<br>
  299. - added accesories <br>
  300. <i class="fa-solid fa-rectangle-list"style="font-size: 25px";></i><p>Update V1</p> <div style="font-size: 15px">
  301. - Created vn mod, devlopment beings<br>
  302. - Added basic macros & auto triple mills<br>
  303. - Fixed buggy placement function<br>
  304. - Added mousebutton hats<br>
  305. - Added perfect spiketick<br>
  306. - Added bullspammer<br>
  307. - added autobreaker<br>
  308. - added heal based hitback<br>
  309. - added anti instas<br>
  310. - added reverse insta<br>
  311. - removed bullspammer<br>
  312. - added music menu<br>
  313.  
  314.  
  315. </div><div style="font-size: 15px">
  316. </div><br>
  317. `
  318. $("#itemInfoHolder").css({ top: "0px", left: "15px" });
  319. $("#youtuberOf").remove();
  320. $("#adCard").remove();
  321. $("#mobileInstructions").remove();
  322. $("#downloadButtonContainer").remove();
  323. $("#mobileDownloadButtonContainer").remove();
  324. $(".downloadBadge").remove();
  325.  
  326. const shadowStyle = "box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.4)";
  327.  
  328. const setupCardDiv = document.getElementById("setupCard");
  329. if (setupCardDiv) {
  330. setupCardDiv.style.cssText += shadowStyle;
  331. }
  332.  
  333. const serverBrowserSelect = document.getElementById("serverBrowser");
  334. if (serverBrowserSelect) {
  335. serverBrowserSelect.style.color = "#333";
  336. serverBrowserSelect.style.backgroundColor = "#e5e3e4";
  337. }
  338.  
  339. const enterGameButton = document.getElementById("enterGame");
  340. if (enterGameButton) {
  341. enterGameButton.style.backgroundColor = "#333";
  342. }
  343.  
  344. const style = document.createElement("style");
  345. style.innerHTML = `
  346. .menuLink {
  347. font-size: 20px;
  348. color: #333;
  349. }
  350. a {
  351. color: #333;
  352. text-decoration: none;
  353. }
  354. `;
  355. document.head.appendChild(style);
  356.  
  357. const nameInputElement = document.getElementById("nameInput");
  358. if (nameInputElement) {
  359. nameInputElement.style.color = "#333";
  360. }
  361.  
  362. const guideCardDiv = document.getElementById("guideCard");
  363. if (guideCardDiv) {
  364. guideCardDiv.style.cssText += shadowStyle;
  365. setupCardDiv.style.backgroundColor = "#181818";
  366. guideCardDiv.style.backgroundColor = "#181818";
  367. }
  368.  
  369. (function () {
  370. if (document.querySelector("#customAudioPlayer")) return;
  371. var audioFiles = [
  372. {
  373. url: "https://cdn.discordapp.com/attachments/1062441866416619653/1069324203297362040/Barren_Gates_-_Obey_NCS_Release.mp3",
  374. title: "Obey NCS",
  375. },
  376. {
  377. url: "https://cdn.discordapp.com/attachments/1062441866416619653/1069323837608570941/Clarx_-_Zig_Zag_NCS_Release.mp3",
  378. title: "Zig Zag NCS",
  379. },
  380. {
  381. url: "https://cdn.discordapp.com/attachments/1062441866416619653/1069300879708135524/Anixto_-_Ride_Or_Die_NCS_Release.mp3",
  382. title: "Ride Or Die NCS",
  383. },
  384. {
  385. url: "https://cdn.discordapp.com/attachments/1062441866416619653/1069324799903531128/MP3DL.CC_Rival_-_Throne_-_ft._Neoni_NCS_Release-256k.mp3",
  386. title: "Throne NCS",
  387. },
  388. {
  389. url: "https://cdn.discordapp.com/attachments/905994516719345664/918544988965568562/Dirty_Palm_-_Ropes_feat._Chandler_Jewels_NCS10_Release.mp3",
  390. title: "Ropes NCS",
  391. },
  392. {
  393. url: "https://cdn.discordapp.com/attachments/905994516719345664/918546211584213023/Jonth_Tom_Wilson_Facading_MAGNUS_Jagsy_Vosai_RudeLies__Domastic_-_Heartless_NCS10_Release.mp3",
  394. title: "Heartless NCS",
  395. },
  396. {
  397. url: "https://cdn.discordapp.com/attachments/905873563490328626/920005714481672212/Anikdote_-_Turn_It_Up_NCS_Release.mp3",
  398. title: "Turn It Up NCS",
  399. },
  400. {
  401. url: "https://cdn.discordapp.com/attachments/905873563490328626/920006439999778856/Unknown_Brain_-_MATAFAKA_feat._Marvin_Divine_NCS_Release.mp3",
  402. title: "MATAFKA NCS",
  403. },
  404. {
  405. url: "https://cdn.discordapp.com/attachments/905994516719345664/918910823290769458/koven_never_have_i_felt_this_ncs_release_gqEQ_nIByoK-gucZcxBO.mp3",
  406. title: "Never Have I Felt This NCS",
  407. },
  408. {
  409. url: "https://cdn.discordapp.com/attachments/905994516719345664/925144953611505714/Rebel_Scum__Dani_King__Centrix_-_Calm_Before_The_Storm_NCS_Release.mp3",
  410. title: "Calm Before The Storm NCS",
  411. },
  412. ];
  413. var currentIndex = 0;
  414. var audio = new Audio(audioFiles[currentIndex].url);
  415. audio.preload = "auto";
  416. audio.volume = 0.1;
  417. var repeat = false;
  418. var shuffled = false;
  419. function playNext() {
  420. if (shuffled) {
  421. currentIndex = Math.floor(Math.random() * audioFiles.length);
  422. } else if (!repeat) {
  423. currentIndex = (currentIndex + 1) % audioFiles.length;
  424. }
  425. audio.src = audioFiles[currentIndex].url;
  426. audio.play();
  427. label.textContent = audioFiles[currentIndex].title;
  428. playButton.textContent = "Pause";
  429. playButton.style.background = "red";
  430. var trackButtons = document.querySelectorAll(".track-button");
  431. trackButtons.forEach(function (trackButton, index) {
  432. if (index === currentIndex) {
  433. trackButton.classList.add("active");
  434. } else {
  435. trackButton.classList.remove("active");
  436. }
  437. });
  438. }
  439. function formatDuration(duration) {
  440. var minutes = Math.floor(duration / 60);
  441. var seconds = Math.floor(duration % 60);
  442. return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
  443. }
  444. audio.addEventListener("ended", playNext);
  445. audio.addEventListener("timeupdate", function () {
  446. durationDisplay.textContent =
  447. formatDuration(audio.currentTime) + "/" + formatDuration(audio.duration);
  448. });
  449. var player = document.createElement("div");
  450. player.id = "customAudioPlayer";
  451. player.style =
  452. "position:fixed;top:10px;left:10px;z-index:10001;background:#282828;border:1px solid black;padding:20px;border-radius:10px;width:300px;color:#fff;box-shadow:0px 0px 20px 5px rgba(0,0,0,0.75);display:none;flex-direction:column;align-items:center;";
  453. var profilePicture = document.createElement("img");
  454. profilePicture.src =
  455. "https://yt3.ggpht.com/jI1t37BCsCD_jMVBEqQPUghbRmz3KMny540V-r5iYAHaJeGolUYdUE8o1QCok7HMxEzZHZGS9Q=s600-c-k-c0x00ffffff-no-rj-rp-mo";
  456. profilePicture.style =
  457. "width:60px;height:60px;border-radius:50%;cursor:pointer;";
  458. profilePicture.onclick = function () {
  459. window.location.href =
  460. "https://www.youtube.com/channel/UCub84Dy0SSA0NgCqeUdjpsA";
  461. };
  462. player.appendChild(profilePicture);
  463. var label = document.createElement("div");
  464. label.textContent = audioFiles[currentIndex].title;
  465. label.style = "margin-top:10px;text-align:center;";
  466. player.appendChild(label);
  467. var playButton = document.createElement("button");
  468. playButton.textContent = "Play";
  469. playButton.style =
  470. "margin-top:10px;width:100%;padding:10px;border:none;border-radius:5px;background-color:green;color:white;cursor:pointer;";
  471. playButton.onclick = function () {
  472. if (audio.paused) {
  473. audio.play();
  474. this.textContent = "Pause";
  475. this.style.background = "red";
  476. } else {
  477. audio.pause();
  478. this.textContent = "Play";
  479. this.style.background = "green";
  480. }
  481. };
  482. player.appendChild(playButton);
  483. var nextButton = document.createElement("button");
  484. nextButton.textContent = "Next";
  485. nextButton.style =
  486. "margin-top:10px;width:100%;padding:10px;border:none;border-radius:5px;background-color:white;color:black;cursor:pointer;";
  487. nextButton.onclick = playNext;
  488. player.appendChild(nextButton);
  489. var shuffleRepeatContainer = document.createElement("div");
  490. shuffleRepeatContainer.style =
  491. "display:flex;justify-content:space-between;width:100%;margin-top:10px;";
  492. player.appendChild(shuffleRepeatContainer);
  493. var shuffleButton = document.createElement("button");
  494. shuffleButton.textContent = "Shuffle: Off";
  495. shuffleButton.style =
  496. "padding:10px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:48%;";
  497. shuffleButton.onclick = function () {
  498. shuffled = !shuffled;
  499. this.textContent = shuffled ? "Shuffle: On" : "Shuffle: Off";
  500. };
  501. shuffleRepeatContainer.appendChild(shuffleButton);
  502. var repeatButton = document.createElement("button");
  503. repeatButton.textContent = "Repeat: Off";
  504. repeatButton.style =
  505. "padding:10px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:48%;";
  506. repeatButton.onclick = function () {
  507. repeat = !repeat;
  508. this.textContent = repeat ? "Repeat: On" : "Repeat: Off";
  509. };
  510. shuffleRepeatContainer.appendChild(repeatButton);
  511. var durationDisplay = document.createElement("div");
  512. durationDisplay.style = "margin-top:10px;text-align:center;";
  513. player.appendChild(durationDisplay);
  514. var trackList = document.createElement("div");
  515. trackList.style =
  516. "overflow:auto;max-height:150px;margin-top:20px;border:1px solid #fff;border-radius:10px;padding:5px;";
  517. audioFiles.forEach(function (track, index) {
  518. var trackButton = document.createElement("button");
  519. trackButton.textContent = track.title;
  520. trackButton.classList.add("track-button");
  521. trackButton.style =
  522. "padding:5px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:100%;text-align:left;margin-top:5px;";
  523. trackButton.onclick = function () {
  524. currentIndex = index;
  525. audio.src = track.url;
  526. audio.play();
  527. label.textContent = track.title;
  528. playButton.textContent = "Pause";
  529. playButton.style.background = "red";
  530. trackButtons.forEach(function (trackButton, i) {
  531. if (i === currentIndex) {
  532. trackButton.classList.add("active");
  533. } else {
  534. trackButton.classList.remove("active");
  535. }
  536. });
  537. };
  538. trackList.appendChild(trackButton);
  539. });
  540. player.appendChild(trackList);
  541. var activeButtonStyle = document.createElement("style");
  542. activeButtonStyle.innerHTML = ".track-button.active{background-color:green;}";
  543. document.head.appendChild(activeButtonStyle);
  544. var madeByLabel = document.createElement("div");
  545. madeByLabel.textContent = "Made by Zod324myers";
  546. madeByLabel.style = "margin-top:auto;text-align:center;";
  547. player.appendChild(madeByLabel);
  548. document.body.appendChild(player);
  549. document.addEventListener("keydown", function (e) {
  550. if (e.key === "m" && document.activeElement.id.toLowerCase() !== "chatbox") {
  551. player.style.display = player.style.display === "none" ? "flex" : "none";
  552. }
  553. });
  554. })();
  555.  
  556. let lastPing = -1;
  557. let cvs = document.getElementById("gameCanvas"),
  558. ctx = cvs.getContext("2d");
  559. let Ie = document.getElementById("pingDisplay");
  560. Ie.replaceWith(document.createElement("div"));
  561. Ie.style.fontSize = "20px";
  562. Ie.style.fontFamily = "Calibri";
  563. Ie.style.display = "block";
  564. Ie.style.zIndex = "1";
  565. document.body.appendChild(Ie);
  566. setInterval(() => {
  567. Ie.style.display = "block";
  568. Ie.innerText = `${window.pingTime} ping | ${fps} fps`;
  569. }, 0);
  570. const times = [];
  571. let fps;
  572.  
  573. function refreshLoop() {
  574. window.requestAnimationFrame(() => {
  575. const now = performance.now();
  576. while (times.length > 0 && times[0] <= now - 1000) {
  577. times.shift();
  578. }
  579. times.push(now);
  580. fps = times.length;
  581. refreshLoop();
  582. });
  583. }
  584.  
  585. refreshLoop();
  586. Ie.style.fontSize = "20px";
  587. Ie.style.display = "block";
  588. Ie.style.color = "#fff";
  589. Ie.style.textShadow = "3px 3px 3px black";
  590. Ie.style.zIndex = "1";
  591. let anti = true;
  592. let hitBack = false;
  593. let stackInsta = false;
  594. let lastDamageTick = 0;
  595. let HP = 100;
  596. let gameTick = 0;
  597. var shame = 0;
  598. let shameTime,
  599. damageTimes = 0;
  600. let mouseX;
  601. let mouseY;
  602.  
  603. let width;
  604. let height;
  605. //autoaim1
  606. setInterval(() => {
  607. if (autoaim == true) {
  608. doNewSend(["D", [nearestEnemyAngle]]);
  609. }
  610. }, 10);
  611.  
  612. setInterval(() => {
  613. if (hatToggle == 1) {
  614. if (oldHat != normalHat) {
  615. hat(normalHat);
  616. console.log("Tried. - Hat")
  617. }
  618. if (oldAcc != normalAcc) {
  619. acc(normalAcc);
  620. console.log("Tried. - Acc")
  621. }
  622. oldHat = normalHat;
  623. oldAcc = normalAcc
  624. }
  625. }, 25);
  626.  
  627. setInterval(function () {
  628. if (myPlayer.hat == 45) {
  629. doNewSend(["6", [""]]);
  630. }
  631. }, 1980);// messages send ever 2000ms but this is incase of packet mashes
  632.  
  633. function normal() {
  634. hat(normalHat);
  635. acc(normalAcc);
  636. }
  637.  
  638. function aim(x, y) {
  639. var cvs = document.getElementById("gameCanvas");
  640. cvs.dispatchEvent(new MouseEvent("mousemove", {
  641. clientX: x,
  642. clientY: y
  643.  
  644. }));
  645. }
  646.  
  647. let coreURL = new URL(window.location.href);
  648. window.sessionStorage.force = coreURL.searchParams.get("fc");
  649.  
  650. var packet
  651. var nearestEnemy;
  652. var nearestEnemyAngle;
  653. var oppositeEnemyAngle;
  654. var enemyRan;
  655. let trap_a = null;
  656. let intrap = false;
  657. let trapid = null;
  658. var antitrap = false;
  659. var isEnemyNear;
  660. var primary;
  661. var secondary;
  662. var foodType;
  663. var wallType;
  664. var spikeType;
  665. var millType;
  666. var mineType;
  667. var boostType;
  668. var turretType;
  669. var spawnpadType;
  670. var autoaim = false;
  671. var autoprimary = false;
  672. var autosecondary = false;
  673. var tick = 1;
  674. var oldHat;
  675. var oldAcc;
  676. var enemiesNear;
  677. var normalHat;
  678. var normalAcc;
  679. var ws;
  680. var msgpack5 = msgpack;
  681. var boostDir;
  682. let myPlayer = {
  683. id: null,
  684. x: null,
  685. y: null,
  686. dir: null,
  687. object: null,
  688. weapon: null,
  689. clan: null,
  690. isLeader: null,
  691. hat: null,
  692. accessory: null,
  693. isSkull: null,
  694. };
  695.  
  696. let healSpeed = 100;
  697. var messageToggle = 0;
  698. var clanToggle = 0;
  699. let healToggle = 1;
  700. let hatToggle = 1;
  701. document.msgpack = msgpack;
  702.  
  703. function n() {
  704. this.buffer = new Uint8Array([0]);
  705. this.buffer.__proto__ = new Uint8Array;
  706. this.type = 0;
  707. }
  708.  
  709. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  710. WebSocket.prototype.send = function(m) {
  711. if (!ws) {
  712. document.ws = this;
  713.  
  714. ws = this;
  715. socketFound(this);
  716. }
  717. this.oldSend(m);
  718. };
  719.  
  720. /*function biomeHat() {
  721. if (myPlayer.y < 2400) {
  722. hat(6);
  723. } else {
  724. if (myPlayer.y > 6850 && myPlayer.y < 7550) {
  725. hat(6);
  726. } else {
  727. hat(6);
  728. }
  729. }
  730. //acc(11);
  731. }*/
  732.  
  733. function socketFound(socket) {
  734. socket.addEventListener('message', function(message) {
  735. handleMessage(message);
  736. });
  737. }
  738.  
  739. function handleMessage(m) {
  740. let temp = msgpack5.decode(new Uint8Array(m.data));
  741. let data;
  742. if (temp.length > 1) {
  743. data = [temp[0], ...temp[1]];
  744. if (data[1] instanceof Array) {
  745. data = data;
  746. }
  747. } else {
  748. data = temp;
  749. }
  750. let item = data[0];
  751. if (!data) {
  752. return
  753. };
  754.  
  755.  
  756. if (item === "io-init") {
  757. let cvs = document.getElementById("gameCanvas");
  758. width = cvs.clientWidth;
  759. height = cvs.clientHeight;
  760. $(window).resize(function() {
  761. width = cvs.clientWidth;
  762. height = cvs.clientHeight;
  763. });
  764. cvs.addEventListener("mousemove", e => {
  765. mouseX = e.clientX;
  766. mouseY = e.clientY;
  767. });
  768. }
  769.  
  770. if (item == "C" && myPlayer.id == null) {
  771. myPlayer.id = data[1];
  772. }
  773.  
  774. if (item == "a") {
  775. enemiesNear = [];
  776. for (let i = 0; i < data[1].length / 13; i++) {
  777. let playerInfo = data[1].slice(13 * i, 13 * i + 13);
  778. if (playerInfo[0] == myPlayer.id) {
  779. myPlayer.x = playerInfo[1];
  780. myPlayer.y = playerInfo[2];
  781. myPlayer.dir = playerInfo[3];
  782. myPlayer.object = playerInfo[4];
  783. myPlayer.weapon = playerInfo[5];
  784. myPlayer.clan = playerInfo[7];
  785. myPlayer.isLeader = playerInfo[8];
  786. myPlayer.hat = playerInfo[9];
  787. myPlayer.accessory = playerInfo[10];
  788. myPlayer.isSkull = playerInfo[11];
  789. } else if (playerInfo[7] != myPlayer.clan || playerInfo[7] === null) {
  790. enemiesNear.push(playerInfo);
  791. }
  792. }
  793. }
  794. update();
  795. if (item == "H") {
  796. for(let i = 0; i < data[1].length / 8; i++) {
  797. let info = data[1].slice(8*i, 8*i+8);
  798. if(info[6] == millType && info[7] == myPlayer.id){
  799. friendlyMillLocs.push(info)
  800. }
  801.  
  802. if(info[7] == myPlayer.id){
  803. onWeapon = true;
  804. }
  805. }
  806.  
  807. }
  808. update();
  809. /*if(item == "P"){
  810. setTimeout(() => {
  811. doNewSend(["M", [{name: "vn-" + "",moofoll: 1,skin: "#cc5151"}]]);
  812. }, 200);
  813. }*/
  814.  
  815. if(item == "Q"){
  816. removeArraysWithValue(friendlyMillLocs, data[1])
  817. }
  818. update();
  819. if(item == "R"){
  820. removeArraysWithValue(friendlyMillLocs, data[1])
  821. }
  822. update();
  823. if(item == "S"){
  824. if(data[1] == 3){
  825. millCount = data[2];
  826. }
  827. }
  828. update();
  829. if(friendlyMillLocs){
  830. nearestFriendlyMill = friendlyMillLocs.sort((a,b) => dist(a, myPlayer) - dist(b, myPlayer))[0];
  831.  
  832. if(nearestFriendlyMill){
  833. nearestFriendlyMillX = nearestFriendlyMill[1]
  834. nearestFriendlyMillY = nearestFriendlyMill[2]
  835. nearestFriendlyMillScale = nearestFriendlyMill[4]
  836. }
  837. }
  838. if(Math.sqrt(Math.pow((myPlayer.y-nearestFriendlyMillY), 2) + Math.pow((myPlayer.x-nearestFriendlyMillX), 2)) < nearestFriendlyMillScale + 100) {
  839. console.log(true)
  840. isNextToFriendlyMill = true;
  841. } else {
  842. isNextToFriendlyMill = false;
  843. }
  844. WebSocket.prototype.send = function(m){
  845. let xcc = new Uint8Array(m);
  846. this.oldSend(m);
  847. let realData = {};
  848. let realInfo = msgpack5.decode(xcc);
  849. if (realInfo[1] instanceof Array){
  850. realData.data = [realInfo[0], ...realInfo[1]]
  851. }
  852. let rd0 = realData.data[0];
  853. let rd1 = realData.data[1];
  854. let rd2 = realData.data[2]
  855.  
  856. if(rd0 == 'f'){
  857. movementDirection = rd1
  858. }
  859. };
  860. isEnemyNear = false;
  861. if (enemiesNear) {
  862. nearestEnemy = enemiesNear.sort((a, b) => dist(a, myPlayer) - dist(b, myPlayer))[0];
  863. }
  864.  
  865. if (nearestEnemy) {
  866. nearestEnemyAngle = Math.atan2(nearestEnemy[2] - myPlayer.y, nearestEnemy[1] - myPlayer.x);
  867. oppositeEnemyAngle = Math.atan2(nearestEnemy[2] + myPlayer.y, nearestEnemy[1] + myPlayer.x);
  868. enemyRan = Math.sqrt(Math.pow((myPlayer.y - nearestEnemy[2]), 2) + Math.pow((myPlayer.x - nearestEnemy[1]), 2));
  869. if (Math.sqrt(Math.pow((myPlayer.y - nearestEnemy[2]), 2) + Math.pow((myPlayer.x - nearestEnemy[1]), 2)) < 285) {
  870. isEnemyNear = true;
  871. if (autoaim == false && myPlayer.hat != 7 && myPlayer.hat != 53) {
  872. normalHat = 6;
  873. if (primary != 8) {
  874. normalAcc = 21
  875. }
  876. };
  877. }
  878. }
  879. if (isEnemyNear == false && autoaim == false) {
  880. if (myPlayer.y < 2400) {
  881. normalHat = 15;
  882. } else if (myPlayer.y > 6850 && myPlayer.y < 7550) {
  883. normalHat = 31;
  884. } else {
  885. normalHat = 12;
  886.  
  887. }
  888. }
  889. if(isEnemyNear == true && nearestEnemy[5] == 4 && nearestEnemy[9] == 7 && hitBack == true && myPlayer.hat != 7 && myPlayer.hat != 53 && myPlayer.hat != 22 && myPlayer.hat != 11){
  890. doNewSend(["c", [0, 11, 0]]);
  891. setTimeout(()=>{
  892. doNewSend(["c", [0, 21, 1]]);
  893. },60);
  894. }
  895. if (!nearestEnemy) {
  896. nearestEnemyAngle = myPlayer.dir;
  897. }
  898.  
  899. if (item == "X") {
  900. //this is Sync detector(beta)
  901. if (data[5] == 3.6) {
  902. let dir_1 = (dir) => Math.atan2(Math.sin(dir), Math.cos(dir));
  903. let a1 = dir_1(
  904. (Math.atan2(data[2] - myPlayer.y, data[1] - myPlayer.x) +
  905. Math.PI +
  906. Math.PI) %
  907. (Math.PI * 2)
  908. );
  909. let a2 = dir_1((dir_1(data[3]) + Math.PI) % (Math.PI * 2));
  910. let a3 = a1 - a2;
  911. if (0.36 > a3 && -0.36 < a3) {
  912. //doNewSend(["6", ["Sync Detect Test"]]);
  913. doNewSend(["D",[Math.atan2(data[2] - myPlayer.y, data[1] - myPlayer.x)],]);
  914. if (data[2] < 80 && data[2] > 0) {
  915. doNewSend(["c", [0, 6, 0]]);
  916. place(foodType);
  917. place(foodType);
  918. }
  919. }
  920. }
  921. }
  922. if (myPlayer.hat == 45 && shame) shameTime = 30000;
  923. if (myPlayer.hat == 45 && shame) shame = 30000;
  924. if (data[0] == "a") {
  925. gameTick++;
  926. }
  927. if (item == "O" && data[1] == myPlayer.id) {
  928. gameTick = 0;
  929. lastDamageTick = 0;
  930. shame = 0;
  931. HP = 100;
  932. shameTime = 0;
  933. if (item == "O" && data[1] == myPlayer.id) {
  934. let damage = HP - data[2];
  935. HP = data[2];
  936. if (damage <= -1) {
  937. damageTimes++;
  938. if (!lastDamageTick) return;
  939. let healTime = gameTick - lastDamageTick;
  940. lastDamageTick = 0;
  941. if (healTime <= 1) {
  942. shame = shame++;
  943. } else {
  944. shame = Math.max(0, shame - 2);
  945. }
  946. } else {
  947. lastDamageTick = gameTick;
  948. }
  949. }
  950. if (data[2] < 100 && data[2] > 0 && healToggle == true) {
  951. //normal heal
  952. console.log("normal healing");
  953. setTimeout(() => {
  954. place(foodType);
  955. place(foodType);
  956. doNewSend(["c", [0, 6, 0]]);
  957. // doNewSend(["6", ["Heal"]]);
  958. }, 115);
  959. }
  960. if (data[2] < 48 && data[2] > 0 && anti == true && (nearestEnemy[5] == 5 || nearestEnemy[5] == 3)) {
  961. healToggle = false;
  962. //antiinsta no sold for pol
  963. console.log("no soldier anti - polearm");
  964. doNewSend(["c", [0, 22, 0]]);
  965. //doNewSend(["6", ["Anti"]]);
  966. place(foodType);
  967. setTimeout(() => {
  968. place(foodType);
  969. doNewSend(["c", [0, 6, 0]]);
  970. healToggle = true;
  971. }, 200);
  972. setTimeout(() => {
  973. doNewSend(["c", [0, 7, 0]]);
  974. }, 700);
  975. setTimeout(() => {
  976. doNewSend(["c", [0, 6, 0]]);
  977. }, 1900);
  978. }
  979. if (data[2] < 62 && data[2] > 41 && anti == true && (nearestEnemy[5] == 5 || nearestEnemy[5] == 3)) {
  980. healToggle = false;
  981. //antiinsta for pol
  982. console.log("anti insta - polearm");
  983. doNewSend(["c", [0, 22, 0]]);
  984. //doNewSend(["6", ["Anti"]]);
  985. place(foodType);
  986. setTimeout(() => {
  987. place(foodType);
  988. doNewSend(["c", [0, 6, 0]]);
  989. healToggle = true;
  990. }, 200);
  991. setTimeout(() => {
  992. doNewSend(["c", [0, 7, 0]]);
  993. }, 700);
  994. setTimeout(() => {
  995. doNewSend(["c", [0, 6, 0]]);
  996. }, 1900);
  997. }
  998. if (data[2] < 56 && data[2] > 50) {
  999. healToggle = false;
  1000. //bullspam heal
  1001. console.log("anti bullspam");
  1002. setTimeout(() => {
  1003. place(foodType);
  1004. place(foodType);
  1005. doNewSend(["c", [0, 6, 0]]);
  1006. //doNewSend(["6", ["BHeal1"]]);
  1007. healToggle = true;
  1008. }, 140);
  1009. }
  1010. if (data[2] < 41 && data[2] > 0 && hitBack == true && nearestEnemy[5] == 4) {
  1011. console.log("hitbacking");
  1012. healToggle = false;
  1013. autoaim = true;
  1014. setTimeout(() => {
  1015. place(foodType);
  1016. place(foodType);
  1017. }, 133);
  1018. place(spikeType, nearestEnemyAngle);
  1019. doNewSend(["n", [1]]);
  1020. doNewSend(["c", [0, 7, 0]]);
  1021. doNewSend(["z", [primary, true]]);
  1022. setTimeout(() => {
  1023. doNewSend(["c", [0, 53, 0]]);
  1024. doNewSend(["n", [0]]);
  1025. healToggle = true;
  1026. }, 150);
  1027. setTimeout(() => {
  1028. doNewSend(["c", [0, 11, 0]]);
  1029. autoaim = false;
  1030. }, 300);
  1031. }
  1032. }
  1033. update();
  1034. }
  1035.  
  1036. function doNewSend(sender) {
  1037. ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
  1038. }
  1039.  
  1040. function acc(id) {
  1041. doNewSend(["c", [0, 0, 1]]);
  1042. doNewSend(["c", [0, id, 1]]);
  1043. }
  1044.  
  1045. function hat(id) {
  1046. doNewSend(["c", [0, id, 0]]);
  1047. }
  1048.  
  1049. function placeO(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  1050. doNewSend(["z", [myPlayer.weapon, true]]);
  1051. doNewSend(["z", [id, null]]);
  1052. doNewSend(["F", [1, angle]]);
  1053. doNewSend(["F", [0, angle]]);
  1054. doNewSend(["z", [myPlayer.weapon, true]]);
  1055. }
  1056.  
  1057. function place(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  1058. doNewSend(["z", [id, null]]);
  1059. doNewSend(["F", [1, angle]]);
  1060. doNewSend(["F", [0, angle]]);
  1061. doNewSend(["z", [myPlayer.weapon, true]]);
  1062. }
  1063.  
  1064. var repeater = function(key, action, interval, bu) {
  1065. let _isKeyDown = false;
  1066. let _intervalId = undefined;
  1067.  
  1068. return {
  1069. start(keycode) {
  1070. if (keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  1071. _isKeyDown = true;
  1072. if (_intervalId === undefined) {
  1073. _intervalId = setInterval(() => {
  1074. action();
  1075. if (!_isKeyDown) {
  1076. clearInterval(_intervalId);
  1077. _intervalId = undefined;
  1078. console.log("claered");
  1079. }
  1080. }, interval);
  1081. }
  1082. }
  1083. },
  1084.  
  1085. stop(keycode) {
  1086. if (keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  1087. _isKeyDown = false;
  1088. }
  1089. }
  1090. };
  1091.  
  1092.  
  1093. }
  1094.  
  1095. function removeArraysWithValue(arr, valueToRemove) {
  1096. for (let i = arr.length - 1; i >= 0; i--) {
  1097. const innerArray = arr[i];
  1098. if (innerArray.includes(valueToRemove)) {
  1099. arr.splice(i, 1);
  1100. }
  1101. }
  1102. }
  1103. let movementDirection
  1104. let millCount = 0;
  1105. let nearestRandomObjectX;
  1106. let nearestRandomObjectY;
  1107. let friendlyMillLocs = [];
  1108. let nearestFriendlyMill;
  1109. let nearestFriendlyMillX;
  1110. let nearestFriendlyMillY;
  1111. let nearestFriendlyMillScale;
  1112. let isNextToFriendlyMill = false;
  1113. let automilling = false
  1114. let automill = false
  1115. setInterval(()=>{
  1116. if(automill == true && isNextToFriendlyMill == false && millCount < 298 && automilling == false){
  1117. automilling = true;
  1118. doNewSend(["z",[millType, null]])
  1119. doNewSend(["F",[1, (movementDirection - 1.90)]])
  1120. doNewSend(["F",[0, (movementDirection - 1.90)]])
  1121. doNewSend(["z",[myPlayer.weapon, true]])
  1122. doNewSend(["z",[millType, null]])
  1123. doNewSend(["F",[1, (movementDirection - 3.14)]])
  1124. doNewSend(["F",[0, (movementDirection - 3.14)]])
  1125. doNewSend(["z",[myPlayer.weapon, true]])
  1126. doNewSend(["z",[millType, null]])
  1127. doNewSend(["F",[1, (movementDirection + 1.90)]])
  1128. doNewSend(["F",[0, (movementDirection + 1.90)]])
  1129. doNewSend(["z",[myPlayer.weapon, true]])
  1130. automilling = false
  1131. }
  1132. }, 100)
  1133. const boostPlacer = repeater(70,() => {place(boostType);},50);
  1134. const spikePlacer = repeater(86,() => {place(spikeType);},50);
  1135. const placers = [boostPlacer, spikePlacer];
  1136. let prevCount = 0;
  1137. const handleMutations = (mutationsList) => {
  1138. for (const mutation of mutationsList) {
  1139. if (mutation.target.id === "killCounter") {
  1140. const count = parseInt(mutation.target.innerText, 10) || 0;
  1141. if (count > prevCount) {
  1142. doNewSend(["6", ["."]]);
  1143. setTimeout(()=>{
  1144. doNewSend(["6", [""]]);
  1145. },650);
  1146. prevCount = count;
  1147. }
  1148. }
  1149. }
  1150. };
  1151.  
  1152.  
  1153. const observer = new MutationObserver(handleMutations);
  1154. observer.observe(document, {
  1155. subtree: true,
  1156. childList: true,
  1157. });
  1158.  
  1159. document.addEventListener('keydown', (e) => {
  1160. if (["allianceinput", "chatbox", "nameinput", "storeHolder"].includes(document.activeElement.id.toLowerCase()))
  1161. return null;
  1162. placers.forEach((t) => {
  1163. t.start(e.keyCode);
  1164. });
  1165.  
  1166. if (e.keyCode == 78 && document.activeElement.id.toLowerCase() !== "chatbox") {// N = Automill
  1167. automill = !automill;
  1168. }
  1169.  
  1170. if (e.keyCode == 72 && document.activeElement.id.toLowerCase() !== "chatbox") {// H = Turret/Teleporter
  1171. for (let i = 0; i < Math.PI * 1; i+= Math.PI / 2) {
  1172. place(turretType, myPlayer.dir + i);
  1173. place(turretType, myPlayer.dir - i);
  1174. }
  1175. }
  1176. /* if (e.keyCode == 16) {
  1177. biomeHat();
  1178. }*/
  1179. if (e.keyCode == 32 && document.activeElement.id.toLowerCase() !== "chatbox") {
  1180. // spiketick
  1181. autoaim = true;
  1182. console.log("spiektick");
  1183. place(spikeType, nearestEnemyAngle);
  1184. doNewSend(["F", [1]]);
  1185. doNewSend(["c", [0, 7, 0]]);
  1186. doNewSend(["z", [primary, true]]);
  1187. doNewSend(["F", [1]]);
  1188. setTimeout(() => {
  1189. doNewSend(["c", [0, 6, 0]]);
  1190. doNewSend(["F", [0]]);
  1191. autoaim = false;
  1192. }, 400);
  1193. }
  1194. if (e.keyCode == 89 && document.activeElement.id.toLowerCase() !== "chatbox") {//diamond pol 1 tick
  1195. autoaim = true;
  1196. doNewSend(["z", [primary, true]]);
  1197. doNewSend(["c", [0, 53, 0]]);
  1198. setTimeout(() => {
  1199. doNewSend(["c", [0, 7, 0]]);
  1200. doNewSend(["F", [1]]);
  1201. }, 100);
  1202. setTimeout(() => {
  1203. doNewSend(["z", [primary, true]]);
  1204. doNewSend(["c", [0, 6, 0]]);
  1205. doNewSend(["F", [0]]);
  1206. autoaim = false;
  1207. }, 500);
  1208. }
  1209. if (e.keyCode == 82 &&document.activeElement.id.toLowerCase() !== "chatbox") {
  1210. if (stackInsta == false) {
  1211. console.log("normal insta");
  1212. autoaim = true;
  1213. doNewSend(["c", [0, 7, 0]]);
  1214. doNewSend(["z", [primary, true]]);
  1215. doNewSend(["c", [0, 0, 1]])
  1216. doNewSend(["F", [1]]);
  1217. acc(18)
  1218. doNewSend(["c", [1]]);
  1219. setTimeout(() => {
  1220. doNewSend(["z", [secondary, true]]);
  1221. doNewSend(["c", [0, 53, 0]]);
  1222. doNewSend(["c", [0, 0, 1]]);
  1223. acc(21)
  1224. }, 105);
  1225. setTimeout(() => {
  1226. doNewSend(["z", [secondary, true]]);
  1227. }, 110);
  1228. setTimeout(() => {
  1229. doNewSend(["z", [secondary, true]]);
  1230. }, 115);
  1231. setTimeout(() => {
  1232. doNewSend(["z", [primary, true]]);
  1233. doNewSend(["F", [0, null]]);
  1234. doNewSend(["c", [0, 6, 0]]);
  1235. doNewSend(["c", [0, 0, 0]]);
  1236. doNewSend(["c", [0, 0, 1]]);
  1237. hat(6)
  1238. acc(21)
  1239. autoaim = false;
  1240. }, 215);
  1241. } else {
  1242. console.log("stack insta");
  1243. autoaim = true;
  1244. doNewSend(["c", [0, 7, 0]]);
  1245. doNewSend(["z", [primary, true]]);
  1246. doNewSend(["c", [0, 0, 1]])
  1247. doNewSend(["F", [1]]);
  1248. acc(18)
  1249. doNewSend(["c", [1]]);
  1250. setTimeout( () => {
  1251. var sck = "";
  1252. doNewSend(["z", [secondary, true]]);
  1253. doNewSend(["c", [0, 53, 0]]);
  1254. doNewSend(["c", [0, 0, 1]]);
  1255. for(let i = 0; i < 850; i++){
  1256. let caas = new Uint8Array(550);
  1257. for(let i = 0; i <caas.length;i++){
  1258. caas[i] = Math.floor(Math.random()*270);
  1259. sck += caas[i]
  1260. }
  1261. }
  1262. ws.send(caas);
  1263. }, 105);
  1264. setTimeout(() => {
  1265. doNewSend(["z", [secondary, true]]);
  1266. }, 200);
  1267. setTimeout(() => {
  1268. doNewSend(["z", [primary, true]]);
  1269. doNewSend(["F", [0, null]]);
  1270. doNewSend(["c", [0, 6, 0]]);
  1271. doNewSend(["c", [0, 0, 0]]);
  1272. doNewSend(["c", [0, 0, 1]]);
  1273. hat(6)
  1274. acc(21)
  1275. autoaim = false;
  1276. }, 215);
  1277. }
  1278. }
  1279. if (e.keyCode == 188 &&document.activeElement.id.toLowerCase() !== "chatbox") {
  1280. console.log("boost tick");
  1281. autoaim = true;
  1282. setTimeout(()=>{
  1283. doNewSend(["F", [1]]);
  1284. doNewSend(["z", [secondary, true]]);
  1285. },99);
  1286. setTimeout(()=>{
  1287. doNewSend(["c", [0, 53, 0]]);
  1288. place(boostType);
  1289. },50);
  1290. setTimeout(() => {
  1291. doNewSend(["z", [primary, true]]);
  1292. doNewSend(["c", [0, 7, 0]]);
  1293. doNewSend(["F", [1]]);
  1294. doNewSend(["F", [0]]);
  1295. }, 175);
  1296. setTimeout(() => {
  1297. doNewSend(["z", [primary, true]]);
  1298. doNewSend(["c", [0, 6, 0]]);
  1299. doNewSend(["F", [0]]);
  1300. autoaim = false;
  1301. }, 500);
  1302. }
  1303. if (e.keyCode == 84 && document.activeElement.id.toLowerCase() !== "chatbox") {
  1304. if(stackInsta == false){
  1305. // insta
  1306. autoaim = true;
  1307. console.log("reverse insta");
  1308. doNewSend(["F", [1]]);
  1309. doNewSend(["z", [secondary, true]]);
  1310. doNewSend(["c", [0, 53, 0]]);
  1311. setTimeout(() => {
  1312. doNewSend(["z", [primary, true]]);
  1313. doNewSend(["c", [0, 7, 0]]);
  1314. doNewSend(["n", [1]]);
  1315. doNewSend(["n", [0]]);
  1316. }, 80);
  1317. setTimeout(() => {
  1318. doNewSend(["z", [primary, true]]);
  1319. doNewSend(["c", [0, 6, 0]]);
  1320. doNewSend(["F", [0]]);
  1321. autoaim = false;
  1322. }, 500);
  1323. } else {
  1324. autoaim = true;
  1325. console.log("stacked reverse insta");
  1326. doNewSend(["F", [1]]);
  1327. doNewSend(["z", [secondary, true]]);
  1328. doNewSend(["c", [0, 53, 0]]);
  1329. setTimeout(() => {
  1330. var sck = "";
  1331. doNewSend(["z", [primary, true]]);
  1332. doNewSend(["c", [0, 7, 0]]);
  1333. doNewSend(["F", [1]]);
  1334. doNewSend(["F", [0]]);
  1335. for(let i = 0; i < 850; i++){
  1336. let caas = new Uint8Array(550);
  1337. for(let i = 0; i <caas.length;i++){
  1338. caas[i] = Math.floor(Math.random()*270);
  1339. sck += caas[i]
  1340. }
  1341. }
  1342. ws.send(caas);
  1343. }, 80);
  1344. setTimeout(() => {
  1345. doNewSend(["z", [primary, true]]);
  1346. doNewSend(["c", [0, 6, 0]]);
  1347. doNewSend(["F", [0]]);
  1348. autoaim = false;
  1349. }, 500);
  1350. }
  1351. }
  1352. if (e.keyCode == 66 &&document.activeElement.id.toLowerCase() !== "chatbox") {//manual bulltick
  1353. doNewSend(["c", [0, 7, 0]]);
  1354. setTimeout(()=>{
  1355. doNewSend(["c", [0, 13, 1]]);
  1356. },60);
  1357. }
  1358. })
  1359.  
  1360. document.addEventListener('keyup', (e) => {
  1361. if (["allianceinput", "chatbox", "nameinput", "storeHolder"].includes(document.activeElement.id.toLowerCase()))
  1362. return null;
  1363. placers.forEach((t) => {
  1364. t.stop(e.keyCode);
  1365. })
  1366. })
  1367.  
  1368. document.addEventListener("mousedown", (event) => {
  1369. if (event.button == 2 && secondary != 10) {
  1370. doNewSend(["F", [1]]);
  1371. doNewSend(["c", [0, 40, 0]]);
  1372. doNewSend(["z", [primary, true]]);
  1373. setTimeout(()=>{
  1374. doNewSend(["F", [0]]);
  1375. doNewSend(["c", [0, 6, 0]]);
  1376. },100);
  1377. } else if (event.button == 2) {
  1378. doNewSend(["F", [1]]);
  1379. doNewSend(["c", [0, 40, 0]]);
  1380. doNewSend(["z", [secondary, true]]);
  1381. setTimeout(()=>{
  1382. doNewSend(["F", [0]]);
  1383. doNewSend(["c", [0, 6, 0]]);
  1384. },100);
  1385. }
  1386. });
  1387.  
  1388. /*document.addEventListener("mousedown", (event) => {
  1389. if (event.button == 0) {
  1390. doNewSend(["F", [1]]);
  1391. doNewSend(["c", [0, 7, 0]]);
  1392. doNewSend(["z", [primary, true]]);
  1393. setTimeout(()=>{
  1394. doNewSend(["F", [0]]);
  1395. doNewSend(["c", [0, 6, 0]]);
  1396. },100);
  1397. }
  1398. });*/
  1399.  
  1400. function isElementVisible(e) {
  1401. return (e.offsetParent !== null);
  1402. }
  1403.  
  1404. function toRad(angle) {
  1405. return angle * 0.01745329251;
  1406. }
  1407.  
  1408. function dist(a, b) {
  1409. return Math.sqrt(Math.pow((b.y - a[2]), 2) + Math.pow((b.x - a[1]), 2));
  1410. }
  1411.  
  1412. function update() {
  1413. for (let i = 0; i < 9; i++) {
  1414. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1415. primary = i;
  1416. }
  1417. }
  1418.  
  1419. for (let i = 9; i < 16; i++) {
  1420. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1421. secondary = i;
  1422. }
  1423. }
  1424.  
  1425. for (let i = 16; i < 19; i++) {
  1426. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1427. foodType = i - 16;
  1428. }
  1429. }
  1430.  
  1431. for (let i = 19; i < 22; i++) {
  1432. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1433. wallType = i - 16;
  1434. }
  1435. }
  1436.  
  1437. for (let i = 22; i < 26; i++) {
  1438. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1439. spikeType = i - 16;
  1440. }
  1441. }
  1442.  
  1443. for (let i = 26; i < 29; i++) {
  1444. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1445. millType = i - 16;
  1446. }
  1447. }
  1448.  
  1449. for (let i = 29; i < 31; i++) {
  1450. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1451. mineType = i - 16;
  1452. }
  1453. }
  1454.  
  1455. for (let i = 31; i < 33; i++) {
  1456. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))) {
  1457. boostType = i - 16;
  1458. }
  1459. }
  1460.  
  1461. for (let i = 33; i < 39; i++) {
  1462. if (isElementVisible(document.getElementById("actionBarItem" + i.toString())) && i != 36) {
  1463. turretType = i - 16;
  1464. }
  1465. }
  1466.  
  1467. spawnpadType = 36;
  1468. }
  1469.  
  1470. var styleItem = document.createElement("style");
  1471. styleItem.type = "text/css";
  1472. styleItem.appendChild(document.createTextNode(`
  1473. .loader {
  1474. position: absolute;
  1475. top:110%;
  1476. left:46%;
  1477. border: 16px solid #333;
  1478. border-radius: 50%;
  1479. border-top: 16px solid #181818;
  1480. box-shadow: 0 0 10px 10px rgba(0, 0, 0, 0.4);
  1481. width: 60px;
  1482. height: 60px;
  1483. -webkit-animation: spin 0.5s linear infinite; /* Safari */
  1484. animation: spin 0.5s linear infinite;
  1485. }
  1486. @-webkit-keyframes spin {
  1487. 0% { -webkit-transform: rotate(0deg); }
  1488. 100% { -webkit-transform: rotate(360deg); }
  1489. }
  1490.  
  1491. @keyframes spin {
  1492. 0% { transform: rotate(0deg); }
  1493. 100% { transform: rotate(360deg); }
  1494. }
  1495. #gameUI .joinAlBtn, a {
  1496. animation: 5s infinite linear both normal rainbow;
  1497. }
  1498.  
  1499. @keyframes rainbow {
  1500. 0% { filter: hue-rotate(0deg) }
  1501. 100% { filter: hue-rotate(360deg) }
  1502. }`));
  1503. document.head.appendChild(styleItem);
  1504.  
  1505. window.addEventListener("load", () => {
  1506.  
  1507. let toggleRender = true;
  1508. let canvas = document.getElementById("gameCanvas");
  1509. let ctx = canvas.getContext("2d");
  1510. let screenWidth = 1920;
  1511. let screenHeight = 1080;
  1512. let screenW = screenWidth / 2;
  1513. let screenH = screenHeight / 2;
  1514.  
  1515. function render() {
  1516.  
  1517. if (toggleRender) {
  1518.  
  1519. ctx.beginPath();
  1520.  
  1521. let gradient = ctx.createRadialGradient(screenW, screenH, 0, screenW, screenH, screenWidth);
  1522. for (let i = 0; i <= 1; i++) {
  1523. gradient.addColorStop(i, "rgba(0, 0, 0, " + i + ")");
  1524. }
  1525.  
  1526. ctx.fillStyle = gradient;
  1527. ctx.rect(0, 0, screenWidth, screenHeight);
  1528. ctx.fill();
  1529.  
  1530. }
  1531.  
  1532. window.requestAnimFrame(render);
  1533.  
  1534. }
  1535.  
  1536. render();
  1537. });
  1538.  
  1539. document.addEventListener("keydown", function (e) {
  1540. if (e.keyCode == 27) {
  1541. $('#infomenu').toggle();
  1542. ext = !ext;
  1543. };
  1544. });
  1545.  
  1546. // Menu
  1547. $("body").after(`
  1548. <div id="infomenu">
  1549. <hr>
  1550. <div class="nameblock">VN Mod v2</div>
  1551. <hr>
  1552. <ul>
  1553. <li></label><label><div class="text">AntiInsta<input type="checkbox" id="anti" checked><span class="checkmark"></div></li>
  1554. <li></label><label><div class="text">HitBack<input type="checkbox" id="hitBack"><span class="checkmark"></div></li>
  1555. <li></label><label><div class="text">Stacked Insta<input type="checkbox" id="stackInsta"><span class="checkmark"></div></li>
  1556. </ul>
  1557. <hr>
  1558. <div class="nameblock">Controls:</div>
  1559. <hr>
  1560.  
  1561. <div class="text">
  1562. </li>
  1563. <li> N - Auto Triple Mill
  1564. </li>
  1565. <li> V - Spike
  1566. </li>
  1567. <li> F - Trap
  1568. </li>
  1569. <li> H - Double Turrets
  1570. </li>
  1571. <li> M - Music Menu
  1572. </li>
  1573. <li> Space - Perfect Stacked Spiketick
  1574. </li>
  1575. <li> RightClick - AutoBreaker
  1576. </li>
  1577. <li> R - Normal Instakill
  1578. </li>
  1579. <li> T - Reverse Instakill
  1580. </li>
  1581. <li> Y - OneTick
  1582. </li>
  1583. <li> , - Boost OneTick
  1584. </li>
  1585. <li> B - Bulltick
  1586. </li>
  1587. <li> Esc - Menu
  1588. </li>
  1589. </ul>
  1590. <hr>
  1591. </div>
  1592.  
  1593.  
  1594.  
  1595. </div>
  1596. <style>
  1597. button:active,
  1598. button:focus {
  1599. outline: none !important;
  1600. }
  1601. button::-moz-focus-inner {
  1602. border: 0 !important;
  1603. }
  1604. .nameblock {
  1605. font-size: 20px;
  1606. color: #dbdbdb;
  1607. text-align: center;
  1608. }
  1609. li {
  1610. font-size: 13px;
  1611. }
  1612. .text {
  1613. display: block;
  1614. font-size: 17px;
  1615. color: #fff;
  1616. text-align: left;
  1617. }
  1618. .menuToggle:hover{
  1619. cursor: pointer;
  1620. position: absolute;
  1621. background: linear-gradient(to right, red, orange, yellow, green, cyan, blue, violet);
  1622. background-size: 400% 400%;
  1623. -webkit-background-clip: text;
  1624. -webkit-text-fill-color: transparent;
  1625. -webkit-animation: colorR 20s ease infinite;
  1626. animation: colorR 20s ease infinite;
  1627. font-family: "Hammersmith One";
  1628. display: block !important;
  1629. top: 80px;
  1630. left: 1517px;
  1631. font-size: 17px;
  1632. }
  1633. .menuToggle{
  1634. cursor: pointer;
  1635. position: absolute;
  1636. background: linear-gradient(to right, gray, black);
  1637. background-size: 400% 400%;
  1638. -webkit-background-clip: text;
  1639. -webkit-text-fill-color: transparent;
  1640. -webkit-animation: colorR 20s ease infinite;
  1641. animation: colorR 20s ease infinite;
  1642. font-family: "Hammersmith One";
  1643. display: block !important;
  1644. top: 80px;
  1645. left: 1517px;
  1646. font-size: 17px;
  1647. }
  1648. ::-webkit-scrollbar { width: 5px; height: 3px;}
  1649. ::-webkit-scrollbar-button { background-color: #000000; }
  1650. ::-webkit-scrollbar-track { background-color: #999;}
  1651. ::-webkit-scrollbar-track-piece { background-color: rgba(0, 0, 0, 0.50);}
  1652. ::-webkit-scrollbar-thumb { height: 50px; background-color: #666; border-radius: 3px;}
  1653. ::-webkit-scrollbar-corner { background-color: #999;}}
  1654. ::-webkit-resizer { background-color: #666;}
  1655. #infomenu {
  1656. overflow-y: scroll;
  1657. overflow-x: hidden;
  1658. padding: 20px;
  1659. position: absolute;
  1660. display: none;
  1661. background: rgba(102, 102, 102, 0.25);
  1662. width: 310px;
  1663. height: 450px;
  1664. border: 2px solid black;
  1665. border-radius: 4px;
  1666. top: 80px;
  1667. left: 20px;
  1668. z-index: 1;
  1669. }
  1670. input {outline: 0 !important;}
  1671. .Input_Text_style, .Input_Buttob_style {
  1672. background: rgba(102, 102, 102);
  1673. border: 2px solid black;
  1674. border-radius: 10px;
  1675. color: #fff;
  1676. -o-transition: all 1s ease;
  1677. -ms-transition: all 1s ease;
  1678. -moz-transition: all 1s ease;
  1679. -webkit-transition: all 1s ease;
  1680. transition: all 1s ease;
  1681. }
  1682. .Input_Text_style:focus,.Input_Buttob_style:focus {
  1683. border: 2px solid #fff;
  1684. }
  1685. </style>
  1686. <script>
  1687. function InfoMenu() {
  1688. $("#infomenu").css({
  1689. "display" : "block"
  1690. });
  1691. }
  1692.  
  1693. /*(function() {
  1694. var UPDATE_DELAY = 700;
  1695. var lastUpdate = 0;
  1696. var frames = 0;
  1697. var values;
  1698. function updateCounter() {
  1699. var now = Date.now();
  1700. var elapsed = now - lastUpdate;
  1701. if (elapsed < UPDATE_DELAY) {
  1702. ++frames;
  1703. } else {
  1704. var fps = Math.round(frames / (elapsed / 1000));
  1705. document.getElementById("fps").textContent ="Fps: " + fps ;
  1706. frames = 0;
  1707. lastUpdate = now;
  1708. }
  1709. requestAnimationFrame(updateCounter);
  1710. }
  1711. lastUpdate = Date.now();
  1712. requestAnimationFrame(updateCounter);
  1713. })();
  1714. setInterval(()=>{
  1715. document.getElementById("ping").textContent = "Ping: " + window.pingTime;
  1716. },0);*/
  1717.  
  1718. </script>
  1719. `);
  1720. $("body").after(`
  1721. <div id="ShowMenu">
  1722. </span>
  1723. <div id="addtext">LeftAndRightClick: On</div>
  1724. <div id="addtext3">Balant macros: On</div>
  1725. <div id="addtext0">Soldier-Q: On</div>
  1726. <div id="addtext4">AutoSpawn: On</div>
  1727. <div id="addtext1">Left-Click</div>
  1728. <div id="addtext2">Right-Click</div>
  1729. <style>
  1730. #ShowMenu {
  1731. position:absolute !important;
  1732. display:block;
  1733. top: 5px;
  1734. left: 5px;
  1735. width: auto;
  1736. height: auto;
  1737. text-align: center;
  1738. }
  1739. #addtext,#addtext1,#addtext2,#addtext0,#addtext3,#addtext4{
  1740. display: none;
  1741. color: #fff;
  1742. background: linear-gradient(to right, red, orange, yellow, green, cyan, blue, violet);
  1743. background-size: 400% 400%;
  1744. font-size: 20px;
  1745. -webkit-background-clip: text;
  1746. -webkit-text-fill-color: transparent;
  1747. -webkit-animation: colorR 20s ease infinite;
  1748. animation: colorR 20s ease infinite;
  1749. }
  1750. @-webkit-keyframes colorR {
  1751. 0% { background-position: 0% 50% }
  1752. 50% { background-position: 100% 50% }
  1753. 100% { background-position: 0% 50% }
  1754. }
  1755. @keyframes colorR {
  1756. 0% { background-position: 0% 50% }
  1757. 50% { background-position: 100% 50% }
  1758. 100% { background-position: 0% 50% }
  1759. }
  1760. </style>
  1761. <script>
  1762. </script>
  1763. `);
  1764.  
  1765. var antii = document.querySelector("#anti")
  1766. antii.addEventListener('change', function() {
  1767. if (this.checked) {
  1768. anti = true;
  1769. } else {
  1770. anti = false;
  1771. }
  1772. });
  1773. var hitBackk = document.querySelector("#hitBack")
  1774. hitBackk.addEventListener('change', function() {
  1775. if (this.checked) {
  1776. hitBack = true;
  1777. } else {
  1778. hitBack = false;
  1779. }
  1780. });
  1781. var stackInstaa = document.querySelector("#stackInsta")
  1782. stackInstaa.addEventListener('change', function() {
  1783. if (this.checked) {
  1784. stackInsta = true;
  1785. } else {
  1786. stackInsta = false;
  1787. }
  1788. });
  1789. //ANTI SHAME & ANTI INSTA
  1790. function autobulltickandantiinsta () {
  1791. if (my.reSync && player.bullTick && tmpObj.shameCount > 2) {
  1792. my.reSync = true;
  1793. buyEquip(7, 0);
  1794. buyEquip(6, 0);
  1795. } else if (tmpObj.shameCount < 2 && tmpObj.shameCount > 1) {
  1796. my.reSync = false;
  1797. buyEquip(6, 0);
  1798. }
  1799. }
  1800. if (near.weaponIndex > 5 && near.dist2 <= 150) {
  1801. buyEquip(26, 0);
  1802. buyEquip(6, 0);
  1803. }
  1804. /** AUTO HEAL **/
  1805. let autoHeal = (health, damage) => {
  1806. let cHealSpeed = 120;
  1807.  
  1808. if (nearestEnemy && damage >= 35 && (nearestEnemy.weapon == weapon.polearm || nearestEnemy.weapon == weapon.short_sword) && (nearestEnemy.hat == 7 || nearestEnemy.hat == 53 || nearestEnemy.hat == 6)) {
  1809. cHealSpeed -= 70;
  1810. place(foodType, null);
  1811. } else if (nearestEnemy && damage >= 35) {
  1812. cHealSpeed -= 60;
  1813. } else {
  1814. cHealSpeed = 120;
  1815. }
  1816.  
  1817. if (health < myPlayer.maxHealth) {
  1818. let healing = setInterval(() => {
  1819. if (myPlayer.health < myPlayer.maxHealth) {
  1820. place(foodType, null);
  1821. } else {
  1822. clearInterval(healing);
  1823. }
  1824. }, cHealSpeed);
  1825. }
  1826. };
  1827.  
  1828. /** UPDATE HEALTH **/
  1829. let lastHealth = 100;
  1830. let updateHealth = (health, playerID) => {
  1831. if (myPlayer.id === playerID) {
  1832. let damage = Math.max(0, lastHealth - health);
  1833. myPlayer.health = health;
  1834. if (myPlayer.health > 0) {
  1835. autoHeal(myPlayer.health, damage);
  1836. }
  1837. lastHealth = health;
  1838. } else {
  1839. enemy.health = health;
  1840. }
  1841. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址