Greasy Fork is available in English.

VN Mod v2

Revolver killer

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