vnmod

aaaaaaaaa

  1. // ==UserScript==
  2. // @name vnmod
  3. // @namespace none
  4. // @version 1
  5. // @description aaaaaaaaa
  6. // @author aaaaaaaa
  7. // @match *://moomoo.io/*
  8. // @match *://sandbox.moomoo.io/*
  9. // @match *://dev.moomoo.io/*
  10. // @require https://greasyfork.org/scripts/423602-msgpack/code/msgpack.js?version=912797
  11. // @require http://code.jquery.com/jquery-3.3.1.min.js
  12. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  14. // @grant none
  15. // ==/UserScript==
  16. //SHAME AND PING
  17.  
  18. document.getElementById("enterGame").addEventListener('click', autohide);
  19. function autohide(){
  20. $("#ot-sdk-btn-floating").hide();
  21. }
  22. $("#moomooio_728x90_home").parent().css({display: "none"});
  23. document.getElementById('linksContainer2').innerHTML = ' vn pro ' ;
  24. document.getElementById('gameName').innerHTML = 'vnmod';
  25. document.getElementById('loadingText').innerHTML = 'vn loading'
  26. document.getElementById('diedText').innerHTML = "vn died";
  27. document.getElementById('diedText').style.color = "#ffffff";
  28. document.title = ' vnmod';
  29. document.getElementById("leaderboard").append ('vnmod');
  30. $("#mapDisplay").css({background: `url('https://i.pinimg.com/originals/97/57/67/975767e67adc18ad53d5a1a687cb6421.gif')`});
  31. document.getElementById("storeHolder").style = "height: 1150px; width: 400px;";
  32. document.getElementById("promoImgHolder").remove();
  33. document.querySelector("#pre-content-container").remove(); //ANTI AD
  34. $('#itemInfoHolder').css({'top':'1050px',
  35. 'left':'15px'
  36. });
  37. $("#youtuberOf").remove();
  38. $("#adCard").remove();
  39. $("#mobileInstructions").remove();
  40. $("#downloadButtonContainer").remove();
  41. $("#mobileDownloadButtonContainer").remove();
  42. $(".downloadBadge").remove();
  43.  
  44. (function(){if(document.querySelector("#customAudioPlayer"))return;
  45. var audioFiles=[{url:"https://cdn.discordapp.com/attachments/1062441866416619653/1069324203297362040/Barren_Gates_-_Obey_NCS_Release.mp3",title:"Obey NCS"},
  46. {url:"https://cdn.discordapp.com/attachments/1062441866416619653/1069323837608570941/Clarx_-_Zig_Zag_NCS_Release.mp3",title:"Zig Zag NCS"},
  47. {url:"https://cdn.discordapp.com/attachments/1062441866416619653/1069300879708135524/Anixto_-_Ride_Or_Die_NCS_Release.mp3",title:"Ride Or Die NCS"},
  48. {url:"https://cdn.discordapp.com/attachments/1062441866416619653/1069324799903531128/MP3DL.CC_Rival_-_Throne_-_ft._Neoni_NCS_Release-256k.mp3",title:"Throne NCS"},
  49. {url:"https://cdn.discordapp.com/attachments/905994516719345664/918544988965568562/Dirty_Palm_-_Ropes_feat._Chandler_Jewels_NCS10_Release.mp3",title:"Ropes NCS"},
  50. {url:"https://cdn.discordapp.com/attachments/905994516719345664/918546211584213023/Jonth_Tom_Wilson_Facading_MAGNUS_Jagsy_Vosai_RudeLies__Domastic_-_Heartless_NCS10_Release.mp3",title:"Heartless NCS"},
  51. {url:"https://cdn.discordapp.com/attachments/905873563490328626/920005714481672212/Anikdote_-_Turn_It_Up_NCS_Release.mp3",title:"Turn It Up NCS"},
  52. {url:"https://cdn.discordapp.com/attachments/905873563490328626/920006439999778856/Unknown_Brain_-_MATAFAKA_feat._Marvin_Divine_NCS_Release.mp3",title:"MATAFKA NCS"},
  53. {url:"https://cdn.discordapp.com/attachments/905994516719345664/918910823290769458/koven_never_have_i_felt_this_ncs_release_gqEQ_nIByoK-gucZcxBO.mp3",title:"Never Have I Felt This NCS"},
  54. {url:"https://cdn.discordapp.com/attachments/905994516719345664/925144953611505714/Rebel_Scum__Dani_King__Centrix_-_Calm_Before_The_Storm_NCS_Release.mp3",title:"Calm Before The Storm NCS"}];
  55. var currentIndex=0;
  56. var audio=new Audio(audioFiles[currentIndex].url);
  57. audio.preload="auto";
  58. audio.volume=0.1;
  59. var repeat=false;
  60. var shuffled=false;
  61. function playNext()
  62. {if(shuffled){currentIndex=Math.floor(Math.random()*audioFiles.length);
  63. }else if(!repeat)
  64. {currentIndex=(currentIndex+1)%audioFiles.length;
  65. }audio.src=audioFiles[currentIndex].url;audio.play();label.textContent=audioFiles[currentIndex].title;playButton.textContent='Pause';playButton.style.background='red';var trackButtons=document.querySelectorAll(".track-button");trackButtons.forEach(function(trackButton,index){if(index===currentIndex){trackButton.classList.add("active");}else{trackButton.classList.remove("active");}});}function formatDuration(duration){var minutes=Math.floor(duration/60);var seconds=Math.floor(duration%60);return minutes+':'+(seconds<10?'0':'')+seconds;}audio.addEventListener('ended',playNext);audio.addEventListener('timeupdate',function(){durationDisplay.textContent=formatDuration(audio.currentTime)+'/'+formatDuration(audio.duration);});var player=document.createElement('div');player.id="customAudioPlayer";player.style='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;';
  66. var profilePicture=document.createElement('img');
  67. profilePicture.src='https://yt3.ggpht.com/jI1t37BCsCD_jMVBEqQPUghbRmz3KMny540V-r5iYAHaJeGolUYdUE8o1QCok7HMxEzZHZGS9Q=s600-c-k-c0x00ffffff-no-rj-rp-mo';
  68. profilePicture.style='width:60px;height:60px;border-radius:50%;cursor:pointer;';
  69. profilePicture.onclick=function(){window.location.href='https://www.youtube.com/channel/UCub84Dy0SSA0NgCqeUdjpsA';};
  70. player.appendChild(profilePicture);
  71. var label=document.createElement('div');
  72. label.textContent=audioFiles[currentIndex].title;
  73. label.style='margin-top:10px;text-align:center;';
  74. player.appendChild(label);
  75. var playButton=document.createElement('button');
  76. playButton.textContent='Play';playButton.style='margin-top:10px;width:100%;padding:10px;border:none;border-radius:5px;background-color:green;color:white;cursor:pointer;';playButton.onclick=function(){if(audio.paused){audio.play();this.textContent='Pause';this.style.background='red';}else{audio.pause();this.textContent='Play';this.style.background='green';}};player.appendChild(playButton);var nextButton=document.createElement('button');nextButton.textContent='Next';nextButton.style='margin-top:10px;width:100%;padding:10px;border:none;border-radius:5px;background-color:white;color:black;cursor:pointer;';nextButton.onclick=playNext;player.appendChild(nextButton);var shuffleRepeatContainer=document.createElement('div');shuffleRepeatContainer.style='display:flex;justify-content:space-between;width:100%;margin-top:10px;';player.appendChild(shuffleRepeatContainer);var shuffleButton=document.createElement('button');shuffleButton.textContent='Shuffle: Off';shuffleButton.style='padding:10px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:48%;';shuffleButton.onclick=function(){shuffled=!shuffled;this.textContent=shuffled?'Shuffle: On':'Shuffle: Off';};shuffleRepeatContainer.appendChild(shuffleButton);var repeatButton=document.createElement('button');repeatButton.textContent='Repeat: Off';repeatButton.style='padding:10px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:48%;';repeatButton.onclick=function(){repeat=!repeat;this.textContent=repeat?'Repeat: On':'Repeat: Off';};shuffleRepeatContainer.appendChild(repeatButton);var durationDisplay=document.createElement('div');durationDisplay.style='margin-top:10px;text-align:center;';player.appendChild(durationDisplay);var trackList=document.createElement('div');trackList.style='overflow:auto;max-height:150px;margin-top:20px;border:1px solid #fff;border-radius:10px;padding:5px;';audioFiles.forEach(function(track,index){var trackButton=document.createElement('button');trackButton.textContent=track.title;trackButton.classList.add("track-button");trackButton.style='padding:5px;border:none;border-radius:5px;background-color:black;color:white;cursor:pointer;width:100%;text-align:left;margin-top:5px;';trackButton.onclick=function(){currentIndex=index;audio.src=track.url;audio.play();label.textContent=track.title;playButton.textContent='Pause';playButton.style.background='red';trackButtons.forEach(function(trackButton,i){if(i===currentIndex){trackButton.classList.add("active");}else{trackButton.classList.remove("active");}});};trackList.appendChild(trackButton);});player.appendChild(trackList);var activeButtonStyle=document.createElement("style");activeButtonStyle.innerHTML='.track-button.active{background-color:green;}';document.head.appendChild(activeButtonStyle);var madeByLabel=document.createElement('div');madeByLabel.textContent='Made by Zod324myers';madeByLabel.style='margin-top:auto;text-align:center;';player.appendChild(madeByLabel);document.body.appendChild(player);document.addEventListener('keydown',function(e){if(e.key==='m'){player.style.display=player.style.display==='none'?'flex':'none';}});})();
  77.  
  78.  
  79. let details = document.createElement("div");
  80. details.id = "details";
  81. document.body.prepend(details);
  82. var ping = document.getElementById("pingDisplay");
  83. ping.style.fontSize = "20px";
  84. ping.style.display = "block";
  85. ping.style.zIndex = "1";
  86. document.body.appendChild(ping);
  87. setInterval(function() {
  88. if (window.pingTime && ping) {
  89. ping.innerHTML = "Ping: " + window.pingTime //+ " | " + (myPlayer.hat == 45 ? "ShameTimer-[" + 30-1 + "s]" : "Shame[" + shame + "]");
  90. }
  91. }, window.pingTime ? 0 : 1e3); //Credits to [GG]GAMER (skidded shaem counter)
  92.  
  93. let lastDamageTick = 0;
  94. let HP = 100;
  95. let gameTick = 0;
  96. var shame = 0;
  97. let shameTime,
  98. damageTimes = 0;
  99. let friendlyMillLocs = [];
  100. let nearestFriendlyMill;
  101. let nearestFriendlyMillX;
  102. let nearestFriendlyMillY;
  103. let nearestFriendlyMillScale;
  104. let isNextToFriendlyMill = false;
  105.  
  106. function removeArraysWithValue(arr, valueToRemove) {
  107. for (let i = arr.length - 1; i >= 0; i--) {
  108. const innerArray = arr[i];
  109. if (innerArray.includes(valueToRemove)) {
  110. arr.splice(i, 1);
  111. }
  112. }
  113. }
  114.  
  115. let movementDirection
  116.  
  117. let millCount = 0;
  118.  
  119. let nearestRandomObjectX;
  120. let nearestRandomObjectY;
  121.  
  122. let mouseX;
  123. let mouseY;
  124.  
  125. let width;
  126. let height;
  127.  
  128. setInterval(() => {
  129. if(hatToggle == 1) {
  130. if(oldHat != normalHat) {
  131. hat(normalHat);
  132. console.log("Tried. - Hat")
  133. }
  134. if(oldAcc != normalAcc) {
  135. acc(normalAcc);
  136. console.log("Tried. - Acc")
  137. }
  138. oldHat = normalHat;
  139. oldAcc = normalAcc
  140. }
  141. }, 25);
  142. setInterval(function() {
  143. if (myPlayer.hat == 45) {
  144. doNewSend(["6", ["toi vn khong giet lam on"]]);
  145. }
  146. }, 100);
  147. function normal() {
  148. hat(normalHat);
  149. acc(normalAcc);
  150. }
  151.  
  152. function aim(x, y){
  153. var cvs = document.getElementById("gameCanvas");
  154. cvs.dispatchEvent(new MouseEvent("mousemove", {
  155. clientX: x,
  156. clientY: y
  157.  
  158. }));
  159. }
  160.  
  161. let coreURL = new URL(window.location.href);
  162. window.sessionStorage.force = coreURL.searchParams.get("fc");
  163.  
  164. let trap_a = null;
  165. let intrap = false;
  166. let trapid = null;
  167. var antitrap = false;
  168. var isEnemyNear;
  169. var primary;
  170. var secondary;
  171. var foodType;
  172. var wallType;
  173. var spikeType;
  174. var millType;
  175. var mineType;
  176. var boostType;
  177. var turretType;
  178. var spawnpadType;
  179. var autoaim = false;
  180. var autoprimary = false;
  181. var autosecondary = false;
  182. var tick = 1;
  183. var oldHat;
  184. var oldAcc;
  185. var enemiesNear;
  186. var normalHat;
  187. var normalAcc;
  188. var ws;
  189. var msgpack5 = msgpack;
  190. var boostDir;
  191. let myPlayer = {
  192. id: null,
  193. x: null,
  194. y: null,
  195. dir: null,
  196. object: null,
  197. weapon: null,
  198. clan: null,
  199. isLeader: null,
  200. hat: null,
  201. accessory: null,
  202. isSkull: null
  203. };
  204.  
  205. let healSpeed = 100;
  206. var messageToggle = 0;
  207. var clanToggle = 0;
  208. let healToggle = 1;
  209. let hatToggle = 1;
  210. var antiInsta = true;
  211.  
  212. document.msgpack = msgpack;
  213. function n(){
  214. this.buffer = new Uint8Array([0]);
  215. this.buffer.__proto__ = new Uint8Array;
  216. this.type = 0;
  217. }
  218.  
  219. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  220. WebSocket.prototype.send = function(m){
  221. if (!ws){
  222. document.ws = this;
  223.  
  224. ws = this;
  225. socketFound(this);
  226. }
  227. this.oldSend(m);
  228. };
  229.  
  230. function biomeHat() {
  231. if (myPlayer.y < 2400) {
  232. hat(6);
  233. } else {
  234. if (myPlayer.y > 6850 && myPlayer.y < 7550) {
  235. hat(6);
  236. } else {
  237. hat(6);
  238. }
  239. }
  240. //acc(11);
  241. }
  242. function socketFound(socket){
  243. socket.addEventListener('message', function(message){
  244. handleMessage(message);
  245. });
  246. }
  247.  
  248. function handleMessage(m){
  249. let temp = msgpack5.decode(new Uint8Array(m.data));
  250. let data;
  251. if(temp.length > 1) {
  252. data = [temp[0], ...temp[1]];
  253. if (data[1] instanceof Array){
  254. data = data;
  255. }
  256. } else {
  257. data = temp;
  258. }
  259. let item = data[0];
  260. if(!data) {return};
  261. update();
  262. if (item == "C" && myPlayer.id == null){
  263. myPlayer.id = data[1];
  264. }
  265. if (item == "a") {
  266. for(let i = 0; i < data[1].length / 13; i++) {
  267. let playerInfo = data[1].slice(13*i, 13*i+13);
  268. if(playerInfo[0] == myPlayer.id) {
  269. myPlayer.x = playerInfo[1];
  270. myPlayer.y = playerInfo[2];
  271. myPlayer.dir = playerInfo[3];
  272. myPlayer.object = playerInfo[4];
  273. myPlayer.weapon = playerInfo[5];
  274. myPlayer.clan = playerInfo[7];
  275. myPlayer.isLeader = playerInfo[8];
  276. myPlayer.hat = playerInfo[9];
  277. myPlayer.accessory = playerInfo[10];
  278. myPlayer.isSkull = playerInfo[11];
  279. } else if(playerInfo[7] != myPlayer.clan || playerInfo[7] === null) {
  280. enemiesNear.push(playerInfo);
  281. }
  282. }
  283. }
  284. update();
  285. if (item == "H") {
  286. for(let i = 0; i < data[1].length / 8; i++) {
  287. let info = data[1].slice(8*i, 8*i+8);
  288. if(info[6] == millType && info[7] == myPlayer.id){
  289. friendlyMillLocs.push(info)
  290. }
  291.  
  292. if(info[7] == myPlayer.id){
  293. onWeapon = true;
  294. }
  295. }
  296.  
  297. }
  298. update();
  299. if(item == "Q"){
  300. removeArraysWithValue(friendlyMillLocs, data[1])
  301. }
  302. update();
  303. if(item == "R"){
  304. removeArraysWithValue(friendlyMillLocs, data[1])
  305. }
  306. update();
  307. if(item == "S"){
  308. if(data[1] == 3){
  309. millCount = data[2];
  310. }
  311. }
  312. update();
  313. if(friendlyMillLocs){
  314. nearestFriendlyMill = friendlyMillLocs.sort((a,b) => dist(a, myPlayer) - dist(b, myPlayer))[0];
  315.  
  316. if(nearestFriendlyMill){
  317. nearestFriendlyMillX = nearestFriendlyMill[1]
  318. nearestFriendlyMillY = nearestFriendlyMill[2]
  319. nearestFriendlyMillScale = nearestFriendlyMill[4]
  320. }
  321. }
  322. if(Math.sqrt(Math.pow((myPlayer.y-nearestFriendlyMillY), 2) + Math.pow((myPlayer.x-nearestFriendlyMillX), 2)) < nearestFriendlyMillScale + 100) {
  323. console.log(true)
  324. isNextToFriendlyMill = true;
  325. //isNextToFriendlyMill = false;
  326. } else {
  327. isNextToFriendlyMill = false;
  328. }
  329. WebSocket.prototype.send = function(m){
  330. let xcc = new Uint8Array(m);
  331. this.oldSend(m);
  332. let realData = {};
  333. let realInfo = msgpack5.decode(xcc);
  334. if (realInfo[1] instanceof Array){
  335. realData.data = [realInfo[0], ...realInfo[1]]
  336. }
  337. let rd0 = realData.data[0];
  338. let rd1 = realData.data[1];
  339. let rd2 = realData.data[2]
  340.  
  341. if(rd0 == 'a'){
  342. movementDirection = rd1
  343. }
  344. };
  345. isEnemyNear = false;
  346. if (myPlayer.hat == 45 && shame) shameTime = 30000;
  347. if (myPlayer.hat == 45 && shame) shame = 30000;
  348. if (data[0] == "33") {
  349. gameTick++;
  350. }
  351. if(item == "O" && data[1] == myPlayer.id) {
  352. (gameTick = 0);
  353. (lastDamageTick = 0);
  354. (shame = 0);
  355. (HP = 100);
  356. (shameTime = 0);
  357. if (item == "h" && data[1] == myPlayer.id) {
  358. let damage = HP - data[2];
  359. HP = data[2];
  360. if (damage <= -1) {
  361. damageTimes++;
  362. if (!lastDamageTick) return;
  363. let healTime = gameTick - lastDamageTick;
  364. lastDamageTick = 0;
  365. if (healTime <= 1) {
  366. shame = shame++;
  367. } else {
  368. shame = Math.max(0, shame - 2);
  369. }
  370. } else {
  371. lastDamageTick = gameTick;
  372. }
  373. }
  374. if (data[2] < 100 && data[2] > 55) {//normal heal
  375. console.log("normal healing")
  376. setTimeout(() => {
  377. place(foodType);
  378. place(foodType);
  379. doNewSend(["c", [0, 11, 0]]);
  380. // doNewSend(["6", ["Heal"]]);
  381. }, 133);
  382. }
  383. if (data[2] < 33 && data[2] > 0) {//antiinsta no sold
  384. console.log("no soldier anti")
  385. doNewSend(["c", [0, 22, 0]]);
  386. //doNewSend(["6", ["Anti"]]);
  387. place(foodType);
  388. setTimeout(() => {
  389. place(foodType);
  390. }, 170);
  391. setTimeout(() => {
  392. doNewSend(["c", [0, 7, 0]]);
  393. }, 760);
  394. setTimeout( () => {
  395. doNewSend(["c", [0, 11, 0]]);
  396. }, 1900);
  397. }
  398. if (data[2] < 51 && data[2] > 40) {//antiinsta for pol
  399. console.log("anti insta")
  400. doNewSend(["c", [0, 22, 0]]);
  401. //doNewSend(["6", ["Anti"]]);
  402. place(foodType);
  403. setTimeout(() => {
  404. place(foodType);
  405. }, 170);
  406. setTimeout(() => {
  407. doNewSend(["c", [0, 7, 0]]);
  408. }, 760);
  409. setTimeout( () => {
  410. doNewSend(["c", [0, 11, 0]]);
  411. }, 1900);
  412. }
  413. if (data[2] < 56 && data[2] > 50) {//bullspam heal
  414. console.log("anti bullspam")
  415. setTimeout(() => {
  416. place(foodType);
  417. place(foodType);
  418. doNewSend(["c", [0, 11, 0]]);
  419. //doNewSend(["6", ["BHeal1"]]);
  420. }, 150);
  421. }
  422. if (data[2] < 41 && data[2] > 0) {
  423. console.log("hitbacking")
  424. setTimeout(() => {
  425. place(foodType);
  426. place(foodType);
  427. }, 133);
  428. place(spikeType);
  429. doNewSend(["d",[1]]);
  430. doNewSend(["c", [0, 7, 0]]);
  431. doNewSend(["G", [primary, true]]);
  432. doNewSend(["d",[1]]);
  433. setTimeout(() => {
  434. place(spikeType, + toRad(45));
  435. doNewSend(["d",[1]]);
  436. place(spikeType, - toRad(45));
  437. doNewSend(["d",[1]]);
  438. doNewSend(["c", [0, 53, 0]]);
  439. doNewSend(["d",[0]]);
  440. },150);
  441. setTimeout(() => {
  442. doNewSend(["c", [0, 11, 0]]);
  443. },300);
  444.  
  445. }
  446. }
  447. update();
  448. };
  449. function doNewSend(sender){
  450. ws.send(new Uint8Array(Array.from(msgpack5.encode(sender))));
  451. }
  452. function acc(id) {
  453. doNewSend(["c", [0, 0, 1]]);
  454. doNewSend(["c", [0, id, 1]]);
  455. }
  456.  
  457. function hat(id) {
  458. doNewSend(["c", [0, id, 0]]);
  459. }
  460.  
  461.  
  462. function place(id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) {
  463. doNewSend(["G", [id, null]]);
  464. doNewSend(["d", [1, angle]]);
  465. doNewSend(["d", [0, angle]]);
  466. doNewSend(["G", [primary, true]]);
  467. }
  468.  
  469. var repeater = function(key, action, interval) {
  470. let _isKeyDown = false;
  471. let _intervalId = undefined;
  472.  
  473. return {
  474. start(keycode) {
  475. if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  476. _isKeyDown = true;
  477. if(_intervalId === undefined) {
  478. _intervalId = setInterval(() => {
  479. action();
  480. if(!_isKeyDown){
  481. clearInterval(_intervalId);
  482. _intervalId = undefined;
  483. }
  484. }, interval);
  485. }
  486. }
  487. },
  488.  
  489. stop(keycode) {
  490. if(keycode == key && document.activeElement.id.toLowerCase() !== 'chatbox') {
  491. _isKeyDown = false;
  492. }
  493. }
  494. };
  495.  
  496.  
  497. }
  498.  
  499. let automilling = false;
  500. let automill = false;
  501. setInterval(()=>{
  502. if(automill == true && isNextToFriendlyMill == false && millCount < 300 && automilling == false){
  503. automilling = true;
  504. doNewSend(["G",[millType, null]])
  505. doNewSend(["d",[1, (movementDirection - 1.90)]])
  506. doNewSend(["G",[myPlayer.weapon, true]])
  507. doNewSend(["G",[millType, null]])
  508. doNewSend(["d",[1, (movementDirection - 3.14)]])
  509. doNewSend(["G",[myPlayer.weapon, true]])
  510. doNewSend(["G",[millType, null]])
  511. doNewSend(["d",[1, (movementDirection + 1.90)]])
  512. doNewSend(["G",[myPlayer.weapon, true]])
  513. automilling = false
  514. }
  515. }, 100);
  516. let tankspam = false;
  517. let tankspamming = false;
  518. setInterval(()=>{
  519. if(tankspam == true && tankspamming == false){
  520. tankspamming = true;
  521. doNewSend(["c", [0, 40, 0]]);
  522. doNewSend(["G", [secondary, true]]);
  523. doNewSend(["d",[1]]);
  524. setTimeout(() => {
  525. doNewSend(["c", [0, 6, 0]]);
  526. tankspamming = false
  527. doNewSend(["d",[0]]);
  528. },200);
  529. }
  530. },325);
  531. const boostPlacer = repeater(70, () => {place(boostType)}, 50);
  532. const spikePlacer = repeater(86, () => {place(spikeType)}, 50);
  533. const placers = [boostPlacer, spikePlacer];
  534. let prevCount = 0;
  535. const handleMutations = mutationsList => {
  536. for (const mutation of mutationsList) {
  537. if (mutation.target.id === "killCounter") {
  538. const count = parseInt(mutation.target.innerText, 10) || 0;
  539. if (count > prevCount) {
  540. doNewSend(["6", ["vnmod pro autoGG"]]);
  541. prevCount = count;
  542. }
  543. }
  544. }
  545. };
  546. const observer = new MutationObserver(handleMutations);
  547. observer.observe(document, {
  548. subtree: true,
  549. childList: true
  550. });
  551. document.addEventListener('keydown', (e) => {
  552. if (["allianceinput", 'chatbox', 'nameinput','storeHolder'].includes(document.activeElement.id.toLowerCase())) return null;
  553. placers.forEach(t => {
  554. t.start(e.keyCode);
  555. });
  556.  
  557. if(e.keyCode == 78 && document.activeElement.id.toLowerCase() !== 'chatbox'){// N = Automill
  558. automill = !automill
  559. }
  560.  
  561. if(e.keyCode == 72 && document.activeElement.id.toLowerCase() !== 'chatbox'){// H = Turret/Teleporter
  562. place(turretType, myPlayer.dir + toRad(45));
  563. place(turretType, myPlayer.dir - toRad(45));
  564.  
  565. }
  566. if (e.keyCode == 16) {//booster hat
  567. biomeHat()
  568. }
  569. if(e.keyCode == 32 && document.activeElement.id.toLowerCase() !== 'chatbox'){// spiketick
  570. console.log("spiektick")
  571. place(spikeType);
  572. doNewSend(["d",[1]]);
  573. doNewSend(["c", [0, 7, 0]]);
  574. doNewSend(["G", [primary, true]]);
  575. doNewSend(["d",[1]]);
  576. setTimeout(() => {
  577. doNewSend(["c", [0, 53, 0]]);
  578. },200);
  579. setTimeout(() => {
  580. doNewSend(["c", [0, 6, 0]]);
  581. doNewSend(["d",[0]]);
  582. },150);
  583. }
  584. if(e.keyCode == 84 && document.activeElement.id.toLowerCase() !== 'chatbox'){// insta
  585. console.log("katana insta")
  586. doNewSend(["d",[1]])
  587. doNewSend(["G", [secondary, true]]);
  588. doNewSend(["c", [0, 53, 0]]);
  589. setTimeout(() => {
  590. doNewSend(["G", [primary, true]]);
  591. doNewSend(["c", [0, 7, 0]]);
  592. doNewSend(["d",[1]]);
  593. doNewSend(["d",[0]]);
  594. },100);
  595. setTimeout(() => {
  596. doNewSend(["G", [primary, true]]);
  597. doNewSend(["c", [0, 6, 0]]);
  598. doNewSend(["d",[0]]);
  599. },900);
  600. }
  601. })
  602. document.addEventListener("mousedown", event => {
  603. if(event.button == 2 && document.activeElement.id.toLowerCase() !== 'chatbox'){// spiketick
  604. tankspam = !tankspam
  605. }
  606. });
  607. document.addEventListener('keyup', (e) => {
  608. placers.forEach(t => {
  609. t.stop(e.keyCode);
  610. });
  611. /*if (e.keyCode == 71) {
  612. setTimeout(() => {
  613. doNewSend(["33", [null]]);
  614. boostDir = null;
  615. }, 10);
  616. }*/
  617. })
  618. function isElementVisible(e) {
  619. return (e.offsetParent !== null);
  620. }
  621.  
  622. function toRad(angle) {
  623. return angle * 0.01745329251;
  624. }
  625.  
  626. function dist(e, o) {
  627. return e && o
  628. ? Math.sqrt((e.x - o.x) ** 2 + (e.y - o.y) ** 2)
  629. : null
  630. };
  631. function update() {
  632. for (let i=0;i<9;i++){
  633. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  634. primary = i;
  635. }
  636. }
  637.  
  638. for (let i=9;i<16;i++){
  639. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  640. secondary = i;
  641. }
  642. }
  643.  
  644. for (let i=16;i<19;i++){
  645. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  646. foodType = i - 16;
  647. }
  648. }
  649.  
  650. for (let i=19;i<22;i++){
  651. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  652. wallType = i - 16;
  653. }
  654. }
  655.  
  656. for (let i=22;i<26;i++){
  657. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  658. spikeType = i - 16;
  659. }
  660. }
  661.  
  662. for (let i=26;i<29;i++){
  663. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  664. millType = i - 16;
  665. }
  666. }
  667.  
  668. for (let i=29;i<31;i++){
  669. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  670. mineType = i - 16;
  671. }
  672. }
  673.  
  674. for (let i=31;i<33;i++){
  675. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  676. boostType = i - 16;
  677. }
  678. }
  679.  
  680. for (let i=33;i<36;i++){
  681. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  682. turretType = i - 16;
  683. }
  684. }
  685.  
  686. for (let i=36;i<37;i++){
  687. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  688. spawnpadType = i - 16;
  689. }
  690. }
  691.  
  692. for (let i=37;i<39;i++){
  693. if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
  694. turretType = i - 16;
  695. }
  696. }
  697. }