Clap mod

I hate seeing people killing me with my mod

  1. // ==UserScript==
  2. // @name Clap mod
  3. // @version v2
  4. // @description I hate seeing people killing me with my mod
  5. // @match http*://*.moomoo.io/*
  6. // @icon https://www.google.com/s2/favicons?sz=64&domain=moomoo.io
  7. // @require https://update.gf.qytechs.cn/scripts/423602/1005014/msgpack.js
  8. // @license MIT
  9. // @grant none
  10. // @namespace Good Guy
  11. // ==/UserScript==
  12. /** VARIABLES **/
  13. let spike = 0;
  14. let weapongrind = false;
  15. let { msgpack, config, jQuery: $ } = window;
  16. let leaderboard = document.getElementById('leaderboard')
  17. let gameCanvas = document.getElementById("gameCanvas");
  18. let mainContext = gameCanvas.getContext("2d");
  19. let storeMenu = document.getElementById("storeMenu");
  20. let allianceMenu = document.getElementById("allianceMenu");
  21. let chatHolder = document.getElementById("chatHolder");
  22. let altchaCheckbox = document.getElementById('altcha_checkbox');
  23. let altcha = document.getElementById('altcha');
  24. let menuOpened = false;
  25. let mouseX, mouseY, width = innerWidth, height = innerHeight;
  26. let moveKeys = { w: false, a: false, s: false, d: false };
  27. let myPlayer = {
  28. id: null, x: null, y: null, dir: null, object: null, weapon: null, clan: null,
  29. isLeader: null, maxXP: 300, XP: 0, age: 1, hat: null, accessory: null, isSkull: null, maxHealth: 100
  30. };
  31. let locked = false, gameTick = 0, enemy = [], ws = null;
  32. let tPing = 90;
  33. let players = [], nearestEnemy = {}, enemyAngle, isEnemyNear;
  34. let primary, secondary, foodType, wallType, spikeType, millType, mineType, boostType, spawnpadType, turretType, haveMine;
  35. let SaVeGe = {
  36. tick: 0,
  37. tickQueue: [],
  38. manage: [],
  39. tickRate: 1000 / 9,
  40. tickSpeed: 0,
  41. lastTick: performance.now(),
  42. tickBase(set, tick) {
  43. const targetTick = this.tick + tick;
  44. this.tickQueue[targetTick] = this.tickQueue[targetTick] ?? [];
  45. this.tickQueue[targetTick].push(set);
  46. }
  47. };
  48.  
  49. document.getElementById("gameName").innerHTML = "Clap mod";
  50. document.querySelector("#pre-content-container").remove(); //ANTI AD
  51.  
  52. /** SOCKET **/
  53. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  54. WebSocket.prototype.send = function (m) {
  55. if (!ws) {
  56. document.websocket = this;
  57. ws = this;
  58. socketFound(this);
  59. }
  60. this.oldSend(m);
  61. };
  62.  
  63. /** FPS BOOSTER **/
  64. let { maxScreenWidth, maxScreenHeight } = config;
  65. let FPSBooster;
  66. let { moveTo, lineTo } = CanvasRenderingContext2D.prototype;
  67.  
  68. CanvasRenderingContext2D.prototype.moveTo = function(x, y) {
  69. if (!FPSBooster || this.globalAlpha !== 0.06) {
  70. return moveTo.call(this, x, y);
  71. }
  72. };
  73. CanvasRenderingContext2D.prototype.lineTo = function(x, y) {
  74. if (!FPSBooster || this.globalAlpha !== 0.06) {
  75. return lineTo.call(this, x, y);
  76. }
  77. };
  78.  
  79. class Checker {
  80. check(callback) {
  81. return (event) => {
  82. if (event instanceof Event && (event.isTrusted ?? true)) {
  83. callback(event);
  84. }
  85. };
  86. }
  87. }
  88.  
  89. let checker = new Checker();
  90. let updateScreen = () => {
  91. let currentWidth = window.innerWidth;
  92. let currentHeight = window.innerHeight;
  93.  
  94. if (FPSBooster) {
  95.  
  96. } else {
  97. }
  98. };
  99. /** LOCKERS **/
  100. let lockers = {
  101. attacker: false,
  102. breaker: false,
  103. storeOpened: false,
  104. }
  105.  
  106. /** WS SEND PACKET **/
  107. let sendPacket = (packet, ...data) => {
  108. ws.send(new Uint8Array(msgpack.encode([packet, data])));
  109. };
  110.  
  111. /** FOR STORE FUNCTIONS **/
  112. let goldCount = () => {
  113. let scoreCount = document.getElementById("scoreDisplay");
  114. return scoreCount ? parseInt(scoreCount.innerText) : 0;
  115. };
  116.  
  117. let hatPrice = (hatId) => {
  118. let hatPrice = {
  119. 45: 0,
  120. 51: 0,
  121. 50: 0,
  122. 28: 0,
  123. 29: 0,
  124. 30: 0,
  125. 36: 0,
  126. 37: 0,
  127. 38: 0,
  128. 44: 0,
  129. 35: 0,
  130. 42: 0,
  131. 43: 0,
  132. 49: 0,
  133. 57: 50,
  134. 8: 100,
  135. 2: 500,
  136. 15: 600,
  137. 5: 1000,
  138. 4: 2000,
  139. 18: 2000,
  140. 31: 2500,
  141. 1: 3000,
  142. 10: 3000,
  143. 48: 3000,
  144. 6: 4000,
  145. 23: 4000,
  146. 13: 5000,
  147. 9: 5000,
  148. 32: 5000,
  149. 7: 6000,
  150. 22: 6000,
  151. 12: 6000,
  152. 26: 8000,
  153. 21: 10000,
  154. 46: 10000,
  155. 14: 10000,
  156. 11: 10000,
  157. 53: 10000,
  158. 20: 12000,
  159. 58: 12000,
  160. 27: 15000,
  161. 40: 15000,
  162. 52: 15000,
  163. 55: 20000,
  164. 56: 20000
  165. };
  166. return hatPrice[hatId] || 0;
  167. };
  168.  
  169. let accPrice = (accessoryId) => {
  170. let accPrice = {
  171. 12: 1000,
  172. 9: 1000,
  173. 10: 1000,
  174. 3: 1500,
  175. 8: 2000,
  176. 11: 2000,
  177. 17: 3000,
  178. 6: 3000,
  179. 4: 4000,
  180. 5: 5000,
  181. 2: 6000,
  182. 1: 8000,
  183. 7: 8000,
  184. 14: 10000,
  185. 15: 10000,
  186. 20: 10000,
  187. 16: 12000,
  188. 13: 15000,
  189. 19: 15000,
  190. 18: 20000,
  191. 21: 20000
  192. };
  193. return accPrice[accessoryId] || 0;
  194. };
  195. let purchased = [];
  196. let isPurchased = (id) => {
  197. return purchased.includes(id);
  198. };
  199.  
  200. /** STORE **/
  201. let storeBuy = (id, index) => {
  202. if (isPurchased(id)) {
  203. return;
  204. }
  205. let gold = goldCount();
  206. let cost = 0;
  207. if (index === 0) {
  208. cost = hatPrice(id);
  209. } else if (index === 1) {
  210. cost = accPrice(id);
  211. }
  212. if (gold >= cost) {
  213. sendPacket('c', 1, id, index);
  214. purchased.push(id);
  215. }
  216. };
  217. let storeEquip = (id, index) => sendPacket('c', 0, id, index);
  218.  
  219. /** EQUIP WEAPONS **/
  220. let equipWeapon = (weapon) => sendPacket('z', weapon, true);
  221.  
  222. /** SEND CHAT **/
  223. let sendChat = message => sendPacket('6', message);
  224.  
  225. /** AUTO GATHER **/
  226. let autoGather = () => sendPacket('K', 1, 1);
  227.  
  228. /** REQUEST ANIMATION FRAME **/
  229. let requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || (callback => setTimeout(callback, 1000 / 60));
  230.  
  231. /** HANDLE MESSAGE **/
  232. let handleMessage = (message) => {
  233. let decodeData = msgpack.decode(new Uint8Array(message.data));
  234.  
  235. let data = Array.isArray(decodeData) && decodeData.length > 1 ? [decodeData[0], ...decodeData[1]] : decodeData;
  236.  
  237. if (!data) return;
  238.  
  239. let dataType = data[0];
  240.  
  241. if (dataType === "C" && myPlayer.id == null) {
  242. myPlayer.id = data[1];
  243. }
  244. if (dataType == "D" && data[2]) {
  245. secondary = null;
  246. primary = 0;
  247. foodType = 0;
  248. wallType = 3;
  249. spikeType = 6;
  250. millType = 10;
  251. spawnpadType = 36;
  252. }
  253. if (dataType == "V") {
  254. if (data[2] == 1) {
  255. primary = data[1][0];
  256. secondary = data[1][1] ?? null;
  257. } else {
  258. foodType = data[1][0];
  259. wallType = data[1][1];
  260. spikeType = data[1][2];
  261. millType = data[1][3];
  262. boostType = data[1][4] ?? -1;
  263. haveMine = data[1][5] == 13 || data[1][4] == 14;
  264. if (haveMine) {
  265. mineType = data[1][5];
  266. }
  267. turretType = data[1][5 + (haveMine ? 1 : 0)];
  268. }
  269. }
  270. if (dataType == "a") updatePlayers(data);
  271. if (dataType === "T") updateAge(data[1], data[2], data[3]);
  272. if (dataType == "O" && data[1] == myPlayer.id) {
  273. let playerID = data[1];
  274. let health = data[2];
  275. updateHealth(health, playerID);
  276. }
  277. };
  278.  
  279. /** DISTANCE CALCULATE **/
  280. let distance = (a, b) => {
  281. return Math.sqrt(Math.pow(b.y - a[2], 2) + Math.pow(b.x - a[1], 2));
  282. };
  283.  
  284. /** ANTI ALTCHA **/
  285. document.getElementById('altcha').style.display = 'none';
  286. document.getElementById('altcha_checkbox').click();
  287.  
  288. /** UPDATE XP/MAXXP/AGE **/
  289. let updateAge = (xp, maxXp, age) => {
  290. if (xp != undefined) {
  291. myPlayer.XP = xp;
  292. }
  293. if (maxXp != undefined) {
  294. myPlayer.maxXP = maxXp;
  295. }
  296. if (age != undefined) {
  297. myPlayer.age = age;
  298. }
  299. }
  300.  
  301. /** PLACE **/
  302. let place = (id, angle = Math.atan2(mouseY - height / 2, mouseX - width / 2)) => {
  303. if (typeof id !== "number" || id == -1) return;
  304. sendPacket("z", id, null);
  305. sendPacket("F", 1, angle);
  306. sendPacket("F", 0, angle);
  307. sendPacket("z", myPlayer.weapon, true);
  308. }
  309. //sendupgrade
  310. function sendUpgrade(index) {
  311. //myPlayer.reloads[index] = 0;
  312. sendPacket("H", index);
  313. }
  314. /** HOOK **/
  315. let hook = (target, prop, setter, getter) => {
  316. let symbol = Symbol(prop);
  317. Object.defineProperty(target, prop, {
  318. get() {
  319. getter(this, this[symbol]);
  320. return this[symbol];
  321. },
  322. set(value) {
  323. setter(this, symbol, value);
  324. },
  325. configurable: true
  326. })
  327. }
  328.  
  329. /** IS TEAM **/
  330. let isTeam = (kaka) => {
  331. return kaka.clan == myPlayer.clan;
  332. };
  333.  
  334. /** OPEN/CLOSED **/
  335. let checkMenu = () => {
  336. return (allianceMenu.style.display != "block" && chatHolder.style.display != "block" && storeMenu.style.display != "block" && !menuOpened);
  337. }
  338.  
  339. /** RENDERING **/
  340. let object = null;
  341. hook(Object.prototype, "isItem", function(that, symbol, value) {
  342. that[symbol] = value;
  343. }, function(that, value) {
  344. if (value === true) {
  345. object = that;
  346. }
  347. });
  348.  
  349. CanvasRenderingContext2D.prototype.restore = new Proxy(CanvasRenderingContext2D.prototype.restore, {
  350. apply(target, thisArg, args) {
  351. markObject(thisArg);
  352. return Reflect.apply(target, thisArg, args);
  353. }
  354. });
  355.  
  356. let markColor = (id) => {
  357.  
  358. if (id === myPlayer.id) {
  359. return { color: "#00ff00", render: true };
  360. } else {
  361. return { color: "#FF4D4D", render: false };
  362. }
  363. };
  364.  
  365. // item.owner.sid
  366.  
  367. let markObject = (ctx) => {
  368. if (!object || !object.owner || myPlayer.id === null) return;
  369. let distance = Math.sqrt(Math.pow(myPlayer.x - object.x, 2) + Math.pow(myPlayer.y - object.y, 2));
  370. if (distance > 300) return;
  371. let type = markColor(object.owner.sid);
  372. if (!type.render) return;
  373. ctx.fillStyle = type.color;
  374. ctx.beginPath();
  375. ctx.arc(0, 0, 10, 0, 2 * Math.PI);
  376. ctx.fill();
  377. object = null;
  378. };
  379. /** WEAPONS/NAMES/IDS **/
  380. let weapon = {
  381. "tool_hammer": 0,
  382. "hand_axe": 1,
  383. "great_axe": 2,
  384. "short_sword": 3,
  385. "katana": 4,
  386. "polearm": 5,
  387. "bat": 6,
  388. "daggers": 7,
  389. "stick": 8,
  390. "hunting_bow": 9,
  391. "great_hammer": 10,
  392. "wooden_shield": 11,
  393. "crossbow": 12,
  394. "repeater_crossbow": 13,
  395. "mc_grabby": 14,
  396. "musket": 15
  397. };
  398.  
  399. /** UPDATE PLAYERS **/
  400. let updatePlayers = data => {
  401. SaVeGe.tick++
  402. let enemies = [];
  403. let players = [];
  404. let cTickQ = SaVeGe.tickQueue[SaVeGe.tick];
  405. if (Array.isArray(cTickQ)) {
  406. cTickQ.forEach((did) => did());
  407. SaVeGe.tickQueue[SaVeGe.tick] = null;
  408. }
  409. for (let i = 0; i < data[1].length / 13; i++) {
  410. let playerInfo = data[1].slice(13 * i, 13 * i + 13);
  411. players.push(playerInfo);
  412.  
  413. if (playerInfo[0] == myPlayer.id) {
  414. myPlayer.x = playerInfo[1];
  415. myPlayer.y = playerInfo[2];
  416. myPlayer.dir = playerInfo[3];
  417. myPlayer.object = playerInfo[4];
  418. myPlayer.weapon = playerInfo[5];
  419. myPlayer.clan = playerInfo[7];
  420. myPlayer.isLeader = playerInfo[8];
  421. myPlayer.hat = playerInfo[9];
  422. myPlayer.accessory = playerInfo[10];
  423. myPlayer.isSkull = playerInfo[11];
  424. } else if (playerInfo[7] != myPlayer.clan && playerInfo[7] !== null) {
  425. enemies.push({
  426. id: playerInfo[0],
  427. x: playerInfo[1],
  428. y: playerInfo[2],
  429. dir: playerInfo[3],
  430. object: playerInfo[4],
  431. weapon: playerInfo[5],
  432. clan: playerInfo[7],
  433. isLeader: playerInfo[8],
  434. hat: playerInfo[9],
  435. accessory: playerInfo[10],
  436. isSkull: playerInfo[11]
  437. });
  438. }
  439. }
  440.  
  441. if (enemies) {
  442. nearestEnemy = enemies.sort((a, b) => distance(a, myPlayer) - distance(b, myPlayer))[0];
  443. }
  444.  
  445. let isEnemyNear = nearestEnemy ? (Math.sqrt(Math.pow(myPlayer.y - nearestEnemy.y, 2) + Math.pow(myPlayer.x - nearestEnemy.x, 2)) < 320) : true;
  446. enemyAngle = nearestEnemy ? Math.atan2(nearestEnemy.y - myPlayer.y, nearestEnemy.x - myPlayer.x) : (myPlayer?.dir ?? 0)
  447. };
  448.  
  449. /** PLACE REPEATER **/
  450. let placeRepeater = (key, action) => {
  451. return {
  452. interval: null,
  453. action,
  454. key,
  455. };
  456. }
  457. let grindInterval;
  458. let repeaters = [
  459. placeRepeater("q", () => {
  460. place(foodType);
  461. }),
  462. placeRepeater("f", () => {
  463. place(boostType);
  464. }),
  465. placeRepeater("v", () => {
  466. place(spikeType);
  467. }),
  468. placeRepeater("F", () => {
  469. place(millType);
  470. }),
  471. placeRepeater("h", () => {
  472. place(turretType);
  473. }),
  474. placeRepeater("t", () => {
  475. place(wallType);
  476. }),
  477. placeRepeater("c",() => {
  478. // let c = myPlayer.dir;
  479. place(spikeType, myPlayer.dir + toRad(0));
  480. place(spikeType, myPlayer.dir + toRad(120));
  481. place(spikeType, myPlayer.dir - toRad(120));
  482. }),
  483. placeRepeater("z",() => {
  484. let a = myPlayer.dir;
  485. place(boostType, myPlayer.dir + toRad(45));
  486. place(boostType, myPlayer.dir - toRad(45));
  487. place(boostType, myPlayer.dir + toRad(135));
  488. place(boostType, myPlayer.dir - toRad(135));
  489. place(boostType, myPlayer.dir + toRad(0));
  490. place(boostType, myPlayer.dir - toRad(180));
  491. place(boostType, myPlayer.dir + toRad(90));
  492. place(boostType, myPlayer.dir - toRad(90));
  493. place(boostType, a);
  494. }),
  495. placeRepeater("g", () => {
  496. place(spikeType, myPlayer.dir + toRad(90));
  497. place(spikeType, myPlayer.dir - toRad(90));
  498. place(boostType, myPlayer.dir);
  499. }),
  500. placeRepeater(" ", () => {
  501. }),
  502. ];
  503. /** HIT **/
  504. let hit = () => {
  505. sendPacket("F", 1, enemyAngle);
  506. sendPacket("F", 0);
  507. }
  508.  
  509. /** SOCKET CONNECTION **/
  510. let socketFound = stuff => {
  511. stuff.addEventListener("message", handleMessage);
  512. gameCanvas.addEventListener("mousemove", ({ x, y }) => {
  513. mouseX = x;
  514. mouseY = y;
  515. });
  516. window.addEventListener("resize", () => {
  517. height = innerHeight;
  518. width = innerWidth;
  519. });
  520. };
  521. /** MOVEMENT **/
  522. let moveEz = (key, isKeyDown) => {
  523. moveKeys[key] = isKeyDown;
  524. if ((moveKeys.w || moveKeys.a || moveKeys.s || moveKeys.d) && !locked) {
  525. // storeEquip(12, 0);
  526. locked = true;
  527. }
  528. if (!moveKeys.w && !moveKeys.a && !moveKeys.s && !moveKeys.d && locked) {
  529. // storeEquip(6, 0);
  530. locked = false;
  531. }
  532. };
  533. let soike = 0;
  534. /** AUTO HEAL **/
  535. let defHealSpeed = 120;
  536. let autoHeal = (health, damage) => {
  537. let cHealSpeed = defHealSpeed;
  538. if (health <= 50) {
  539. cHealSpeed = 100;
  540. place(foodType, null);
  541. place(foodType, null);
  542. place(foodType, null);
  543. place(foodType, null);
  544. place(foodType, null);
  545. storeEquip(21, 1);
  546. } else if (damage >= 30) {
  547. cHealSpeed = 110;
  548. place(foodType, null);
  549. place(foodType, null);
  550. place(foodType, null);
  551. place(foodType, null);
  552. storeBuy(21, 1);
  553. storeEquip(21, 1);
  554. }
  555. if (health < myPlayer.maxHealth) {
  556. let healing = setInterval(() => {
  557. if (myPlayer.health < myPlayer.maxHealth) {
  558. place(foodType, null);
  559. } else {
  560. clearInterval(healing);
  561. }
  562. }, cHealSpeed);
  563. }
  564. };
  565. setInterval(function() {
  566. if (soike === 1 && myPlayer.age > 5){
  567. soike = 0;
  568. place(spikeType, myPlayer.dir + toRad(45));
  569. place(spikeType, myPlayer.dir - toRad(45));
  570. place(spikeType, myPlayer.dir + toRad(135));
  571. place(spikeType, myPlayer.dir - toRad(135));
  572. place(spikeType, myPlayer.dir + toRad(0));
  573. place(spikeType, myPlayer.dir - toRad(180));
  574. place(spikeType, myPlayer.dir + toRad(90));
  575. place(spikeType, myPlayer.dir - toRad(90));
  576. soike = 0;
  577. }
  578. }, 100);
  579. setInterval(function() {
  580. if (myPlayer.hat === 45) {
  581. storeEquip(13, 1);
  582. }
  583. }, 100);
  584. /** UPDATE HEALTH **/
  585. let lastHealth = 100;
  586. let updateHealth = (health, playerID) => {
  587. if (myPlayer.id === playerID) {
  588. let damage = Math.max(0, lastHealth - health);
  589. myPlayer.health = health;
  590. if (myPlayer.health > 0) {
  591. autoHeal(myPlayer.health, damage);
  592. }
  593. lastHealth = health;
  594. } else {
  595. enemy.health = health;
  596. }
  597. };
  598. /** INSTA KILL **/
  599. let instaKill = (...instaType) => {
  600. let type = instaType[0];
  601.  
  602. switch (type) {
  603. case "normal":
  604. sendChat("");
  605. storeBuy(0, 1);
  606. storeEquip(0, 1);
  607. setTimeout(()=>{
  608. storeBuy(7, 0);
  609. storeEquip(7, 0);
  610. equipWeapon(primary);
  611. hit();
  612. setTimeout(()=>{
  613. equipWeapon(secondary);
  614. hit();
  615. storeBuy(53, 0);
  616. storeEquip(53, 0);
  617. setTimeout(() => {
  618. storeBuy(6, 0);
  619. storeEquip(6, 0);
  620. if (secondary == 15){
  621. equipWeapon(secondary);
  622. setTimeout(()=>{
  623. equipWeapon(primary);
  624. },1500);
  625. } else if (secondary == 12){
  626. equipWeapon(secondary);
  627. setTimeout(()=>{
  628. equipWeapon(primary);
  629. },1000);
  630. } else if (secondary == 13){
  631. equipWeapon(secondary);
  632. setTimeout(()=>{
  633. equipWeapon(primary);
  634. },400);
  635. }
  636. setTimeout(() => {
  637. storeBuy(11, 1);
  638. storeEquip(11, 1);
  639. equipWeapon(primary);
  640. equipWeapon(secondary);
  641. }, 170);
  642. }, 170);
  643. }, 120);
  644. }, 120);
  645. break;
  646.  
  647. case "boostTick":
  648. sendChat("");
  649. storeEquip(0, 1);
  650. place(boostType, null);
  651. setTimeout(()=>{
  652. equipWeapon(secondary);
  653. storeBuy(53, 0);
  654. storeEquip(53, 0);
  655. hit();
  656. setTimeout(()=>{
  657. equipWeapon(primary);
  658. storeBuy(7, 0);
  659. storeEquip(7, 0);
  660. if (enemy.health > 0){
  661. place(spikeType, null);
  662. } else{
  663. place(foodType, null);
  664. }
  665. hit();
  666. setTimeout(() => {
  667. storeBuy(6, 0);
  668. storeEquip(6, 0);
  669. setTimeout(() => {
  670. storeBuy(11, 1);
  671. storeEquip(11, 1);
  672. if (secondary == 15){
  673. equipWeapon(secondary);
  674. setTimeout(()=>{
  675. equipWeapon(primary);
  676. },1500);
  677. } else if (secondary == 12){
  678. equipWeapon(secondary);
  679. setTimeout(()=>{
  680. equipWeapon(primary);
  681. },1000);
  682. } else if (secondary == 13){
  683. equipWeapon(secondary);
  684. setTimeout(()=>{
  685. equipWeapon(primary);
  686. },400);
  687. }
  688. equipWeapon(primary);
  689. equipWeapon(secondary);
  690. }, 170);
  691. }, 170);
  692. }, 110);
  693. }, 100);
  694. break;
  695.  
  696. case "reverseInsta":
  697. sendChat("");
  698. storeEquip(0, 1);
  699. setTimeout(()=>{
  700. equipWeapon(secondary);
  701. storeBuy(53, 0);
  702. storeEquip(53, 0);
  703. hit();
  704. setTimeout(()=>{
  705. storeBuy(7, 0);
  706. storeEquip(7, 0);
  707. hit();
  708. equipWeapon(primary);
  709. setTimeout(() => {
  710. storeBuy(6, 0);
  711. storeEquip(6, 0);
  712. setTimeout(() => {
  713. storeBuy(11, 1);
  714. storeEquip(11, 1);
  715. if (secondary == 15){
  716. equipWeapon(secondary);
  717. setTimeout(()=>{
  718. equipWeapon(primary);
  719. },1500);
  720. } else if (secondary == 12){
  721. equipWeapon(secondary);
  722. setTimeout(()=>{
  723. equipWeapon(primary);
  724. },1000);
  725. } else if (secondary == 13){
  726. equipWeapon(secondary);
  727. setTimeout(()=>{
  728. equipWeapon(primary);
  729. },400);
  730. }
  731. equipWeapon(primary);
  732. equipWeapon(secondary);
  733. }, 170);
  734. }, 170);
  735. }, 100);
  736. }, 100);
  737.  
  738. break;
  739.  
  740. case "oneTick":
  741. sendChat("");
  742. storeEquip(0, 1);
  743. setTimeout(()=>{
  744. equipWeapon(primary);
  745. storeBuy(7, 0);
  746. storeEquip(7, 0);
  747. hit();
  748. setTimeout(()=>{
  749. equipWeapon(secondary);
  750. place(spikeType, null);
  751. hit();
  752. storeEquip(53, 0);
  753. setTimeout(() => {
  754. storeBuy(6, 0);
  755. storeEquip(6, 0);
  756. equipWeapon(primary);
  757. setTimeout(() => {
  758. storeBuy(11, 1);
  759. storeEquip(11, 1);
  760. equipWeapon(secondary);
  761. }, 800);
  762. }, 170);
  763. }, 105);
  764. }, 100);
  765.  
  766. break;
  767.  
  768. default:
  769. sendChat("");
  770. break;
  771. }
  772. };
  773.  
  774. let instaKillMode = 0;
  775. let isInstaKillModeEnabled = false;
  776.  
  777. let humanBasedInsta = () => {
  778. if (!isInstaKillModeEnabled) return;
  779.  
  780. switch (instaKillMode) {
  781. case 0:
  782. equipWeapon(primary);
  783. storeBuy(7, 0);
  784. storeEquip(7, 0);
  785. hit();
  786. break;
  787.  
  788. case 1:
  789. equipWeapon(secondary);
  790. storeBuy(53, 0);
  791. storeEquip(53, 0);
  792. hit();
  793. break;
  794.  
  795. case 2:
  796. equipWeapon(primary);
  797. storeBuy(6, 0);
  798. storeEquip(6, 0);
  799. break;
  800.  
  801. case 3:
  802. sendChat("");
  803. break;
  804.  
  805. default:
  806. sendChat("");
  807. break;
  808. }
  809.  
  810. instaKillMode = (instaKillMode + 1) % 4;
  811. };
  812. let movementdir;
  813. document.addEventListener("keydown", (event) => {
  814. if (event.key === "w") {
  815. movementdir = -1.57;
  816. }
  817. });
  818. document.addEventListener("keydown", (event) => {
  819. if (event.key === "d") {
  820. movementdir = 0;
  821. }
  822. });
  823. document.addEventListener("keydown", (event) => {
  824. if (event.key === "s") {
  825. movementdir = 1.57;
  826. }
  827. });
  828. document.addEventListener("keydown", (event) => {
  829. if (event.key === "a") {
  830. movementdir = -3.14
  831. }
  832. });
  833. document.addEventListener("keydown", (event) => {
  834. if (event.key === ",") {
  835. storeBuy(31, 0);
  836. storeEquip(31, 0);
  837. }
  838. });
  839. document.addEventListener("keydown", (event) => {
  840. if (event.key === ",") {
  841. storeBuy(15, 0);
  842. storeEquip(15, 0);
  843. }
  844. });
  845. document.addEventListener("keydown", (event) => {
  846. if (event.key === "e") {
  847. storeEquip(20, 0);
  848. }
  849. });
  850. let autoa = false;
  851. let aInterval;
  852. document.addEventListener("keydown", (event) => {
  853. if (event.key === "/") {
  854. autoa = !autoa;
  855. sendChat(autoa ? "" : "");
  856.  
  857. if (autoa) {
  858. aInterval = setInterval(() => {
  859. setTimeout(() => {
  860. storeBuy(8, 0);
  861. storeEquip(8, 0);
  862. setTimeout(() => {
  863. storeBuy(15, 0);
  864. storeEquip(15, 0);
  865. }, 150);
  866. }, 150);
  867. }, 300);
  868. } else {
  869. clearInterval(aInterval);
  870. }
  871. }
  872. });
  873. document.addEventListener("keydown", (event) => {
  874. if (event.key === "`") {
  875. weapongrind = !weapongrind;
  876. sendChat(weapongrind ? "ON" : "OFF");
  877. }
  878. });
  879. let keys = {};
  880.  
  881. document.addEventListener("keydown", (event) => {
  882. keys[event.code] = true;
  883. if (window.location.hostname === "sandbox.moomoo.io") {
  884. // Check if both keys are pressed
  885. if (keys["KeyW"] && keys["KeyD"]) {
  886. movementdir = -0.785;
  887. }
  888. if (keys["KeyD"] && keys["KeyS"]) {
  889. movementdir = 0.785;
  890. }
  891. if (keys["KeyS"] && keys["KeyA"]) {
  892. movementdir = 2.355;
  893. }
  894. if (keys["KeyA"] && keys["KeyW"]) {
  895. movementdir = -2.355;
  896. }
  897. }
  898. });
  899. document.addEventListener("keyup", (event) => {
  900. keys[event.code] = false;
  901. });
  902. //autospike
  903. /** KEY EVENTS **/
  904. document.addEventListener('keydown', ({ key }) => {
  905. if (key == 'Escape') {
  906. let menu = document.getElementById('modMenu');
  907. if (menu) {
  908. if (menu.style.visibility === 'hidden') {
  909. menu.style.visibility = 'visible';
  910. menu.style.opacity = '1';
  911. menu.style.transform = 'translate(-50%, -50%) scale(1)';
  912. menuOpened = true;
  913. } else {
  914. menu.style.opacity = '0';
  915. menu.style.transform = 'translate(-50%, -50%) scale(0.95)';
  916. menuOpened = false;
  917. menu.style.visibility = 'hidden';
  918. }
  919. }
  920. }
  921. if (!checkMenu()) return;
  922. for (let repeater of repeaters) {
  923. if (repeater.key === key && repeater.interval === null) {
  924. repeater.interval = setInterval(
  925. repeater.action, 100
  926. );
  927. }
  928. }
  929. // if (key in moveKeys) moveEz(key, true);
  930. if (key == "r") {
  931. let instaTypes = document.getElementById('instaKillType');
  932. let instaType = instaTypes.value;
  933. instaKill(instaType);
  934. }
  935. });
  936.  
  937. document.addEventListener('keyup', ({ key }) => {
  938. if (!checkMenu()) return;
  939. for (let repeater of repeaters) {
  940. if (repeater.key === key && repeater.interval !== null) {
  941. clearInterval(repeater.interval);
  942. repeater.interval = null;
  943. }
  944. }
  945. // if (key in moveKeys) moveEz(key, false);
  946. });
  947. function toRad(angle) {
  948. return angle * 0.01745329251;
  949. }
  950. let automill = false;
  951. let millInterval;
  952. if (window.location.hostname === "sandbox.moomoo.io") {
  953. document.addEventListener("keydown", (event) => {
  954. if (event.key === "=") {
  955. automill = !automill;
  956. if (automill) {
  957. millInterval = setInterval(() => {
  958. place(millType, movementdir - 1.90);
  959. place(millType, movementdir - 3.14);
  960. place(millType, movementdir + 1.90);
  961. }, 135);
  962. } else {
  963. clearInterval(millInterval);
  964. };
  965. }
  966. });
  967. };
  968. /** MOUSE EVENTS **/
  969. document.addEventListener('mousedown', (mouse) => {
  970. if (!checkMenu()) return;
  971. if (mouse.button === 0 && !lockers.attacker) {
  972. humanBasedInsta();
  973. if (!isInstaKillModeEnabled) {
  974. storeBuy(11, 1);
  975. storeEquip(0, 1);
  976. equipWeapon(primary);
  977. setTimeout(()=>{
  978. storeBuy(7, 0);
  979. storeEquip(7, 0);
  980. autoGather();
  981. }, 100);
  982. lockers.attacker = true;
  983. }
  984. }
  985. if (mouse.button === 2 && !lockers.breaker) {
  986. if (!isInstaKillModeEnabled) {
  987. sendChat("");
  988. storeBuy(40, 0);
  989. storeEquip(40, 0);
  990. autoGather();
  991.  
  992. lockers.breaker = true;
  993. }
  994. if (secondary == 10 && weapongrind == false) {
  995. equipWeapon(secondary);
  996. }
  997. }
  998. });
  999.  
  1000. document.addEventListener('mouseup', (mouse) => {
  1001. if (!checkMenu()) return;
  1002. if (mouse.button === 0 && lockers.attacker) {
  1003. if (!isInstaKillModeEnabled) {
  1004. storeBuy(11, 1);
  1005. storeEquip(11, 1);
  1006. autoGather();
  1007. setTimeout(()=>{
  1008. storeBuy(6, 0);
  1009. storeEquip(6, 0);
  1010. }, 200);
  1011. lockers.attacker = false;
  1012. }
  1013. }
  1014. if (mouse.button === 2 && lockers.breaker) {
  1015. if (!isInstaKillModeEnabled) {
  1016. storeBuy(6, 0);
  1017. storeEquip(6, 0);
  1018. autoGather();
  1019. lockers.breaker = false;
  1020. }
  1021. }
  1022. });
  1023. let prevCount = 0;
  1024. const handleMutations = (mutationsList) => {
  1025. for (const mutation of mutationsList) {
  1026. if (mutation.target.id === "killCounter") {
  1027. const count = parseInt(mutation.target.innerText, 10) || 0;
  1028. if (count > prevCount) {
  1029. sendChat("Pls, say hi to Good Guy,");
  1030. setTimeout(()=>{
  1031. sendChat("When you meet him :D");
  1032. },650);
  1033. prevCount = count;
  1034. }
  1035. }
  1036. }
  1037. };
  1038. const observer = new MutationObserver(handleMutations);
  1039. observer.observe(document, {
  1040. subtree: true,
  1041. childList: true,
  1042. });
  1043. setInterval(function() {
  1044. if (myPlayer.y > 6830 && myPlayer.y < 7600) {
  1045. storeBuy(31, 0);
  1046. storeEquip(31, 0);
  1047. }
  1048. }, 130);
  1049. setInterval(function() {
  1050. if (myPlayer.y < 2400) {
  1051. storeEquip(15, 0);
  1052. storeEquip(15, 0);
  1053. }
  1054. }, 900);
  1055. setInterval(function() {
  1056. storeBuy(11, 1);
  1057. }, 100);
  1058. setInterval(function() {
  1059. storeBuy(6, 0);
  1060. }, 100);
  1061. setInterval(function() {
  1062. storeBuy(7, 0);
  1063. }, 100);
  1064. setInterval(function() {
  1065. storeBuy(40, 0);
  1066. }, 100);
  1067. /*
  1068.  
  1069.  
  1070. STYLING AND MOD MENUS UNDER
  1071.  
  1072.  
  1073. */
  1074.  
  1075.  
  1076. /** MOD MENU **/
  1077. let createModMenu = () => {
  1078. let menuContainer = document.createElement('div');
  1079. menuContainer.id = 'modMenu';
  1080.  
  1081. menuContainer.innerHTML = `
  1082. <h2 class="mod-menu-title">
  1083. </h2>
  1084. <div class="menu-item" style="margin-top: 0px;">
  1085. <label style="cursor: pointer;">
  1086. <div class="toggle-switch">
  1087. <input type="checkbox" id="fpsBoosterToggle" class="checkbox">
  1088. <span class="slider"></span>
  1089. </div>
  1090. <span class="menu-label">FPS Booster</span>
  1091. </label>
  1092. </div>
  1093. <div class="menu-item" style="margin-top: 0px;">
  1094. <label style="cursor: pointer;">
  1095. <div class="toggle-switch">
  1096. <input type="checkbox" id="autoGatherToggle" class="checkbox">
  1097. <span class="slider"></span>
  1098. </div>
  1099. <span class="menu-label">Auto Gather</span>
  1100. </label>
  1101. </div>
  1102. <div class="menu-item">
  1103. <label for="instaKillType" style="font-size: 16px">InstaKill Type:</label>
  1104. <select id="instaKillType">
  1105. <option value="normal">Normal Insta</option>
  1106. <option value="reverseInsta">Reverse Insta</option>
  1107. <option value="boostTick">Boost Tick</option>
  1108. <option value="oneTick">One Tick</option>
  1109. </select>
  1110. </div>
  1111. <div class="menu-footer">
  1112. Credits: SaVeGe
  1113. </div>
  1114. `;
  1115.  
  1116. document.body.appendChild(menuContainer);
  1117.  
  1118. document.getElementById('fpsBoosterToggle').checked = FPSBooster;
  1119. document.getElementById('fpsBoosterToggle').addEventListener('change', (e) => {
  1120. FPSBooster = e.target.checked;
  1121. updateScreen();
  1122. });
  1123.  
  1124. document.getElementById('autoGatherToggle').addEventListener('change', (e) => {
  1125. if (e.target.checked) {
  1126. autoGather();
  1127. } else {
  1128. autoGather();
  1129. }
  1130. });
  1131. };
  1132.  
  1133. createModMenu();
  1134.  
  1135. let menuStyles = `
  1136. @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
  1137.  
  1138. #modMenu {
  1139. position: fixed;
  1140. top: 50%;
  1141. left: 50%;
  1142. transform: translate(-50%, -50%) scale(0.95);
  1143. width: 420px;
  1144. background: rgba(30, 30, 30, 0.8);
  1145. border-radius: 20px;
  1146. padding: 20px;
  1147. box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  1148. color: #ffffff;
  1149. visibility: hidden;
  1150. opacity: 0;
  1151. z-index: 10000;
  1152. font-family: 'Poppins', sans-serif;
  1153. transition: transform 0.6s ease, opacity 0.6s ease, visibility 0.6s ease;
  1154. border: 1px solid rgba(255, 255, 255, 0.25);
  1155. }
  1156.  
  1157. #modMenu h2 {
  1158. text-align: center;
  1159. color: #ffffff;
  1160. font-size: 36px;
  1161. letter-spacing: 1.5px;
  1162. margin-bottom: 20px;
  1163. text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.5);
  1164. }
  1165.  
  1166. #modMenu .menu-item {
  1167. margin-bottom: 15px;
  1168. }
  1169.  
  1170. #modMenu .menu-footer {
  1171. margin-top: 20px;
  1172. text-align: center;
  1173. color: #ccc;
  1174. font-size: 14px;
  1175. font-style: italic;
  1176. }
  1177.  
  1178. #modMenu .toggle-switch {
  1179. position: relative;
  1180. display: inline-block;
  1181. width: 50px;
  1182. height: 26px;
  1183. }
  1184.  
  1185. #modMenu .toggle-switch input {
  1186. display: none;
  1187. }
  1188.  
  1189. #modMenu .slider {
  1190. position: absolute;
  1191. cursor: pointer;
  1192. top: 0;
  1193. left: 0;
  1194. right: 0;
  1195. bottom: 0;
  1196. background-color: rgba(255, 255, 255, 0.2);
  1197. border-radius: 34px;
  1198. transition: background-color 0.4s, box-shadow 0.4s;
  1199. box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.3);
  1200. }
  1201.  
  1202. #modMenu .slider:before {
  1203. position: absolute;
  1204. content: "";
  1205. height: 22px;
  1206. width: 22px;
  1207. left: 4px;
  1208. bottom: 2px;
  1209. background-color: #ffffff;
  1210. border-radius: 50%;
  1211. transition: transform 0.4s, box-shadow 0.4s;
  1212. box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
  1213. }
  1214.  
  1215. #modMenu input:checked + .slider {
  1216. background-color: rgba(0, 234, 255, 0.8);
  1217. box-shadow: 0 0 15px rgba(0, 234, 255, 0.6);
  1218. }
  1219.  
  1220. #modMenu input:checked + .slider:before {
  1221. transform: translateX(24px);
  1222. box-shadow: 0px 4px 6px rgba(0, 234, 255, 0.6);
  1223. }
  1224.  
  1225. #modMenu .menu-label {
  1226. position: absolute;
  1227. font-size: 16px;
  1228. margin-top: 5px;
  1229. color: #ddd;
  1230. margin-left: 10px;
  1231. transition: color 0.3s ease;
  1232. text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  1233. }
  1234.  
  1235. #modMenu select {
  1236. background: rgba(255, 255, 255, 0.2);
  1237. border: 1px solid rgba(255, 255, 255, 0.4);
  1238. border-radius: 5px;
  1239. color: #ddd;
  1240. padding: 10px;
  1241. font-size: 16px;
  1242. font-family: 'Poppins', sans-serif;
  1243. width: 100%;
  1244. margin-top: 5px;
  1245. transition: background 0.3s, border-color 0.3s;
  1246. }
  1247.  
  1248. #modMenu select:hover {
  1249. background: rgba(255, 255, 255, 0.3);
  1250. border-color: rgba(255, 255, 255, 0.6);
  1251. }
  1252.  
  1253. #modMenu select option {
  1254. background-color: rgba(30, 30, 30, 0.8);
  1255. color: #ffffff;
  1256. }
  1257.  
  1258. #modMenu select option:hover {
  1259. background-color: rgba(0, 234, 255, 0.5);
  1260. }
  1261.  
  1262. #modMenu select:focus {
  1263. outline: none;
  1264. border-color: rgba(0, 234, 255, 0.8);
  1265. background-color: rgba(255, 255, 255, 0.3);
  1266. }
  1267.  
  1268. #modMenu button {
  1269. background: rgba(255, 255, 255, 0.2);
  1270. border: 1px solid rgba(255, 255, 255, 0.4);
  1271. color: #ffffff;
  1272. border-radius: 5px;
  1273. padding: 12px 20px;
  1274. font-size: 18px;
  1275. cursor: pointer;
  1276. transition: background 0.3s, box-shadow 0.3s;
  1277. width: 100%;
  1278. }
  1279.  
  1280. #modMenu button:hover {
  1281. background: rgba(255, 255, 255, 0.3);
  1282. border-color: rgba(255, 255, 255, 0.6);
  1283. }
  1284. #leaderboard::after {
  1285. display: block;
  1286. font-size: 40px;
  1287. text-align: center;
  1288. margin: 0 auto;
  1289. }
  1290. `;
  1291.  
  1292. let styleSheet = document.createElement('style');
  1293. Object.assign(styleSheet, { type: 'text/css', textContent: menuStyles });
  1294. document.head.append(styleSheet);
  1295.  

QingJ © 2025

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