Dsync Client [Sploop.io]

The most advanced hack for sploop.io

当前为 2022-08-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Dsync Client [Sploop.io]
  3. // @author Murka
  4. // @description The most advanced hack for sploop.io
  5. // @icon https://sploop.io/img/ui/favicon.png
  6. // @version 1.0.10
  7. // @match *://sploop.io/*
  8. // @run-at document-start
  9. // @grant none
  10. // @license MIT
  11. // @namespace https://greasyfork.org/users/919633
  12. // ==/UserScript==
  13. /* jshint esversion:6 */
  14.  
  15. /*
  16. Author: Murka
  17. Github: https://github.com/Murka007/Dsync-client
  18. Discord: https://discord.gg/sG9cyfGPj5
  19. Greasyfork: https://greasyfork.org/en/users/919633
  20.  
  21. PLEASE, I NEED YOUR SUPPORT ON GITHUB (GIVE ME A STAR ON MY REPOSITORY),
  22. ALSO SUPPORT THIS SCRIPT ON GREASYFORK (register and write a comment: "this script works, thank you so much"),
  23. FOR MORE UPDATES JOIN MY DISCORD SERVER!!!
  24. */
  25.  
  26. Function(`(` + (() => {
  27. "use strict";
  28. var __webpack_modules__ = {
  29. 147: module => {
  30. module.exports = {
  31. i8: "1.0.9"
  32. };
  33. }
  34. };
  35. var __webpack_module_cache__ = {};
  36. function __webpack_require__(moduleId) {
  37. var cachedModule = __webpack_module_cache__[moduleId];
  38. if (cachedModule !== undefined) {
  39. return cachedModule.exports;
  40. }
  41. var module = __webpack_module_cache__[moduleId] = {
  42. exports: {}
  43. };
  44. __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  45. return module.exports;
  46. }
  47. (() => {
  48. __webpack_require__.d = (exports, definition) => {
  49. for (var key in definition) {
  50. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  51. Object.defineProperty(exports, key, {
  52. enumerable: true,
  53. get: definition[key]
  54. });
  55. }
  56. }
  57. };
  58. })();
  59. (() => {
  60. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  61. })();
  62. var __webpack_exports__ = {};
  63. (() => {
  64. __webpack_require__.d(__webpack_exports__, {
  65. s: () => Dsync,
  66. c: () => log
  67. });
  68. var WebsocketString;
  69. (function(WebsocketString) {
  70. WebsocketString[WebsocketString["CONNECT"] = 12] = "CONNECT";
  71. WebsocketString[WebsocketString["DEFAULTDATA"] = 33] = "DEFAULTDATA";
  72. WebsocketString[WebsocketString["DIED"] = 19] = "DIED";
  73. WebsocketString[WebsocketString["KILLUPDATE"] = 22] = "KILLUPDATE";
  74. WebsocketString[WebsocketString["KILLED"] = 28] = "KILLED";
  75. WebsocketString[WebsocketString["SPAWN"] = 35] = "SPAWN";
  76. })(WebsocketString || (WebsocketString = {}));
  77. var EItems;
  78. (function(EItems) {
  79. EItems[EItems["PRIMARY"] = 0] = "PRIMARY";
  80. EItems[EItems["SECONDARY"] = 1] = "SECONDARY";
  81. EItems[EItems["HEAL"] = 2] = "HEAL";
  82. EItems[EItems["WALL"] = 3] = "WALL";
  83. EItems[EItems["SPIKE"] = 4] = "SPIKE";
  84. EItems[EItems["WINDMILL"] = 5] = "WINDMILL";
  85. EItems[EItems["TREE"] = 6] = "TREE";
  86. EItems[EItems["TRAP"] = 7] = "TRAP";
  87. EItems[EItems["PLATFORM"] = 8] = "PLATFORM";
  88. EItems[EItems["SPAWN"] = 9] = "SPAWN";
  89. EItems[EItems["TURRET"] = 10] = "TURRET";
  90. })(EItems || (EItems = {}));
  91. var ELayer;
  92. (function(ELayer) {
  93. ELayer[ELayer["PLAYER"] = 0] = "PLAYER";
  94. ELayer[ELayer["STONE"] = 1] = "STONE";
  95. ELayer[ELayer["HARDSPIKE"] = 2] = "HARDSPIKE";
  96. ELayer[ELayer["TREE"] = 3] = "TREE";
  97. ELayer[ELayer["GOLD"] = 4] = "GOLD";
  98. ELayer[ELayer["BUSH"] = 5] = "BUSH";
  99. ELayer[ELayer["TRAP"] = 6] = "TRAP";
  100. ELayer[ELayer["SPIKE"] = 7] = "SPIKE";
  101. ELayer[ELayer["WOODWALL"] = 8] = "WOODWALL";
  102. ELayer[ELayer["PLATFORM"] = 9] = "PLATFORM";
  103. ELayer[ELayer["BOOST"] = 10] = "BOOST";
  104. ELayer[ELayer["LOOTBOX"] = 11] = "LOOTBOX";
  105. ELayer[ELayer["PROJECTILE"] = 12] = "PROJECTILE";
  106. ELayer[ELayer["WINDMILL"] = 13] = "WINDMILL";
  107. ELayer[ELayer["COW"] = 14] = "COW";
  108. ELayer[ELayer["SPAWN"] = 15] = "SPAWN";
  109. ELayer[ELayer["POWERMILL"] = 16] = "POWERMILL";
  110. ELayer[ELayer["CASTLESPIKE"] = 17] = "CASTLESPIKE";
  111. ELayer[ELayer["TURRET"] = 18] = "TURRET";
  112. ELayer[ELayer["WOODFARM"] = 19] = "WOODFARM";
  113. ELayer[ELayer["CHERRYWOODFARM"] = 20] = "CHERRYWOODFARM";
  114. ELayer[ELayer["STONEWARM"] = 21] = "STONEWARM";
  115. ELayer[ELayer["CASTLEWALL"] = 22] = "CASTLEWALL";
  116. ELayer[ELayer["SHARK"] = 23] = "SHARK";
  117. ELayer[ELayer["WOLF"] = 24] = "WOLF";
  118. ELayer[ELayer["GOLDENCOW"] = 25] = "GOLDENCOW";
  119. ELayer[ELayer["ROOF"] = 26] = "ROOF";
  120. ELayer[ELayer["DRAGON"] = 27] = "DRAGON";
  121. ELayer[ELayer["MAMMOTH"] = 28] = "MAMMOTH";
  122. ELayer[ELayer["FIREBALL"] = 29] = "FIREBALL";
  123. ELayer[ELayer["CHEST"] = 30] = "CHEST";
  124. ELayer[ELayer["DRAGONWALLBIG"] = 31] = "DRAGONWALLBIG";
  125. ELayer[ELayer["DRAGONWALLMEDIUM"] = 32] = "DRAGONWALLMEDIUM";
  126. ELayer[ELayer["DRAGONWALLSMALL"] = 33] = "DRAGONWALLSMALL";
  127. ELayer[ELayer["MAMMOTHWALL"] = 34] = "MAMMOTHWALL";
  128. ELayer[ELayer["MAMMOTHWALLSMALL"] = 35] = "MAMMOTHWALLSMALL";
  129. ELayer[ELayer["DUCK"] = 36] = "DUCK";
  130. ELayer[ELayer["TELEPORT"] = 37] = "TELEPORT";
  131. ELayer[ELayer["CACTUS"] = 38] = "CACTUS";
  132. ELayer[ELayer["TORNADO"] = 39] = "TORNADO";
  133. })(ELayer || (ELayer = {}));
  134. const LayerObjects = [ ELayer.STONE, ELayer.HARDSPIKE, ELayer.TREE, ELayer.GOLD, ELayer.BUSH, ELayer.SPIKE, ELayer.WOODWALL, ELayer.WINDMILL, ELayer.SPAWN, ELayer.POWERMILL, ELayer.CASTLESPIKE, ELayer.TURRET, ELayer.WOODFARM, ELayer.CHERRYWOODFARM, ELayer.STONEWARM, ELayer.CASTLEWALL, ELayer.CHEST, ELayer.DRAGONWALLBIG, ELayer.DRAGONWALLMEDIUM, ELayer.DRAGONWALLSMALL, ELayer.MAMMOTHWALL, ELayer.MAMMOTHWALLSMALL, ELayer.TELEPORT, ELayer.CACTUS ];
  135. const LayerExclude = [ ELayer.TREE, ELayer.WOODFARM, ELayer.CHERRYWOODFARM ];
  136. var EObjects;
  137. (function(EObjects) {
  138. EObjects[EObjects["BOOST"] = 6] = "BOOST";
  139. EObjects[EObjects["PLATFORM"] = 8] = "PLATFORM";
  140. EObjects[EObjects["TRAP"] = 9] = "TRAP";
  141. EObjects[EObjects["ROOF"] = 48] = "ROOF";
  142. })(EObjects || (EObjects = {}));
  143. var EHats;
  144. (function(EHats) {
  145. EHats[EHats["BUSH"] = 1] = "BUSH";
  146. EHats[EHats["BERSERKER"] = 2] = "BERSERKER";
  147. EHats[EHats["JUNGLE"] = 3] = "JUNGLE";
  148. EHats[EHats["CRYSTAL"] = 4] = "CRYSTAL";
  149. EHats[EHats["SPIKEGEAR"] = 5] = "SPIKEGEAR";
  150. EHats[EHats["IMMUNITY"] = 6] = "IMMUNITY";
  151. EHats[EHats["BOOST"] = 7] = "BOOST";
  152. EHats[EHats["APPLEHAT"] = 8] = "APPLEHAT";
  153. EHats[EHats["SCUBA"] = 9] = "SCUBA";
  154. EHats[EHats["HOOD"] = 10] = "HOOD";
  155. EHats[EHats["DEMOLIST"] = 11] = "DEMOLIST";
  156. })(EHats || (EHats = {}));
  157. var EWeapons;
  158. (function(EWeapons) {
  159. EWeapons[EWeapons["SHIELD"] = 11] = "SHIELD";
  160. EWeapons[EWeapons["STICK"] = 13] = "STICK";
  161. EWeapons[EWeapons["HAMMER"] = 15] = "HAMMER";
  162. })(EWeapons || (EWeapons = {}));
  163. var EItemTypes;
  164. (function(EItemTypes) {
  165. EItemTypes[EItemTypes["ATTACKING"] = 0] = "ATTACKING";
  166. EItemTypes[EItemTypes["SHOOTING"] = 1] = "SHOOTING";
  167. EItemTypes[EItemTypes["PLACEABLE"] = 2] = "PLACEABLE";
  168. EItemTypes[EItemTypes["FOOD"] = 3] = "FOOD";
  169. })(EItemTypes || (EItemTypes = {}));
  170. var EAnimals;
  171. (function(EAnimals) {
  172. EAnimals[EAnimals["COW"] = 14] = "COW";
  173. EAnimals[EAnimals["SHARK"] = 23] = "SHARK";
  174. EAnimals[EAnimals["WOLF"] = 24] = "WOLF";
  175. EAnimals[EAnimals["GOLDENCOW"] = 25] = "GOLDENCOW";
  176. EAnimals[EAnimals["DRAGON"] = 27] = "DRAGON";
  177. EAnimals[EAnimals["MAMMOTH"] = 28] = "MAMMOTH";
  178. EAnimals[EAnimals["DUCK"] = 36] = "DUCK";
  179. })(EAnimals || (EAnimals = {}));
  180. var PlacementMode;
  181. (function(PlacementMode) {
  182. PlacementMode[PlacementMode["INVISIBLE"] = 0] = "INVISIBLE";
  183. PlacementMode[PlacementMode["HOLDING"] = 1] = "HOLDING";
  184. PlacementMode[PlacementMode["AUTOMATIC"] = 2] = "AUTOMATIC";
  185. })(PlacementMode || (PlacementMode = {}));
  186. let teammates = [];
  187. const UpdateClanList = userList => {
  188. teammates = userList;
  189. };
  190. const DeleteClan = () => {
  191. teammates = [];
  192. };
  193. const storage = {
  194. get(key) {
  195. return JSON.parse(localStorage.getItem(key));
  196. },
  197. set(key, value) {
  198. localStorage.setItem(key, JSON.stringify(value));
  199. },
  200. delete(key) {
  201. localStorage.removeItem(key);
  202. }
  203. };
  204. const defaultSettings = {
  205. primary: "Digit1",
  206. secondary: "Digit2",
  207. heal: "KeyQ",
  208. wall: "Digit4",
  209. spike: "KeyV",
  210. windmill: "KeyN",
  211. trap: "KeyF",
  212. turret: "KeyH",
  213. tree: "KeyU",
  214. platform: "KeyT",
  215. spawn: "KeyJ",
  216. up: "KeyW",
  217. left: "KeyA",
  218. down: "KeyS",
  219. right: "KeyD",
  220. attack: 0,
  221. autoattack: "KeyE",
  222. lockRotation: "KeyX",
  223. openChat: "Enter",
  224. invisibleHit: 2,
  225. spikeInsta: "KeyR",
  226. toggleMenu: "Escape",
  227. fastBreak: "KeyZ",
  228. unequip: "...",
  229. bush: "...",
  230. berserker: "...",
  231. jungle: "...",
  232. crystal: "...",
  233. spikegear: "...",
  234. immunity: 4,
  235. boost: 3,
  236. applehat: "...",
  237. scuba: "...",
  238. hood: "...",
  239. demolist: "...",
  240. placementMode: PlacementMode.AUTOMATIC,
  241. placementSpeed: 15,
  242. autoheal: true,
  243. autohealDelay: 80,
  244. jungleOnClown: true,
  245. lastHat: true,
  246. autoScuba: true,
  247. enemyTracers: true,
  248. teammateTracers: true,
  249. animalTracers: true,
  250. enemyColor: "#cc5151",
  251. teammateColor: "#8ecc51",
  252. animalColor: "#518ccc",
  253. arrows: true,
  254. rainbow: false,
  255. drawHP: true,
  256. showHoods: true,
  257. itemCounter: true,
  258. drawID: false,
  259. itemMarkers: true,
  260. teammateMarkers: true,
  261. enemyMarkers: true,
  262. trapActivated: true,
  263. itemMarkersColor: "#8ecc51",
  264. teammateMarkersColor: "#cfbc5f",
  265. enemyMarkersColor: "#cc5151",
  266. trapActivatedColor: "#48b2b8",
  267. markersBottom: true,
  268. hatReloadBar: true,
  269. hatReloadBarColor: "#5155cc",
  270. fireballReloadBar: true,
  271. fireballReloadBarColor: "#cf7748",
  272. turretReloadBar: true,
  273. turretReloadBarColor: "#51cc80",
  274. windmillRotation: false,
  275. possibleShots: true,
  276. autochat: true,
  277. autochatMessages: [ "Dsync Client", "What is it?", "The most advanced hack for sploop!", "Download on greasyfork!" ],
  278. kill: true,
  279. killMessage: "{NAME}, you suck! {KILL}x",
  280. autospawn: false,
  281. smoothZoom: true,
  282. skipUpgrades: true,
  283. invisHitToggle: false,
  284. reverseZoom: false,
  285. menuTransparency: false
  286. };
  287. const settings = {
  288. ...defaultSettings,
  289. ...storage.get("Dsync-settings")
  290. };
  291. for (const key in settings) {
  292. if (!defaultSettings.hasOwnProperty(key)) {
  293. delete settings[key];
  294. }
  295. }
  296. storage.set("Dsync-settings", settings);
  297. const Settings = settings;
  298. const itemBar = index => Dsync.defaultData[Dsync.props.itemBar][index];
  299. const hasSecondary = () => {
  300. const id = itemBar(1);
  301. const item = Dsync.itemData[id];
  302. return item[Dsync.props.itemType] === EItems.SECONDARY;
  303. };
  304. const canShoot = () => {
  305. const id = itemBar(1);
  306. const item = Dsync.itemData[id];
  307. return item[Dsync.props.itemDataType] === EItemTypes.SHOOTING;
  308. };
  309. const hasItemByType = type => {
  310. const items = Dsync.defaultData[Dsync.props.itemBar];
  311. return items.some((id => Dsync.itemData[id][Dsync.props.itemType] === type));
  312. };
  313. const getAnimals = () => {
  314. const list = Dsync.entityList();
  315. return [ ...list[EAnimals.COW], ...list[EAnimals.SHARK], ...list[EAnimals.WOLF], ...list[EAnimals.GOLDENCOW], ...list[EAnimals.DRAGON], ...list[EAnimals.MAMMOTH], ...list[EAnimals.DUCK] ].map((entity => formatEntity(entity)));
  316. };
  317. const getEnemies = () => {
  318. const players = Dsync.entityList()[0];
  319. return players.map((player => formatEntity(player))).filter((({id, ownerID}) => {
  320. const isMyPlayer = id === Dsync.myPlayerID();
  321. const isTeammate = teammates.includes(ownerID);
  322. return !isMyPlayer && !isTeammate;
  323. }));
  324. };
  325. const getEntities = () => [ ...getEnemies(), ...getAnimals() ];
  326. const lineSegmentIntersectsCircle = (x1, y1, x2, y2, cx, cy, r) => {
  327. const xL = x2 - x1;
  328. const xC = x1 - cx;
  329. const yL = y2 - y1;
  330. const yC = y1 - cy;
  331. const a = xL * xL + yL * yL;
  332. const hB = xL * xC + yL * yC;
  333. const c = xC * xC + yC * yC - r * r;
  334. return hB * hB >= a * c && (-hB <= a || c + hB + hB + a <= 0) && (hB <= 0 || c <= 0);
  335. };
  336. const getNearestEntities = shoot => {
  337. const enemies = getEnemies().map((enemy => ({
  338. ...enemy,
  339. dir: getAngle(enemy, Dsync.myPlayer).angle,
  340. distance: distance(enemy, Dsync.myPlayer).dist
  341. }))).sort(((a, b) => a.distance - b.distance));
  342. if (shoot) {
  343. enemies.sort(((a, b) => {
  344. const hasShield1 = a.target[Dsync.props.currentItem] === EWeapons.SHIELD;
  345. const hasShield2 = b.target[Dsync.props.currentItem] === EWeapons.SHIELD;
  346. return hasShield1 ? 1 : hasShield2 ? -1 : 0;
  347. }));
  348. }
  349. const animals = getAnimals().map((enemy => ({
  350. ...enemy,
  351. dir: getAngle(enemy, Dsync.myPlayer).angle,
  352. distance: distance(enemy, Dsync.myPlayer).dist
  353. }))).sort(((a, b) => a.distance - b.distance));
  354. return [ ...enemies, ...animals ];
  355. };
  356. const entityIn = (entity, layer) => Dsync.entityList()[layer].some((target => {
  357. const object = formatObject(target);
  358. return distance(entity, object).dist < entity.radius + object.radius;
  359. }));
  360. const projectileCanHitEntity = entity => {
  361. if (!canShoot()) return false;
  362. const range = Dsync.itemData[itemBar(EItems.SECONDARY)].range;
  363. const enemy = {
  364. ...entity,
  365. dir: getAngle(entity, Dsync.myPlayer).angle,
  366. distance: distance(entity, Dsync.myPlayer).dist
  367. };
  368. const x1 = Dsync.myPlayer.x2;
  369. const y1 = Dsync.myPlayer.y2;
  370. const x2 = x1 + range * Math.cos(enemy.dir);
  371. const y2 = y1 + range * Math.sin(enemy.dir);
  372. const myPlayerOnPlatform = entityIn(Dsync.myPlayer, ELayer.PLATFORM);
  373. const entityInRoof = entityIn(entity, ELayer.ROOF);
  374. if (myPlayerOnPlatform && entityInRoof) return false;
  375. const layers = Dsync.entityList();
  376. for (const layer of LayerObjects) {
  377. if (myPlayerOnPlatform && !LayerExclude.includes(layer)) continue;
  378. for (const entity of layers[layer]) {
  379. const object = formatObject(entity);
  380. const dist = distance(object, Dsync.myPlayer).dist;
  381. if (dist > enemy.distance) continue;
  382. if (lineSegmentIntersectsCircle(x1, y1, x2, y2, object.x2, object.y2, object.radius)) {
  383. const objectData = Dsync.entityData[object.type];
  384. const maxHealth = objectData[Dsync.props.maxHealth];
  385. if (maxHealth === undefined) return false;
  386. return {
  387. canHit: true,
  388. needDestroy: true
  389. };
  390. }
  391. }
  392. }
  393. return {
  394. canHit: true,
  395. needDestroy: false
  396. };
  397. };
  398. const getNearestPossibleEnemy = index => {
  399. const range = Dsync.itemData[itemBar(index)].range;
  400. const shoot = canShoot() && index === 1;
  401. const enemies = getNearestEntities(shoot).filter((enemy => {
  402. const inDistance = enemy.distance < range + enemy.radius;
  403. if (shoot) {
  404. const entityHit = projectileCanHitEntity(enemy);
  405. return inDistance && typeof entityHit === "object" && entityHit.canHit;
  406. }
  407. return inDistance;
  408. }));
  409. if (shoot) {
  410. enemies.sort(((a, b) => {
  411. const canHitA = projectileCanHitEntity(a);
  412. const canHitB = projectileCanHitEntity(b);
  413. return canHitA.needDestroy ? 1 : canHitB.needDestroy ? -1 : 0;
  414. }));
  415. }
  416. return enemies.length ? enemies[0] : null;
  417. };
  418. const createImage = src => {
  419. const img = new Image;
  420. img.src = src;
  421. img.loaded = false;
  422. img.onload = () => {
  423. img.loaded = true;
  424. };
  425. return img;
  426. };
  427. const Images = {
  428. gaugeBackground: createImage("https://i.imgur.com/xincrX4.png"),
  429. gaugeFront: createImage("https://i.imgur.com/6AkHQM4.png")
  430. };
  431. const utils_Images = Images;
  432. const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
  433. const removeClass = (target, name) => {
  434. if (target instanceof HTMLElement) {
  435. target.classList.remove(name);
  436. return;
  437. }
  438. for (const element of target) {
  439. element.classList.remove(name);
  440. }
  441. };
  442. const formatCode = code => {
  443. code = code + "";
  444. if (code === "0") return "LBTN";
  445. if (code === "1") return "MBTN";
  446. if (code === "2") return "RBTN";
  447. if (code === "3") return "XBTN2";
  448. if (code === "4") return "XBTN1";
  449. if (code === "Escape") return "ESC";
  450. if (code === "BracketLeft") return "[";
  451. if (code === "BracketRight") return "]";
  452. if (code === "NumpadDivide") return "NUMDIV";
  453. if (code === "NumpadMultiply") return "NUMMULT";
  454. if (code === "NumpadSubtract") return "NUMSUB";
  455. if (code === "NumpadDecimal") return "NUMDEC";
  456. if (code === "CapsLock") return "CAPS";
  457. if (code === "PrintScreen") return "PRNT";
  458. if (code === "Backslash") return "\\";
  459. if (code === "Backquote") return "BQUOTE";
  460. if (code === "PageDown") return "PAGEDN";
  461. const NumpadDigitArrowKey = /^(?:Numpad|Digit|Arrow|Key)(\w+)$/;
  462. if (NumpadDigitArrowKey.test(code)) {
  463. code = code.replace(NumpadDigitArrowKey, "$1").replace(/Numpad/, "NUM");
  464. }
  465. const ExtraKeysRegex = /^(Control|Shift|Alt)(.).*/;
  466. if (ExtraKeysRegex.test(code)) {
  467. code = code.replace(ExtraKeysRegex, "$2$1").replace(/Control/, "CTRL");
  468. }
  469. return code.toUpperCase();
  470. };
  471. const contains = (target, name) => target.classList.contains(name);
  472. const isInput = target => {
  473. const element = target || document.activeElement;
  474. return [ "TEXTAREA", "INPUT" ].includes(element.tagName);
  475. };
  476. const inGame = () => {
  477. const homepage = document.querySelector("#homepage");
  478. return homepage && homepage.style.display === "none";
  479. };
  480. const formatData = object => ({
  481. id: object[Dsync.props.id],
  482. type: object.type,
  483. x: object[Dsync.props.x],
  484. y: object[Dsync.props.y],
  485. x1: object[Dsync.props.x1],
  486. y1: object[Dsync.props.y1],
  487. x2: object[Dsync.props.x2],
  488. y2: object[Dsync.props.y2],
  489. angle: object[Dsync.props.angle],
  490. angle1: object[Dsync.props.angle1],
  491. angle2: object[Dsync.props.angle2],
  492. ownerID: object[Dsync.props.itemOwner],
  493. target: object
  494. });
  495. const formatProjectile = object => {
  496. const data = formatData(object);
  497. return {
  498. ...data,
  499. range: object.range
  500. };
  501. };
  502. const formatObject = object => {
  503. const data = formatData(object);
  504. const entityData = Dsync.entityData[object.type];
  505. return {
  506. ...data,
  507. radius: entityData[Dsync.props.radius]
  508. };
  509. };
  510. const formatEntity = entity => {
  511. const object = formatObject(entity);
  512. const entityData = Dsync.entityData[entity.type];
  513. const healthValue = entity[Dsync.props.health];
  514. const maxHealth = entityData[Dsync.props.maxHealth];
  515. return {
  516. ...object,
  517. healthValue,
  518. health: Math.ceil(entity[Dsync.props.health] / 255 * maxHealth),
  519. maxHealth,
  520. playerValue: entity[Dsync.props.playerValue]
  521. };
  522. };
  523. const formatPlayer = entity => {
  524. const player = formatEntity(entity);
  525. return {
  526. ...player,
  527. hat: entity[Dsync.props.hat],
  528. isClown: player.playerValue === 128
  529. };
  530. };
  531. const getTracerColor = (entity, isTeammate) => {
  532. if (entity.id === Dsync.myPlayerID() || isTeammate) return Settings.teammateColor;
  533. if (entity.type === 0) return Settings.enemyColor;
  534. return Settings.animalColor;
  535. };
  536. const trapActive = object => {
  537. const trap = formatObject(object);
  538. return getEntities().some((entity => distance(entity, trap).dist < trap.radius + entity.radius - 25));
  539. };
  540. const getMarkerColor = (target, ownerID) => {
  541. let color = null;
  542. const isMyPlayers = (Dsync.myPlayer || {}).ownerID === ownerID;
  543. const isTeammates = teammates.includes(ownerID);
  544. const isTeammateTrap = target.type === 6 && (isMyPlayers || isTeammates);
  545. if (Settings.itemMarkers && isMyPlayers) {
  546. color = Settings.itemMarkersColor;
  547. } else if (Settings.teammateMarkers && isTeammates) {
  548. color = Settings.teammateMarkersColor;
  549. } else if (Settings.enemyMarkers && !isMyPlayers && !isTeammates) {
  550. color = Settings.enemyMarkersColor;
  551. }
  552. if (Settings.trapActivated && isTeammateTrap) {
  553. const id = target[Dsync.props.id];
  554. if (!target.active && trapActive(target)) {
  555. target.active = id;
  556. }
  557. if (target.active === id) return Settings.trapActivatedColor;
  558. target.active = null;
  559. }
  560. return color;
  561. };
  562. const marker = (ctx, color) => {
  563. ctx.strokeStyle = "#303030";
  564. ctx.lineWidth = 3;
  565. ctx.fillStyle = color;
  566. ctx.beginPath();
  567. ctx.arc(0, 0, 9, 0, 2 * Math.PI);
  568. ctx.fill();
  569. ctx.stroke();
  570. ctx.closePath();
  571. };
  572. const arrow = (ctx, len, x, y, angle, color) => {
  573. ctx.save();
  574. ctx.translate(x, y);
  575. ctx.rotate(Math.PI / 4);
  576. ctx.rotate(angle);
  577. ctx.globalAlpha = .75;
  578. ctx.strokeStyle = color;
  579. ctx.lineCap = "round";
  580. ctx.lineWidth = 8;
  581. ctx.beginPath();
  582. ctx.moveTo(-len, -len);
  583. ctx.lineTo(len, -len);
  584. ctx.lineTo(len, len);
  585. ctx.stroke();
  586. ctx.closePath();
  587. ctx.restore();
  588. };
  589. const lines = (ctx, x1, y1, x2, y2, color) => {
  590. ctx.save();
  591. ctx.globalAlpha = .75;
  592. ctx.strokeStyle = color;
  593. ctx.lineCap = "round";
  594. ctx.lineWidth = 5;
  595. ctx.beginPath();
  596. ctx.moveTo(x1, y1);
  597. ctx.lineTo(x2, y2);
  598. ctx.stroke();
  599. ctx.restore();
  600. };
  601. const Common_images = {};
  602. const crosshair = (ctx, x, y, angle, color, radius, width, height) => {
  603. const canvas = Common_images[color] || function() {
  604. const canvas = document.createElement("canvas");
  605. canvas.width = 256;
  606. canvas.height = 256;
  607. const ctx = canvas.getContext("2d");
  608. ctx.translate(canvas.width / 2, canvas.height / 2);
  609. ctx.strokeStyle = color;
  610. ctx.fillStyle = color;
  611. ctx.lineWidth = width / 1.5;
  612. ctx.beginPath();
  613. ctx.arc(0, 0, radius, 0, 2 * Math.PI);
  614. ctx.stroke();
  615. ctx.closePath();
  616. for (let i = 0; i < 4; i++) {
  617. ctx.beginPath();
  618. ctx.rect(-width / 2, radius - height / 2, width, height);
  619. ctx.fill();
  620. ctx.rotate(Math.PI / 2);
  621. ctx.closePath();
  622. }
  623. Common_images[color] = canvas;
  624. return canvas;
  625. }();
  626. ctx.save();
  627. ctx.translate(x, y);
  628. ctx.rotate(angle);
  629. ctx.globalAlpha = .75;
  630. ctx.drawImage(canvas, -canvas.width / 2, -canvas.height / 2);
  631. ctx.restore();
  632. };
  633. const drawImage = (ctx, image) => {
  634. ctx.drawImage(image, -.5 * image.width / 2, -.5 * image.height, image.width * .5, image.height * .5);
  635. };
  636. const drawBar = (ctx, entity, value, maxValue, color) => {
  637. const {x, y, radius} = entity;
  638. const background = utils_Images.gaugeBackground;
  639. const front = utils_Images.gaugeFront;
  640. const scale = .5;
  641. const width = front.width * scale;
  642. const fill = value / maxValue * (width - 10);
  643. const h = entity.type === ELayer.TURRET ? 25 : 50;
  644. ctx.save();
  645. ctx.translate(x, y + radius + h + front.height * scale);
  646. drawImage(ctx, background);
  647. ctx.fillStyle = color;
  648. ctx.fillRect(-width / 2 + 5, -scale * front.height + 5, fill, scale * front.height - 10);
  649. drawImage(ctx, front);
  650. ctx.restore();
  651. };
  652. const drawHealth = (ctx, entity) => {
  653. if (!Settings.drawHP) return;
  654. const {x, y, health, maxHealth, radius} = entity;
  655. const front = utils_Images.gaugeFront;
  656. let h = 0;
  657. if (Settings.hatReloadBar && entity.type === 0 || Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  658. h = front.height * .5;
  659. }
  660. renderText(ctx, `HP ${health}/${maxHealth}`, ((width, height) => [ x - width / 2, y + radius + h + 55 ]));
  661. };
  662. const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
  663. const distance = (entity1, entity2) => {
  664. const entity1Has = "x" in entity1 && "y" in entity1;
  665. const entity2Has = "x" in entity2 && "y" in entity2;
  666. return {
  667. lerpDist: entity1Has && entity2Has ? dist(entity1.x, entity1.y, entity2.x, entity2.y) : null,
  668. dist: dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2)
  669. };
  670. };
  671. const getAngle = (entity1, entity2) => {
  672. const entity1Has = "x" in entity1 && "y" in entity1;
  673. const entity2Has = "x" in entity2 && "y" in entity2;
  674. return {
  675. lerpAngle: entity1Has && entity2Has ? Math.atan2(entity1.y - entity2.y, entity1.x - entity2.x) : null,
  676. angle: Math.atan2(entity1.y2 - entity2.y2, entity1.x2 - entity2.x2)
  677. };
  678. };
  679. const lerp = (start, stop, amt) => amt * (stop - start) + start;
  680. const drawTracers = (ctx, entity, isTeammate) => {
  681. const player = formatPlayer(Dsync.target);
  682. const {x: x1, y: y1} = player;
  683. const {x: x2, y: y2} = entity;
  684. const color = Settings.rainbow ? `hsl(${Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  685. if (Settings.arrows) {
  686. const arrowWidth = 8;
  687. const angle = getAngle(entity, player).lerpAngle;
  688. const dist = Math.min(100 + arrowWidth * 2, distance(entity, player).lerpDist - arrowWidth * 2);
  689. const x = x1 + dist * Math.cos(angle);
  690. const y = y1 + dist * Math.sin(angle);
  691. arrow(ctx, arrowWidth, x, y, angle, color);
  692. } else {
  693. lines(ctx, x1, y1, x2, y2, color);
  694. }
  695. };
  696. const TextOptions = {
  697. font: "bold 15px Montserrat",
  698. textBaseline: "top"
  699. };
  700. const renderText = (ctx, text, callback, options) => {
  701. ctx.save();
  702. ctx.fillStyle = "#fff";
  703. ctx.strokeStyle = "#303030";
  704. ctx.lineWidth = 8;
  705. ctx.lineJoin = "round";
  706. Object.assign(ctx, TextOptions, options);
  707. const width = ctx.measureText(text).width;
  708. const height = parseInt(ctx.font.match(/\d+/)[0]) || 1;
  709. const data = callback(width, height);
  710. ctx.strokeText(text, ...data);
  711. ctx.fillText(text, ...data);
  712. ctx.restore();
  713. };
  714. const windmillRotation = target => {
  715. if (target.type !== ELayer.WINDMILL && target.type !== ELayer.POWERMILL) return;
  716. if (!target.rotSpeed) {
  717. target.rotSpeed = target[Dsync.props.rotSpeed];
  718. }
  719. const rot = Settings.windmillRotation ? target.rotSpeed : 0;
  720. if (target[Dsync.props.rotSpeed] !== rot) {
  721. target[Dsync.props.rotSpeed] = rot;
  722. }
  723. };
  724. const sleep = ms => new Promise((resolve => setTimeout(resolve, ms)));
  725. const linker = value => {
  726. const hook = {
  727. 0: value,
  728. toString: radix => hook[0].toString(radix),
  729. valueOf: () => hook[0].valueOf()
  730. };
  731. return hook;
  732. };
  733. const download = (data, filename) => {
  734. const blob = new Blob([ JSON.stringify(data, null, 4) ], {
  735. type: "application/json "
  736. });
  737. const url = URL.createObjectURL(blob);
  738. const a = document.createElement("a");
  739. a.href = url;
  740. a.download = (filename || "settings") + ".txt";
  741. a.click();
  742. a.remove();
  743. URL.revokeObjectURL(url);
  744. };
  745. let move = 0;
  746. let attacking = false;
  747. let autoattack = false;
  748. let weapon = false;
  749. let isHealing = false;
  750. let attackingInvis = false;
  751. let toggleInvis = false;
  752. let currentItem = null;
  753. const hotkeys = new Map;
  754. const spawn = async () => {
  755. await sleep(100);
  756. const play = document.querySelector("#play");
  757. if (play) play.click();
  758. };
  759. let chatCount = 0;
  760. let chatToggle = false;
  761. const autochat = async () => {
  762. if (chatToggle || isInput() || !inGame()) return;
  763. chatToggle = true;
  764. const messages = Settings.autochatMessages.filter((msg => msg.length));
  765. if (!messages.length) return;
  766. Dsync.chat(messages[chatCount++]);
  767. chatCount %= messages.length;
  768. await sleep(2e3);
  769. chatToggle = false;
  770. };
  771. const Controller_reset = () => {
  772. move = 0;
  773. attacking = false;
  774. autoattack = false;
  775. weapon = false;
  776. isHealing = false;
  777. attackingInvis = false;
  778. toggleInvis = false;
  779. currentItem = null;
  780. for (const [key] of hotkeys) {
  781. hotkeys.delete(key);
  782. }
  783. };
  784. const equipHat = (id, ignore = false, actual = true) => {
  785. const hat = (Dsync.myPlayer || {}).hat || 0;
  786. if (id === 0) {
  787. id = hat;
  788. } else if (hat === id && !ignore) return;
  789. if (actual) {
  790. Dsync.actualHat = id;
  791. }
  792. Dsync.equipHat(id);
  793. Dsync.equipHat(id);
  794. };
  795. const whichWeapon = type => {
  796. if (type !== undefined) {
  797. weapon = type;
  798. }
  799. Dsync.selectByID(itemBar(Number(weapon)));
  800. };
  801. const attack = (angle = null) => {
  802. Dsync.attack(angle !== null ? angle : Dsync.getAngle());
  803. };
  804. const place = (id, angle = null) => {
  805. Dsync.selectItem(id);
  806. attack(angle);
  807. Dsync.stopAttack();
  808. whichWeapon();
  809. if (attacking) {
  810. attack(angle);
  811. }
  812. };
  813. let count = 0;
  814. const placement = () => {
  815. if (currentItem === null) return;
  816. place(currentItem);
  817. count++;
  818. if ((count %= Settings.placementSpeed) === 0) {
  819. setTimeout(placement);
  820. } else {
  821. queueMicrotask(placement);
  822. }
  823. };
  824. const placementHandler = (type, code) => {
  825. if (!hasItemByType(type)) return;
  826. hotkeys.set(code, type);
  827. currentItem = type;
  828. if (hotkeys.size === 1) {
  829. placement();
  830. }
  831. };
  832. const heal = () => {
  833. Dsync.selectItem(EItems.HEAL);
  834. attack();
  835. Dsync.stopAttack();
  836. whichWeapon();
  837. if (attacking) {
  838. attack();
  839. }
  840. };
  841. const healing = () => {
  842. if (!isHealing) return;
  843. heal();
  844. setTimeout(healing, 0);
  845. };
  846. const invisibleHit = () => {
  847. Dsync.mousemove = true;
  848. Dsync.aimTarget = null;
  849. if (Settings.invisHitToggle && !toggleInvis || !Settings.invisHitToggle && !attackingInvis) {
  850. toggleInvis = false;
  851. attackingInvis = false;
  852. return;
  853. }
  854. let angle = null;
  855. const enemy = getNearestPossibleEnemy(+!weapon);
  856. const shoot = canShoot() && !weapon;
  857. if (enemy) {
  858. angle = enemy.dir;
  859. Dsync.mousemove = false;
  860. Dsync.aimTarget = enemy.target;
  861. }
  862. if (enemy && shoot || !shoot) {
  863. whichWeapon(!weapon);
  864. attack(angle);
  865. Dsync.stopAttack();
  866. whichWeapon(!weapon);
  867. }
  868. setTimeout(invisibleHit, 75);
  869. };
  870. const spikeInsta = () => {
  871. let angle = null;
  872. const enemy = getNearestPossibleEnemy(0);
  873. if (enemy) {
  874. angle = enemy.dir;
  875. }
  876. const oldWeapon = weapon;
  877. equipHat(EHats.BERSERKER);
  878. whichWeapon(false);
  879. place(EItems.SPIKE, angle);
  880. attack(angle);
  881. Dsync.stopAttack();
  882. whichWeapon(oldWeapon);
  883. };
  884. let fastBreakHat = 0;
  885. let oldWeapon = false;
  886. let fastBreaking = false;
  887. let startFastBreak = 0;
  888. const fastBreak = () => {
  889. if (fastBreaking) return;
  890. startFastBreak = Date.now();
  891. const primary = itemBar(0);
  892. const secondary = itemBar(1);
  893. const pickWeapon = hasSecondary() && !canShoot() && (secondary === EWeapons.HAMMER || primary === EWeapons.STICK);
  894. oldWeapon = weapon;
  895. fastBreaking = true;
  896. fastBreakHat = Dsync.myPlayer.hat;
  897. whichWeapon(pickWeapon);
  898. equipHat(EHats.DEMOLIST);
  899. attacking = true;
  900. attack();
  901. };
  902. const fastBreakStop = async () => {
  903. if (!fastBreaking) return;
  904. Dsync.stopAttack();
  905. attacking = false;
  906. whichWeapon(oldWeapon);
  907. const step = Date.now() - startFastBreak;
  908. if (step < 1300) await sleep(1300 - step);
  909. if (!Dsync.myPlayer.isClown) equipHat(fastBreakHat);
  910. fastBreaking = false;
  911. };
  912. const handleKeydown = (event, code) => {
  913. if (code === 1) event.preventDefault();
  914. if (event instanceof KeyboardEvent && event.repeat) return;
  915. if (Dsync.active) return;
  916. if (code === Settings.toggleMenu && !isInput(event.target)) {
  917. Dsync.toggleMenu();
  918. }
  919. if (!inGame()) return;
  920. if (code === Settings.openChat) {
  921. if (!isInput()) event.preventDefault();
  922. Dsync.toggleChat();
  923. }
  924. if (isInput(event.target)) return;
  925. if (code === Settings.primary) whichWeapon(false);
  926. if (code === Settings.secondary && hasSecondary()) whichWeapon(true);
  927. if (code === Settings.heal) {
  928. isHealing = true;
  929. healing();
  930. }
  931. if (code === Settings.wall) placementHandler(EItems.WALL, code);
  932. if (code === Settings.spike) placementHandler(EItems.SPIKE, code);
  933. if (code === Settings.windmill) placementHandler(EItems.WINDMILL, code);
  934. if (code === Settings.trap) placementHandler(EItems.TRAP, code);
  935. if (code === Settings.turret) placementHandler(EItems.TURRET, code);
  936. if (code === Settings.tree) placementHandler(EItems.TREE, code);
  937. if (code === Settings.platform) placementHandler(EItems.PLATFORM, code);
  938. if (code === Settings.spawn) placementHandler(EItems.SPAWN, code);
  939. if (code === Settings.unequip) equipHat(Dsync.myPlayer.hat, true);
  940. if (code === Settings.bush) equipHat(EHats.BUSH);
  941. if (code === Settings.berserker) equipHat(EHats.BERSERKER);
  942. if (code === Settings.jungle) equipHat(EHats.JUNGLE);
  943. if (code === Settings.crystal) equipHat(EHats.CRYSTAL);
  944. if (code === Settings.spikegear) equipHat(EHats.SPIKEGEAR);
  945. if (code === Settings.immunity) equipHat(EHats.IMMUNITY);
  946. if (code === Settings.boost) equipHat(EHats.BOOST);
  947. if (code === Settings.applehat) equipHat(EHats.APPLEHAT);
  948. if (code === Settings.scuba) equipHat(EHats.SCUBA);
  949. if (code === Settings.hood) equipHat(EHats.HOOD);
  950. if (code === Settings.demolist) equipHat(EHats.DEMOLIST);
  951. if (code === Settings.invisibleHit && hasSecondary()) {
  952. if (Settings.invisHitToggle) {
  953. toggleInvis = !toggleInvis;
  954. } else {
  955. attackingInvis = true;
  956. }
  957. if (toggleInvis || attackingInvis) invisibleHit();
  958. }
  959. if (code === Settings.spikeInsta) spikeInsta();
  960. if (code === Settings.fastBreak) fastBreak();
  961. const copyMove = move;
  962. if (code === Settings.up) move |= 1;
  963. if (code === Settings.left) move |= 4;
  964. if (code === Settings.down) move |= 2;
  965. if (code === Settings.right) move |= 8;
  966. if (copyMove !== move) Dsync.move(move);
  967. if (event instanceof MouseEvent && code === Settings.attack) {
  968. const canAttack = !Dsync.mousedown(event);
  969. if (canAttack && Dsync.mousemove) {
  970. attacking = true;
  971. Dsync.attack(Dsync.getAngle());
  972. }
  973. }
  974. if (code === Settings.autoattack) {
  975. autoattack = !autoattack;
  976. Dsync.autoattack(autoattack);
  977. }
  978. if (code === Settings.lockRotation) Dsync.toggleRotation();
  979. };
  980. const handleKeyup = (event, code) => {
  981. if (code === Settings.heal && isHealing) {
  982. isHealing = false;
  983. }
  984. if (code === Settings.invisibleHit && attackingInvis) {
  985. attackingInvis = false;
  986. }
  987. if (code === Settings.fastBreak) fastBreakStop();
  988. const copyMove = move;
  989. if (code === Settings.up) move &= -2;
  990. if (code === Settings.left) move &= -5;
  991. if (code === Settings.down) move &= -3;
  992. if (code === Settings.right) move &= -9;
  993. if (copyMove !== move) Dsync.move(move);
  994. if (event instanceof MouseEvent && code === Settings.attack) {
  995. Dsync.mouseup(event);
  996. attacking = false;
  997. }
  998. if (currentItem !== null && hotkeys.delete(code)) {
  999. const entries = [ ...hotkeys ];
  1000. currentItem = entries.length ? entries[entries.length - 1][1] : null;
  1001. }
  1002. };
  1003. var code = '<header> <span>Dsync Client</span> <div id="version"> <svg width="15" height="15" viewBox="0 0 16 16" version="1.1"> <path d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path> </svg> <span></span> </div> <svg id="close-menu" class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30px" height="30px"> <path d="M 7 4 C 6.744125 4 6.4879687 4.0974687 6.2929688 4.2929688 L 4.2929688 6.2929688 C 3.9019687 6.6839688 3.9019687 7.3170313 4.2929688 7.7070312 L 11.585938 15 L 4.2929688 22.292969 C 3.9019687 22.683969 3.9019687 23.317031 4.2929688 23.707031 L 6.2929688 25.707031 C 6.6839688 26.098031 7.3170313 26.098031 7.7070312 25.707031 L 15 18.414062 L 22.292969 25.707031 C 22.682969 26.098031 23.317031 26.098031 23.707031 25.707031 L 25.707031 23.707031 C 26.098031 23.316031 26.098031 22.682969 25.707031 22.292969 L 18.414062 15 L 25.707031 7.7070312 C 26.098031 7.3170312 26.098031 6.6829688 25.707031 6.2929688 L 23.707031 4.2929688 C 23.316031 3.9019687 22.682969 3.9019687 22.292969 4.2929688 L 15 11.585938 L 7.7070312 4.2929688 C 7.5115312 4.0974687 7.255875 4 7 4 z"/> </svg> </header>';
  1004. const Header = code;
  1005. var Navbar_code = '<aside id="navbar-container"> <button class="open-menu active">Keybinds</button> <button class="open-menu">Combat</button> <button class="open-menu">Visuals</button> <button class="open-menu">Misc</button> <button class="open-menu bottom-align">Credits</button> </aside>';
  1006. const Navbar = Navbar_code;
  1007. var Keybinds_code = '<div class="menu-page opened"> <h1>Keybinds</h1> <p>Setup keybinds for items, weapons and hats</p> <div class="section"> <div class="section-title"> <h2>Items & Weapons</h2> <svg class="icon" version="1.0" xmlns="http://www.w3.org/2000/svg" width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)" stroke="none"> <path d="M160 575 l-54 -55 99 -100 100 -100 -100 -100 -100 -100 58 -57 57 -58 157 158 158 157 -155 155 c-85 85 -157 155 -160 155 -3 0 -30 -25 -60 -55z"/> </g> </svg> </div> <div class="section-content"> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Primary</span> <button id="primary" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Secondary</span> <button id="secondary" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Heal</span> <button id="heal" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Wall</span> <button id="wall" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Spike</span> <button id="spike" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Windmill</span> <button id="windmill" class="section-option-hotkeyInput"></button> </div> </div> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Trap/Boost</span> <button id="trap" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Turret</span> <button id="turret" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Tree/Stone</span> <button id="tree" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Platform</span> <button id="platform" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Cosy bed</span> <button id="spawn" class="section-option-hotkeyInput"></button> </div> </div> </div> </div> <div class="section"> <div class="section-title"> <h2>Controls & Movement</h2> <svg class="icon" version="1.0" xmlns="http://www.w3.org/2000/svg" width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)" stroke="none"> <path d="M160 575 l-54 -55 99 -100 100 -100 -100 -100 -100 -100 58 -57 57 -58 157 158 158 157 -155 155 c-85 85 -157 155 -160 155 -3 0 -30 -25 -60 -55z"/> </g> </svg> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Up</span> <button id="up" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Left</span> <button id="left" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Down</span> <button id="down" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Right</span> <button id="right" class="section-option-hotkeyInput"></button> </div> <div class="split"></div> <div class="section-option"> <span class="section-option-title">Attack</span> <button id="attack" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Auto attack</span> <button id="autoattack" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Lock rotation</span> <button id="lockRotation" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Open chat</span> <button id="openChat" class="section-option-hotkeyInput"></button> </div> <div class="split"></div> <div class="section-option"> <span class="section-option-title">Invisible hit</span> <button id="invisibleHit" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Spike insta</span> <button id="spikeInsta" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Toggle Dsync Menu</span> <button id="toggleMenu" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title"> Fast break <span class="tooltip"> * <span class="tooltip-text">When you press a key, it equips a demolist and starts attacking</span> </span> </span> <button id="fastBreak" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Zoom In</span> <button class="section-option-hotkeyInput smaller">WHEEL DN</button> </div> <div class="section-option"> <span class="section-option-title">Zoom Out</span> <button class="section-option-hotkeyInput smaller">WHEEL UP</button> </div> </div> </div> <div class="section"> <div class="section-title"> <h2>Hats</h2> <svg class="icon" version="1.0" xmlns="http://www.w3.org/2000/svg" width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)" stroke="none"> <path d="M160 575 l-54 -55 99 -100 100 -100 -100 -100 -100 -100 58 -57 57 -58 157 158 158 157 -155 155 c-85 85 -157 155 -160 155 -3 0 -30 -25 -60 -55z"/> </g> </svg> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Unequip hat</span> <button id="unequip" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Bush hat</span> <button id="bush" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Berserker</span> <button id="berserker" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Jungle gear</span> <button id="jungle" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Crystal gear</span> <button id="crystal" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Spike gear</span> <button id="spikegear" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Immunity gear</span> <button id="immunity" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Boost hat</span> <button id="boost" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Apple hat</span> <button id="applehat" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Scuba gear</span> <button id="scuba" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Hood</span> <button id="hood" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Demolist</span> <button id="demolist" class="section-option-hotkeyInput"></button> </div> </div> </div> </div>';
  1008. const Keybinds = Keybinds_code;
  1009. var Combat_code = '<div class="menu-page"> <h1>Combat</h1> <p>Modify combat settings, change pvp behavior</p> <div class="section opened"> <div class="section-title"> <h2>Placement</h2> </div> <div class="section-content one-row"> <div class="section-option"> <span class="section-option-title"> Placement speed <span class="tooltip"> * <span class="tooltip-text">The higher value, the faster you place</span> </span> </span> <label class="slider"> <input id="placementSpeed" min="1" max="100" type="range"> <span class="slider-value">100</span> </label> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Healing</h2> </div> <div class="section-content"> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Autoheal</span> <label class="switch-checkbox"> <input id="autoheal" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Healing delay</span> <label class="slider"> <input id="autohealDelay" min="0" max="150" type="range"> <span class="slider-value">150</span> </label> </div> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Hats</h2> </div> <div class="section-content"> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Jungle On Clown</span> <label class="switch-checkbox"> <input id="jungleOnClown" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Equip last hat <span class="tooltip"> * <span class="tooltip-text">On spawn, the last hat you had will be equipped</span> </span> </span> <label class="switch-checkbox"> <input id="lastHat" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Auto scuba</span> <label class="switch-checkbox"> <input id="autoScuba" type="checkbox"> <span></span> </label> </div> </div> </div> </div> </div>';
  1010. const Combat = Combat_code;
  1011. var Visuals_code = '<div class="menu-page"> <h1>Visuals</h1> <p>Customize your visuals, or you can disable it for performance</p> <div class="section opened"> <div class="section-title"> <h2>Tracers</h2> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Enemies</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="enemyColor" type="color"> <label class="switch-checkbox"> <input id="enemyTracers" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Arrows</span> <label class="switch-checkbox"> <input id="arrows" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Teammates</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="teammateColor" type="color"> <label class="switch-checkbox"> <input id="teammateTracers" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Rainbow colors</span> <label class="switch-checkbox"> <input id="rainbow" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Animals</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="animalColor" type="color"> <label class="switch-checkbox"> <input id="animalTracers" type="checkbox"> <span></span> </label> </div> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Player</h2> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Show invisible players</span> <label class="switch-checkbox"> <input id="showHoods" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Draw HP value</span> <label class="switch-checkbox"> <input id="drawHP" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Item counter</span> <label class="switch-checkbox"> <input id="itemCounter" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Draw ID</span> <label class="switch-checkbox"> <input id="drawID" type="checkbox"> <span></span> </label> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Markers</h2> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Your markers</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="itemMarkersColor" type="color"> <label class="switch-checkbox"> <input id="itemMarkers" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Teammates</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="teammateMarkersColor" type="color"> <label class="switch-checkbox"> <input id="teammateMarkers" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Enemies</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="enemyMarkersColor" type="color"> <label class="switch-checkbox"> <input id="enemyMarkers" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title"> Trap activated <span class="tooltip"> * <span class="tooltip-text">When the player or animal will be trapped, marker will change color</span> </span> </span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="trapActivatedColor" type="color"> <label class="switch-checkbox"> <input id="trapActivated" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title"> Markers at bottom <span class="tooltip"> * <span class="tooltip-text">Faster, but you won\'t be able to see markers if you\'re trapped or on platform</span> </span> </span> <label class="switch-checkbox"> <input id="markersBottom" type="checkbox"> <span></span> </label> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Reload bars</h2> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Hat reload bar</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="hatReloadBarColor" type="color"> <label class="switch-checkbox"> <input id="hatReloadBar" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Fireball reload bar</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="fireballReloadBarColor" type="color"> <label class="switch-checkbox"> <input id="fireballReloadBar" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title">Turret reload bar</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="turretReloadBarColor" type="color"> <label class="switch-checkbox"> <input id="turretReloadBar" type="checkbox"> <span></span> </label> </div> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Other</h2> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Windmill rotation</span> <label class="switch-checkbox"> <input id="windmillRotation" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Possible shots <span class="tooltip"> * <span class="tooltip-text">Draws a crosshair on entities that can be hit by a projectile</span> </span> </span> <label class="switch-checkbox"> <input id="possibleShots" type="checkbox"> <span></span> </label> </div> </div> </div> </div>';
  1012. const Visuals = Visuals_code;
  1013. var Misc_code = '<div class="menu-page"> <h1>Misc</h1> <p>Customize misc settings, add autochat messages, reset settings</p> <div class="section opened"> <div class="section-title"> <h2>Chat</h2> </div> <div class="section-content one-row"> <div class="section-option"> <span class="section-option-title">Autochat</span> <div class="content"> <input class="input autochat" type="text" maxlength="35"> <input class="input autochat" type="text" maxlength="35"> <input class="input autochat" type="text" maxlength="35"> <input class="input autochat" type="text" maxlength="35"> <label class="switch-checkbox"> <input id="autochat" type="checkbox"> <span></span> </label> </div> </div> <div class="section-option"> <span class="section-option-title"> Message on kill <span class="tooltip"> * <span class="tooltip-text left"> <div>Variables:</div> <div><span class="highlight">{KILL}</span> - amount of kills</div> <div><span class="highlight">{NAME}</span> - name of the player you killed</div> </span> </span> </span> <div class="content"> <input id="killMessage" class="input" type="text" maxlength="35"> <label class="switch-checkbox"> <input id="kill" type="checkbox"> <span></span> </label> </div> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Other</h2> </div> <div class="section-content one-row"> <div class="section-option"> <span class="section-option-title">Autospawn</span> <label class="switch-checkbox"> <input id="autospawn" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Smooth zoom <span class="tooltip"> * <span class="tooltip-text">Disable for performance</span> </span> </span> <label class="switch-checkbox"> <input id="smoothZoom" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Skip upgrades <span class="tooltip"> * <span class="tooltip-text">When you have only 1 item in the upgradebar, it will automatically select it</span> </span> </span> <label class="switch-checkbox"> <input id="skipUpgrades" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Invis hit toggle <span class="tooltip"> * <span class="tooltip-text">If enabled, invisible hit hotkey will work in toggle mode. Useful when you don\'t want to hold this button permanently</span> </span> </span> <label class="switch-checkbox"> <input id="invisHitToggle" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Reverse zoom</span> <label class="switch-checkbox"> <input id="reverseZoom" type="checkbox"> <span></span> </label> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Menu</h2> </div> <div class="section-content one-row"> <div class="section-option"> <span class="section-option-title">Menu transparency</span> <label class="switch-checkbox"> <input id="menuTransparency" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <div class="content-double"> <button id="reset-settings" class="button red">Reset settings</button> <button id="download-settings" class="button">Download settings</button> <div class="form-upload"> <input id="upload-settings" type="file" accept=".txt"> <span class="light">DRAG SETTINGS FILE HERE OR <span class="light-extra">BROWSE</span></span> </div> </div> </div> </div> </div> </div>';
  1014. const Misc = Misc_code;
  1015. var Credits_code = '<div class="menu-page"> <h1>Credits</h1> <P>Some details about the script and links to my socials</P> <div class="section opened"> <div class="section-content" style="max-height:100%"> <div class="split-section"> <div class="section-option text"> <span class="section-option-title">Author</span> <span class="text-value">Murka</span> </div> <div class="section-option text"> <svg class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"> <path d="M512 12.672c-282.88 0-512 229.248-512 512 0 226.261 146.688 418.133 350.080 485.76 25.6 4.821 34.987-11.008 34.987-24.619 0-12.16-0.427-44.373-0.64-87.040-142.421 30.891-172.459-68.693-172.459-68.693-23.296-59.093-56.96-74.88-56.96-74.88-46.379-31.744 3.584-31.104 3.584-31.104 51.413 3.584 78.421 52.736 78.421 52.736 45.653 78.293 119.851 55.68 149.12 42.581 4.608-33.109 17.792-55.68 32.427-68.48-113.707-12.8-233.216-56.832-233.216-253.013 0-55.893 19.84-101.547 52.693-137.387-5.76-12.928-23.040-64.981 4.48-135.509 0 0 42.88-13.739 140.8 52.48 40.96-11.392 84.48-17.024 128-17.28 43.52 0.256 87.040 5.888 128 17.28 97.28-66.219 140.16-52.48 140.16-52.48 27.52 70.528 10.24 122.581 5.12 135.509 32.64 35.84 52.48 81.493 52.48 137.387 0 196.693-119.68 240-233.6 252.587 17.92 15.36 34.56 46.763 34.56 94.72 0 68.523-0.64 123.563-0.64 140.203 0 13.44 8.96 29.44 35.2 24.32 204.843-67.157 351.403-259.157 351.403-485.077 0-282.752-229.248-512-512-512z"></path> </svg> <a href="https://github.com/Murka007/Dsync-client" class="text-value" target="_blank" title="Give a star please :)">Dsync client</a> </div> <div class="section-option text"> <svg class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> <path d="M26.963 0c1.875 0 3.387 1.516 3.476 3.3v28.7l-3.569-3.031-1.96-1.784-2.139-1.864 0.893 2.94h-18.717c-1.869 0-3.387-1.42-3.387-3.301v-21.653c0-1.784 1.52-3.303 3.393-3.303h22zM18.805 7.577h-0.040l-0.269 0.267c2.764 0.8 4.101 2.049 4.101 2.049-1.781-0.891-3.387-1.336-4.992-1.516-1.16-0.18-2.32-0.085-3.3 0h-0.267c-0.627 0-1.96 0.267-3.747 0.98-0.623 0.271-0.98 0.448-0.98 0.448s1.336-1.336 4.28-2.049l-0.18-0.18c0 0-2.229-0.085-4.636 1.693 0 0-2.407 4.192-2.407 9.36 0 0 1.333 2.32 4.991 2.408 0 0 0.533-0.711 1.073-1.336-2.053-0.624-2.853-1.872-2.853-1.872s0.179 0.088 0.447 0.267h0.080c0.040 0 0.059 0.020 0.080 0.040v0.008c0.021 0.021 0.040 0.040 0.080 0.040 0.44 0.181 0.88 0.36 1.24 0.533 0.621 0.269 1.42 0.537 2.4 0.715 1.24 0.18 2.661 0.267 4.28 0 0.8-0.18 1.6-0.356 2.4-0.713 0.52-0.267 1.16-0.533 1.863-0.983 0 0-0.8 1.248-2.94 1.872 0.44 0.621 1.060 1.333 1.060 1.333 3.659-0.080 5.080-2.4 5.16-2.301 0-5.16-2.42-9.36-2.42-9.36-2.18-1.619-4.22-1.68-4.58-1.68zM19.029 13.461c0.937 0 1.693 0.8 1.693 1.78 0 0.987-0.76 1.787-1.693 1.787s-1.693-0.8-1.693-1.779c0.003-0.987 0.764-1.784 1.693-1.788zM12.972 13.461c0.933 0 1.688 0.8 1.688 1.78 0 0.987-0.76 1.787-1.693 1.787s-1.693-0.8-1.693-1.779c0-0.987 0.76-1.784 1.699-1.788z"></path> </svg> <a href="https://discord.gg/sG9cyfGPj5" class="text-value" target="_blank" title="Join my discord server">Coding paradise</a> </div> <div class="section-option text"> <svg class="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 96 96"> <circle fill="#36363d" stroke="#6a6a81" stroke-width="2" r="48" cy="48" cx="48"/> <clipPath id="GreasyForkCircleClip" clipPathUnits="userSpaceOnUse"> <circle fill="#000" r="47" cy="48" cx="48"/> </clipPath> <text fill="#9494b8" clip-path="url(#GreasyForkCircleClip)" text-anchor="middle" font-size="18" font-family="\'DejaVu Sans\', Verdana, Arial, \'Liberation Sans\', sans-serif" letter-spacing="-0.75" pointer-events="none" style="-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none"> <tspan x="51" y="13" textLength="57">= null;</tspan> <tspan x="56" y="35" textLength="98">function init</tspan> <tspan x="49" y="57" textLength="113">for (var i = 0;</tspan> <tspan x="50" y="79" textLength="105">XmlHttpReq</tspan> <tspan x="48" y="101" textLength="80">appendCh</tspan> </text> <path fill="#36363d" stroke="#36363d" stroke-width="4" d="M 44,29\r\n a6.36396,6.36396 0,0,1 0,9\r\n l36,36\r\n a3.25,3.25 0,0,1 -6.5,6.5\r\n l-36,-36\r\n a6.36396,6.36396 0,0,1 -9,0\r\n l-19,-19\r\n a1.76777,1.76777 0,0,1 0,-2.5\r\n l13.0,-13\r\n a1.76777,1.76777 0,0,1 2.5,0\r\n z"/> <path fill="#9494b8" d="M 44,29\r\n a6.36396,6.36396 0,0,1 0,9\r\n l36,36\r\n a3.25,3.25 0,0,1 -6.5,6.5\r\n l-36,-36\r\n a6.36396,6.36396 0,0,1 -9,0\r\n l-19,-19\r\n a1.76777,1.76777 0,0,1 2.5,-2.5\r\n l14,14 4,-4 -14,-14\r\n a1.76777,1.76777 0,0,1 2.5,-2.5\r\n l14,14 4,-4 -14,-14\r\n a1.76777,1.76777 0,0,1 2.5,-2.5\r\n z"/> </svg> <a href="https://greasyfork.org/en/users/919633" class="text-value" target="_blank" title="Please support this script on greasyfork">Dsync client</a> </div> </div> </div> </div> </div>';
  1016. const Credits = Credits_code;
  1017. const styles = '@import"https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap";header{background:#2f2f31;color:#76689a;padding:5px 10px;display:flex;justify-content:flex-start;align-items:center}header #version{align-self:flex-end;color:#9787bd;font-size:.5em;font-weight:600;margin-left:10px}header #version svg{fill:#9787bd}header .icon{margin-left:auto;width:35px;height:35px;fill:#cebcb4;transition:fill 100ms;cursor:pointer}header .icon:hover{fill:#ffe7dc}#navbar-container{display:flex;flex-direction:column;padding:10px;margin-right:10px;background:#2f2f31}#navbar-container .open-menu{outline:none;border:none;cursor:pointer;font-weight:900;font-size:1.4rem;padding:10px;background:#313135;color:#ffe7dc;border-right:1px solid;border-right-color:rgba(0,0,0,0);transition:background 100ms,color 100ms,border-right-color 100ms}#navbar-container .open-menu:hover{background:#313135}#navbar-container .open-menu:active{background:#ffe7dc;color:#313135}#navbar-container .open-menu.active{pointer-events:none;background:#313135;border-right-color:#ffe7dc}#navbar-container .bottom-align{margin-bottom:0px;margin-top:auto !important}@-webkit-keyframes appear{from{opacity:0}to{opacity:1}}@-webkit-keyframes disappear{from{opacity:1}to{opacity:0}}@-webkit-keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}@keyframes appear{from{opacity:0}to{opacity:1}}@keyframes disappear{from{opacity:1}to{opacity:0}}@keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}.menu-page{display:none;background:#2f2f31;padding:10px;padding-top:0px}.menu-page.opened{display:block;animation:appear 300ms forwards}.menu-page h1{color:#76689a;font-size:1.5em;font-weight:900}.menu-page h2{color:#9494b8;font-size:1em;font-weight:900}.menu-page p{color:#675a86;font-size:.5em;font-weight:700}.menu-page .content{display:flex;justify-content:space-between;align-items:center;gap:10px}.menu-page .content-double{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;width:250px}.menu-page .content-double button{width:48%}.menu-page .content-double:nth-child(3){width:100%}.menu-page #killMessage{width:270px}.menu-page .highlight{font-weight:700;color:#ffe7dc;background:#6a6a81;padding:0 1px}.menu-page .section{background:#36363d;border-radius:5px;margin:20px 0}.menu-page .section:last-child{margin-bottom:0px}.menu-page .section .section-title{display:flex;justify-content:space-between;align-items:center;padding:10px}.menu-page .section .section-title .icon{width:25px;height:25px;margin-right:10px;fill:#cebcb4;transition:fill 100ms,transform 100ms}.menu-page .section .section-title .icon.rotate{transform:rotate(90deg);fill:#ffe7dc}.menu-page .section .section-title:hover .icon{fill:#ffe7dc}.menu-page .section:not(.opened) .section-title{cursor:pointer}.menu-page .section:not(.opened) .section-content{overflow:hidden}.menu-page .section .section-content{padding:10px;padding-top:0px;display:grid;grid-template-columns:1fr 1fr;transition:max-height 250ms cubic-bezier(0, 1, 0, 1);max-height:0px}.menu-page .section .section-content.one-row{grid-template-columns:1fr}.menu-page .section .section-content.opened{transition:max-height 250ms ease-out;max-height:100%}.menu-page .section .section-content .split{grid-column:1/3;margin-top:10px;background:#40404a;height:2px}.menu-page .section .section-content .section-option{display:flex;justify-content:space-between;align-items:center;margin-top:10px}.menu-page .section .section-content .section-option .icon{width:35px;height:35px;fill:#6a6a81}.menu-page .section .section-content .section-option.centered{justify-content:center}.menu-page .section .section-content .section-option.text{justify-content:flex-start;gap:10px}.menu-page .section .section-content .section-option.text .text-value{font-size:.7em;color:#9494b8}.menu-page .section .section-content .section-option .section-option-title{color:#6a6a81;font-size:.8em}.menu-page .section .section-content .section-option .section-option-hotkeyInput{margin-right:50px;cursor:pointer;font-weight:900;font-size:.6em;padding-bottom:8px;outline:none;border:none;text-align:center;width:80px;height:35px;border-radius:7.5px;background:#7d7d9b;color:#adbcd8;box-shadow:0px -6px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .section-option-hotkeyInput.red{background:#9e5454;color:#d8adad;box-shadow:0px -6px 0px 0px #783d3d inset}.menu-page .section .section-content .section-option .section-option-hotkeyInput:not([id]){cursor:not-allowed}.menu-page .section .section-content .section-option .section-option-hotkeyInput.smaller{font-size:.41em}.menu-page .section .section-content .section-option .switch-checkbox{position:relative;margin-right:25px;width:70px;height:25px}.menu-page .section .section-content .section-option .switch-checkbox input{width:0;height:0;opacity:0}.menu-page .section .section-content .section-option .switch-checkbox input:checked+span{background:#7d7d9b;box-shadow:0px 5px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .switch-checkbox input:checked+span:before{background:#ffe7dc;transform:translateX(42px)}.menu-page .section .section-content .section-option .switch-checkbox span{position:absolute;cursor:pointer;top:0;left:0;bottom:0;right:0;width:100%;height:100%;display:flex;align-items:center;background:#5f5f79;box-shadow:0px 5px 0px 0px #4d4d5f inset;border-radius:10px;transition:all 100ms ease-in-out}.menu-page .section .section-content .section-option .switch-checkbox span:before{position:absolute;content:"";width:28px;height:28px;border-radius:50%;background:#f0dcd3;box-shadow:0px -5px 0px 0px #cebcb4 inset;border:2px solid #adbcd8;transition:all 100ms ease-in-out}.menu-page .section .section-content .section-option .slider{position:relative;margin-right:45px}.menu-page .section .section-content .section-option .slider input{-webkit-appearance:none;outline:none;cursor:pointer;width:154px;height:20.8333333333px;border-radius:10px;background:#7d7d9b;box-shadow:0px 5px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .slider input::-webkit-slider-thumb{-webkit-appearance:none;width:28px;height:28px;border-radius:50%;background:#ffe7dc;box-shadow:0px -5px 0px 0px #cebcb4 inset;border:2px solid #adbcd8}.menu-page .section .section-content .section-option .slider .slider-value{position:absolute;margin-left:5px;color:#6a6a81;font-size:.65em}.menu-page .section .section-content .section-option .input{outline:none;border:none;font-weight:900;text-align:center;width:130px;height:35px;padding-bottom:6px;border-radius:7.5px;background:#7d7d9b;color:#adbcd8;box-shadow:0px -6px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .input:focus{border:3px solid #f0dcd3}.menu-page .section .section-content .section-option .button{outline:none;border:none;font-weight:900;cursor:pointer;height:40px;padding-bottom:6px;border-radius:7.5px;background:#7d7d9b;color:#adbcd8;box-shadow:0px -6px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .button:active{padding-bottom:0px;padding-top:3px;box-shadow:0px 3px 0px 0px #68687c inset}.menu-page .section .section-content .section-option .button.red{background:#9e5454;color:#d8adad;box-shadow:0px -6px 0px 0px #783d3d inset}.menu-page .section .section-content .section-option .button.red:active{box-shadow:0px 3px 0px 0px #783d3d inset}.menu-page .section .section-content .section-option .button.width{width:9em;font-size:.6em}.menu-page .section .section-content .section-option .form-upload{position:relative;font-size:.55em;font-weight:400;letter-spacing:1.5px;text-align:center;width:100%;border-radius:5px;border:2px dashed;border-color:rgba(173,188,216,.5411764706);padding:15px 10px;transition:border-color 100ms}.menu-page .section .section-content .section-option .form-upload:hover{border-color:#adbcd8}.menu-page .section .section-content .section-option .form-upload.red{border-color:#9e5454;animation:failedTransition 400ms}.menu-page .section .section-content .section-option .form-upload.red .light{color:#d8adad}.menu-page .section .section-content .section-option .form-upload.green{border-color:#77c468}.menu-page .section .section-content .section-option .form-upload.green .light{color:#a1dda1}.menu-page .section .section-content .section-option .form-upload input{position:absolute;opacity:0;top:0;left:0;bottom:0;right:0;width:100%;height:100%;cursor:pointer}.menu-page .section .section-content .section-option .form-upload .light{color:#adbcd8}.menu-page .section .section-content .section-option .form-upload .light-extra{color:#f0dcd3}.menu-page .section .section-content .section-option .tooltip{position:relative;margin-left:5px;color:#8181a0}.menu-page .section .section-content .section-option .tooltip:hover{cursor:pointer}.menu-page .section .section-content .section-option .tooltip:hover .tooltip-text{visibility:visible}.menu-page .section .section-content .section-option .tooltip .tooltip-text{position:absolute;visibility:hidden;text-align:center;overflow:visible;bottom:calc(100% - 5px);left:50%;transform:translateX(-50%);background-color:#7d7d9b;color:#ffe7dc;width:225px;font-size:13px;font-weight:600;padding:5px;border-radius:5px;border:3px solid #5f5f79}.menu-page .section .section-content .section-option .tooltip .tooltip-text.left{text-align:left}@-webkit-keyframes appear{from{opacity:0}to{opacity:1}}@-webkit-keyframes disappear{from{opacity:1}to{opacity:0}}@-webkit-keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}@keyframes appear{from{opacity:0}to{opacity:1}}@keyframes disappear{from{opacity:1}to{opacity:0}}@keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}@-webkit-keyframes appear{from{opacity:0}to{opacity:1}}@-webkit-keyframes disappear{from{opacity:1}to{opacity:0}}@-webkit-keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}@keyframes appear{from{opacity:0}to{opacity:1}}@keyframes disappear{from{opacity:1}to{opacity:0}}@keyframes failedTransition{0%{transform:translate(0px, 0px)}10%{transform:translate(-35px, -10px)}30%{transform:translate(25px, 8px)}50%{transform:translate(-15px, -6px)}70%{transform:translate(5px, 4px)}100%{transform:translate(0px, 0px)}}html,body{margin:0;padding:0;background:rgba(0,0,0,0) !important;scrollbar-width:10px;scrollbar-track-color:#36363d;scrollbar-face-color:#494955}*{font-family:"Lato",sans-serif}h1,h2,h3,h4,p{margin:0}#menu-container{font-weight:900;font-size:2rem;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:1024px;height:700px;display:flex;justify-content:center;align-items:center;user-select:none}#menu-container.open{animation:appear 100ms forwards}#menu-container.close{animation:disappear 100ms forwards}#menu-container.transparent #menu-wrapper{background:rgba(43,43,44,.4666666667)}#menu-container.transparent #navbar-container{background:rgba(47,47,49,.6431372549)}#menu-container.transparent .menu-page{background:rgba(47,47,49,.6431372549)}#menu-container.transparent .section{background:rgba(54,54,61,.6509803922)}#menu-wrapper{display:flex;flex-direction:column;width:100%;height:80%;background:#2b2b2c;border-radius:5px;padding:10px}main{display:flex;justify-content:space-between;margin-top:10px;height:100%}main #menu-page-container{width:100%;height:500px;overflow-y:scroll}.default-color{outline:none;border:none;width:10px;height:10px;border-radius:100%;cursor:pointer}input[id][type=color]{outline:none;border:none;padding:0 1px;margin:0;height:24px;background-color:#7d7d9b;border-radius:5px;cursor:pointer}::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:#36363d;border-radius:10px}::-webkit-scrollbar-thumb{background:#494955;border-radius:10px}';
  1018. const createMenu = () => {
  1019. const IFRAME_CONTENT = `\n <style>${styles}</style>\n <div id="menu-container" class="open">\n <div id="menu-wrapper">\n ${Header}\n\n <main>\n ${Navbar}\n\n <div id="menu-page-container">\n ${Keybinds}\n ${Combat}\n ${Visuals}\n ${Misc}\n ${Credits}\n </div>\n </main>\n </div>\n </div>\n `;
  1020. const IFRAME_STYLE = `\n #iframe-page-container {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n z-index: 99;\n border: none;\n outline: none;\n overflow: scroll;\n display: none;\n }\n\n .iframe-opened {\n display: block!important;\n }\n `;
  1021. const IFRAME = document.createElement("iframe");
  1022. const blob = new Blob([ IFRAME_CONTENT ], {
  1023. type: "text/html; charset=utf-8"
  1024. });
  1025. IFRAME.src = URL.createObjectURL(blob);
  1026. IFRAME.id = "iframe-page-container";
  1027. document.body.appendChild(IFRAME);
  1028. const style = document.createElement("style");
  1029. style.innerHTML = IFRAME_STYLE;
  1030. document.head.appendChild(style);
  1031. IFRAME.onload = () => {
  1032. const iframeWindow = IFRAME.contentWindow;
  1033. const iframeDocument = iframeWindow.document;
  1034. URL.revokeObjectURL(IFRAME.src);
  1035. const menuContainer = iframeDocument.getElementById("menu-container");
  1036. const openMenu = iframeDocument.querySelectorAll(".open-menu");
  1037. const menuPage = iframeDocument.querySelectorAll(".menu-page");
  1038. const sections = iframeDocument.querySelectorAll(".section");
  1039. const hotkeyInputs = iframeDocument.querySelectorAll(".section-option-hotkeyInput[id]");
  1040. const closeMenu = iframeDocument.querySelector("#close-menu");
  1041. const checkboxs = iframeDocument.querySelectorAll("input[type='checkbox'][id]");
  1042. const sliders = iframeDocument.querySelectorAll("input[type='range'][id]");
  1043. const headerVersion = iframeDocument.querySelector("#version > span");
  1044. const autochatInputs = iframeDocument.querySelectorAll(".input.autochat");
  1045. const killMessage = iframeDocument.querySelector("#killMessage");
  1046. const resetSettings = iframeDocument.querySelector("#reset-settings");
  1047. const downloadSettings = iframeDocument.querySelector("#download-settings");
  1048. const uploadSettings = iframeDocument.querySelector("#upload-settings");
  1049. const menuTransparency = iframeDocument.querySelector("#menuTransparency");
  1050. const colorPickers = iframeDocument.querySelectorAll("input[type='color'][id]");
  1051. const update = () => {
  1052. for (const picker of colorPickers) {
  1053. const resetColor = picker.previousElementSibling;
  1054. if (resetColor) {
  1055. const defaultColor = defaultSettings[picker.id];
  1056. resetColor.style.backgroundColor = defaultColor;
  1057. resetColor.onclick = () => {
  1058. picker.value = defaultColor;
  1059. Settings[picker.id] = defaultColor;
  1060. storage.set("Dsync-settings", Settings);
  1061. };
  1062. }
  1063. picker.value = Settings[picker.id];
  1064. picker.onchange = () => {
  1065. Settings[picker.id] = picker.value;
  1066. storage.set("Dsync-settings", Settings);
  1067. picker.blur();
  1068. };
  1069. }
  1070. menuContainer.classList[Settings.menuTransparency ? "add" : "remove"]("transparent");
  1071. killMessage.value = Settings.killMessage;
  1072. killMessage.onchange = () => {
  1073. Settings.killMessage = killMessage.value;
  1074. storage.set("Dsync-settings", Settings);
  1075. killMessage.blur();
  1076. };
  1077. for (let i = 0; i < autochatInputs.length; i++) {
  1078. const input = autochatInputs[i];
  1079. input.value = Settings.autochatMessages[i] || "";
  1080. input.onchange = () => {
  1081. Settings.autochatMessages[i] = input.value;
  1082. storage.set("Dsync-settings", Settings);
  1083. input.blur();
  1084. };
  1085. }
  1086. headerVersion.textContent = "v" + Dsync.version;
  1087. for (const slider of sliders) {
  1088. const sliderValue = slider.nextElementSibling;
  1089. slider.value = Settings[slider.id];
  1090. if (sliderValue) {
  1091. sliderValue.textContent = slider.value;
  1092. }
  1093. slider.oninput = () => {
  1094. const value = Number(slider.value) % 5;
  1095. slider.value -= value;
  1096. if (sliderValue) {
  1097. sliderValue.textContent = slider.value;
  1098. }
  1099. Settings[slider.id] = Number(slider.value);
  1100. storage.set("Dsync-settings", Settings);
  1101. };
  1102. }
  1103. for (const checkbox of checkboxs) {
  1104. checkbox.checked = Settings[checkbox.id];
  1105. checkbox.onchange = () => {
  1106. Settings[checkbox.id] = checkbox.checked;
  1107. storage.set("Dsync-settings", Settings);
  1108. checkbox.blur();
  1109. };
  1110. }
  1111. Dsync.toggleMenu = () => {
  1112. menuContainer.classList.toggle("close");
  1113. menuContainer.classList.toggle("open");
  1114. setTimeout((() => {
  1115. IFRAME.classList.toggle("iframe-opened");
  1116. }), 100);
  1117. };
  1118. closeMenu.onclick = Dsync.toggleMenu;
  1119. for (let i = 0; i < openMenu.length; i++) {
  1120. openMenu[i].onclick = () => {
  1121. removeClass(openMenu, "active");
  1122. openMenu[i].classList.add("active");
  1123. removeClass(menuPage, "opened");
  1124. menuPage[i].classList.add("opened");
  1125. };
  1126. }
  1127. for (const section of sections) {
  1128. const title = section.children[0];
  1129. const content = section.children[1];
  1130. if (!title || !content) continue;
  1131. if (contains(section, "opened")) {
  1132. content.classList.add("opened");
  1133. continue;
  1134. }
  1135. content.style.display = "none";
  1136. title.onclick = () => {
  1137. if (!content.classList.contains("opened")) {
  1138. content.style.display = "grid";
  1139. } else {
  1140. setTimeout((() => {
  1141. content.style.display = "none";
  1142. }), 100);
  1143. }
  1144. setTimeout((() => {
  1145. content.classList.toggle("opened");
  1146. title.children[1].classList.toggle("rotate");
  1147. }), 0);
  1148. };
  1149. }
  1150. for (const hotkeyInput of hotkeyInputs) {
  1151. try {
  1152. hotkeyInput.textContent = formatCode(Settings[hotkeyInput.id]);
  1153. } catch (err) {
  1154. throw new Error(hotkeyInput.id + " doesn't exist in settings");
  1155. }
  1156. }
  1157. checkForRepeats();
  1158. };
  1159. menuTransparency.addEventListener("change", (() => {
  1160. menuContainer.classList[menuTransparency.checked ? "add" : "remove"]("transparent");
  1161. }));
  1162. resetSettings.onclick = () => {
  1163. Object.assign(Settings, defaultSettings);
  1164. storage.set("Dsync-settings", Settings);
  1165. update();
  1166. };
  1167. downloadSettings.onclick = () => {
  1168. download(Settings, "DsyncSettings" + Dsync.version);
  1169. };
  1170. uploadSettings.onchange = async event => {
  1171. const target = event.target;
  1172. const parent = uploadSettings.parentElement;
  1173. const spanText = parent.children[1];
  1174. parent.classList.remove("red");
  1175. parent.classList.remove("green");
  1176. try {
  1177. const text = await target.files[0].text();
  1178. const sets = JSON.parse(text);
  1179. if (Object.keys(sets).every((key => defaultSettings.hasOwnProperty(key)))) {
  1180. Object.assign(Settings, sets);
  1181. storage.set("Dsync-settings", Settings);
  1182. update();
  1183. parent.classList.add("green");
  1184. spanText.innerHTML = `SETTINGS LOADED SUCCESSFULLY`;
  1185. } else {
  1186. throw new Error("Invalid settings");
  1187. }
  1188. } catch (err) {
  1189. parent.classList.add("red");
  1190. spanText.innerHTML = "SETTINGS ARE NOT VALID, TRY ANOTHER";
  1191. }
  1192. };
  1193. const checkForRepeats = () => {
  1194. const list = new Map;
  1195. for (const hotkeyInput of hotkeyInputs) {
  1196. const value = Settings[hotkeyInput.id];
  1197. const [count, inputs] = list.get(value) || [ 0, [] ];
  1198. list.set(value, [ (count || 0) + 1, [ ...inputs, hotkeyInput ] ]);
  1199. hotkeyInput.classList.remove("red");
  1200. }
  1201. for (const data of list) {
  1202. const [number, hotkeyInputs] = data[1];
  1203. if (number === 1) continue;
  1204. for (const hotkeyInput of hotkeyInputs) {
  1205. hotkeyInput.classList.add("red");
  1206. }
  1207. }
  1208. };
  1209. Dsync.active = null;
  1210. const applyCode = code => {
  1211. if (!Dsync.active) return;
  1212. const key = code === "Backspace" ? "..." : formatCode(code);
  1213. Settings[Dsync.active.id] = code === "Backspace" ? "..." : code;
  1214. Dsync.active.textContent = key;
  1215. storage.set("Dsync-settings", Settings);
  1216. Dsync.active = null;
  1217. checkForRepeats();
  1218. };
  1219. menuContainer.addEventListener("keyup", (event => {
  1220. if (event.keyCode < 5 || !Dsync.active) return;
  1221. applyCode(event.code);
  1222. }));
  1223. menuContainer.addEventListener("mouseup", (event => {
  1224. const target = event.target;
  1225. if (Dsync.active) return applyCode(event.button);
  1226. if (!contains(target, "section-option-hotkeyInput") || !target.id) return;
  1227. target.textContent = "Wait...";
  1228. Dsync.active = target;
  1229. }));
  1230. iframeWindow.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  1231. iframeWindow.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  1232. const resize = () => {
  1233. const width = window.innerWidth;
  1234. const height = window.innerHeight;
  1235. const scale = Math.min(1, Math.min(width / 1024, height / 700));
  1236. menuContainer.style.transform = `translate(-50%, -50%) scale(${scale})`;
  1237. };
  1238. resize();
  1239. window.addEventListener("resize", resize);
  1240. setTimeout((() => IFRAME.classList.add("iframe-opened")), 0);
  1241. iframeWindow.addEventListener("contextmenu", (event => event.preventDefault()));
  1242. iframeWindow.addEventListener("mousedown", (event => 1 === event.button && event.preventDefault()));
  1243. iframeWindow.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1244. window.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1245. update();
  1246. };
  1247. };
  1248. const modules_createMenu = createMenu;
  1249. const ANY_LETTER = "(?:[^\\x00-\\x7F-]|\\$|\\w)";
  1250. const NumberSystem = [ {
  1251. radix: 2,
  1252. prefix: "0b0*"
  1253. }, {
  1254. radix: 8,
  1255. prefix: "0+"
  1256. }, {
  1257. radix: 10,
  1258. prefix: ""
  1259. }, {
  1260. radix: 16,
  1261. prefix: "0x0*"
  1262. } ];
  1263. var Template;
  1264. (function(Template) {
  1265. Template[Template["APPEND"] = 0] = "APPEND";
  1266. Template[Template["PREPEND"] = 1] = "PREPEND";
  1267. })(Template || (Template = {}));
  1268. class Regex {
  1269. constructor(code, unicode) {
  1270. this.code = code;
  1271. this.COPY_CODE = code;
  1272. this.unicode = unicode || false;
  1273. this.hooks = {};
  1274. }
  1275. static parseValue(value) {
  1276. try {
  1277. return Function(`return (${value})`)();
  1278. } catch (err) {
  1279. return null;
  1280. }
  1281. }
  1282. isRegexp(value) {
  1283. return TYPEOF(value) === "regexp";
  1284. }
  1285. generateNumberSystem(int) {
  1286. const copy = [ ...NumberSystem ];
  1287. const template = copy.map((({prefix, radix}) => prefix + int.toString(radix)));
  1288. return `(?:${template.join("|")})`;
  1289. }
  1290. parseVariables(regex) {
  1291. regex = regex.replace(/\{VAR\}/g, "(?:let|var|const)");
  1292. regex = regex.replace(/\{QUOTE\}/g, "['\"`]");
  1293. regex = regex.replace(/ARGS\{(\d+)\}/g, ((...args) => {
  1294. let count = Number(args[1]), arr = [];
  1295. while (count--) arr.push("\\w+");
  1296. return arr.join("\\s*,\\s*");
  1297. }));
  1298. regex = regex.replace(/NUMBER\{(\d+)\}/g, ((...args) => {
  1299. const int = Number(args[1]);
  1300. return this.generateNumberSystem(int);
  1301. }));
  1302. return regex;
  1303. }
  1304. format(name, inputRegex, flags) {
  1305. let regex = null;
  1306. if (Array.isArray(inputRegex)) {
  1307. regex = inputRegex.map((exp => this.isRegexp(exp) ? exp.source : exp)).join("\\s*");
  1308. } else if (this.isRegexp(inputRegex)) {
  1309. regex = inputRegex.source;
  1310. }
  1311. regex = this.parseVariables(regex);
  1312. if (this.unicode) {
  1313. regex = regex.replace(/\\w/g, ANY_LETTER);
  1314. }
  1315. const expression = new RegExp(regex.replace(/\{INSERT\}/, ""), flags);
  1316. const match = this.code.match(expression);
  1317. if (match === null) throw new Error("Failed to find: " + name);
  1318. return regex.includes("{INSERT}") ? new RegExp(regex, flags) : expression;
  1319. }
  1320. template(type, name, regex, substr) {
  1321. const expression = new RegExp(`(${this.format(name, regex).source})`);
  1322. this.code = this.code.replace(expression, type === Template.APPEND ? "$1" + substr : substr + "$1");
  1323. }
  1324. match(name, regex, flags, debug = false) {
  1325. const expression = this.format(name, regex, flags);
  1326. const match = this.code.match(expression);
  1327. this.hooks[name] = {
  1328. expression,
  1329. match
  1330. };
  1331. if (debug) log(name, this.hooks[name]);
  1332. return match;
  1333. }
  1334. matchAll(name, regex, flags, debug = false) {
  1335. const expression = this.format(name, regex, flags);
  1336. const matches = this.code.matchAll(expression);
  1337. this.hooks[name] = {
  1338. expression,
  1339. match: [ ...matches ]
  1340. };
  1341. if (debug) log(name, this.hooks[name]);
  1342. return matches;
  1343. }
  1344. replace(name, regex, substr, flags) {
  1345. const expression = this.format(name, regex, flags);
  1346. this.code = this.code.replace(expression, substr);
  1347. }
  1348. append(name, regex, substr) {
  1349. this.template(Template.APPEND, name, regex, substr);
  1350. }
  1351. prepend(name, regex, substr) {
  1352. this.template(Template.PREPEND, name, regex, substr);
  1353. }
  1354. insert(name, regex, substr) {
  1355. const {source} = this.format(name, regex);
  1356. if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
  1357. const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
  1358. this.code = this.code.replace(findExpression, `$1${substr}$2`);
  1359. }
  1360. }
  1361. const modules_Regex = Regex;
  1362. let kills = 0;
  1363. const stringMessage = data => {
  1364. const [id] = data;
  1365. if (id === WebsocketString.SPAWN && Settings.lastHat) {
  1366. equipHat(Dsync.actualHat, true);
  1367. }
  1368. if (id === WebsocketString.DIED) {
  1369. Controller_reset();
  1370. kills = 0;
  1371. if (Settings.autospawn) {
  1372. spawn();
  1373. }
  1374. }
  1375. if (id === WebsocketString.KILLUPDATE) {
  1376. kills = data[1][0];
  1377. }
  1378. if (Settings.kill && id === WebsocketString.KILLED) {
  1379. const killMessage = Settings.killMessage.length ? Settings.killMessage : "{KILL}x";
  1380. const name = data[1].replace(/^Killed\s/, "").trim();
  1381. const message = killMessage.replace(/\{KILL\}/g, kills + "").replace(/\{NAME\}/g, name);
  1382. Dsync.chat(message);
  1383. }
  1384. };
  1385. const hooks_stringMessage = stringMessage;
  1386. const drawItemBar = (ctx, imageData, index) => {
  1387. if (!Settings.itemCounter) return;
  1388. const itemId = itemBar(index);
  1389. const itemType = Dsync.itemData[itemId][Dsync.props.itemType];
  1390. const currentCount = Dsync.defaultData[Dsync.props.currentCount][itemType];
  1391. const maxCount = Dsync.maxCount[itemType];
  1392. if (maxCount === 0) return;
  1393. const x = imageData[Dsync.props.x] - 10;
  1394. const y = imageData[Dsync.props.y] + 10;
  1395. const w = imageData.width;
  1396. renderText(ctx, `${currentCount}/${maxCount}`, ((width, height) => [ x + w - width, y ]), {
  1397. font: "bold 16px Montserrat"
  1398. });
  1399. };
  1400. const hooks_drawItemBar = drawItemBar;
  1401. const drawEntityInfo = (target, ctx, isTeammate) => {
  1402. const entity = formatEntity(target);
  1403. const id = Dsync.myPlayerID();
  1404. if (id === entity.id) {
  1405. if (Settings.rainbow) {
  1406. Dsync.hsl = (Dsync.hsl + .3) % 360;
  1407. }
  1408. if (Dsync.aimTarget) {
  1409. const aimTarget = formatEntity(Dsync.aimTarget);
  1410. Dsync.target[Dsync.props.angle] = getAngle(aimTarget, entity).lerpAngle;
  1411. }
  1412. }
  1413. drawHealth(ctx, entity);
  1414. if (target.oldId) {
  1415. if (Settings.hatReloadBar && entity.type === 0) {
  1416. drawBar(ctx, entity, target.hatReload, 1300, Settings.hatReloadBarColor);
  1417. }
  1418. if (Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  1419. drawBar(ctx, entity, target.fireballReload, 3e3, Settings.fireballReloadBarColor);
  1420. }
  1421. }
  1422. if (Settings.drawID && entity.type === 0) {
  1423. const front = utils_Images.gaugeFront;
  1424. const w = front.width * .5;
  1425. const h = front.height * .5;
  1426. renderText(ctx, entity.id.toString(), ((width, height) => [ entity.x + w / 2 + 5, entity.y - h + (entity.radius + 50) + 5 ]), {
  1427. font: "bold 14px Montserrat",
  1428. textBaseline: "top"
  1429. });
  1430. }
  1431. if (id === entity.id || Dsync.myPlayer === null) return;
  1432. if (Settings.possibleShots && !isTeammate) {
  1433. const entityHit = projectileCanHitEntity(entity);
  1434. if (typeof entityHit === "object" && entityHit.canHit && !entityHit.needDestroy) {
  1435. const color = Settings.rainbow ? `hsl(${Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  1436. crosshair(ctx, entity.x, entity.y, entity.angle, color, 20, 8, 18);
  1437. }
  1438. }
  1439. if (Settings.enemyTracers && entity.type === 0 && !isTeammate || Settings.teammateTracers && entity.type === 0 && isTeammate || Settings.animalTracers && entity.type !== 0) {
  1440. drawTracers(ctx, entity, isTeammate);
  1441. }
  1442. };
  1443. const hooks_drawEntityInfo = drawEntityInfo;
  1444. const zoomHandler = () => {
  1445. let canZoom = true;
  1446. let wheels = 0;
  1447. const scaleFactor = 150;
  1448. const zoomLoop = () => {
  1449. const {w, h, w2, h2} = Dsync.scale;
  1450. const wx = Math.abs(w[0] - w2);
  1451. const hy = Math.abs(h[0] - h2);
  1452. if (wx < 3 || hy < 3) {
  1453. canZoom = true;
  1454. return;
  1455. }
  1456. w[0] = lerp(w[0], w2, .175);
  1457. h[0] = lerp(h[0], h2, .175);
  1458. window.dispatchEvent(new Event("resize"));
  1459. setTimeout(zoomLoop, 0);
  1460. };
  1461. window.addEventListener("wheel", (event => {
  1462. if (!(event.target instanceof HTMLCanvasElement) || event.ctrlKey || event.shiftKey || event.altKey || isInput() || !inGame()) return;
  1463. const scale = Dsync.scale;
  1464. const {w, h, w2, h2} = scale;
  1465. if (w2 === 1824 && h2 === 1026 && (wheels = (wheels + 1) % 5) !== 0) return;
  1466. const zoom = !Settings.reverseZoom && event.deltaY > 0 || Settings.reverseZoom && event.deltaY < 0 ? -scaleFactor : scaleFactor;
  1467. scale.w2 = Math.max(924, w2 + zoom);
  1468. scale.h2 = Math.max(126, h2 + zoom);
  1469. if (Settings.smoothZoom) {
  1470. if (canZoom) {
  1471. canZoom = false;
  1472. zoomLoop();
  1473. }
  1474. return;
  1475. }
  1476. w[0] = scale.w2;
  1477. h[0] = scale.h2;
  1478. window.dispatchEvent(new Event("resize"));
  1479. }));
  1480. };
  1481. const modules_zoomHandler = zoomHandler;
  1482. const drawItems = (target, id, ctx, step) => {
  1483. const object = formatObject(target);
  1484. if (object.ownerID === 0) return;
  1485. if (Settings.turretReloadBar && object.type === ELayer.TURRET && target.turretReload !== undefined) {
  1486. drawBar(ctx, {
  1487. ...object,
  1488. x: 0,
  1489. y: 0
  1490. }, target.turretReload, 3e3, Settings.turretReloadBarColor);
  1491. }
  1492. const color = getMarkerColor(target, object.ownerID) || "red";
  1493. if (color === null) return;
  1494. marker(ctx, color);
  1495. windmillRotation(target);
  1496. };
  1497. const drawitems = drawItems;
  1498. let toggleClown = false;
  1499. let toggleScuba = false;
  1500. let playerHealth = 100;
  1501. const updatePlayer = target => {
  1502. const entity = formatEntity(target);
  1503. const player = formatPlayer(target);
  1504. if (entity.type === 0) {
  1505. if (player.id === Dsync.myPlayerID()) {
  1506. Dsync.myPlayer = {
  1507. ...Dsync.myPlayer,
  1508. ...player
  1509. };
  1510. if (Settings.skipUpgrades) {
  1511. const upgradeBar = Dsync.defaultData[Dsync.props.upgradeBar];
  1512. if (upgradeBar.length === 1) {
  1513. Dsync.upgradeItem(upgradeBar[0]);
  1514. }
  1515. }
  1516. const {x2, y2, angle2, health, maxHealth, isClown, hat, oldHat} = Dsync.myPlayer;
  1517. const inTornado = entityIn(Dsync.myPlayer, ELayer.TORNADO);
  1518. const diff = Math.abs(health - playerHealth);
  1519. const restore = Dsync.defaultData[Dsync.props.itemBar].includes(12) ? 35 : 20;
  1520. let times = 0;
  1521. if (Settings.autoheal && health < maxHealth - (inTornado ? restore - 5 : 10) && !isClown && (diff > 3 || diff === 0)) {
  1522. playerHealth = health;
  1523. times = Math.max(1, Math.ceil((maxHealth - health) / restore));
  1524. setTimeout((() => {
  1525. for (let i = 0; i <= times; i++) place(EItems.HEAL);
  1526. }), Settings.autohealDelay);
  1527. }
  1528. const inRiver = y2 > 8075 && y2 < 8925;
  1529. const notInRiver = !(y2 > 8e3 && y2 < 9e3);
  1530. if (Settings.autoScuba && inRiver && !toggleScuba) {
  1531. toggleScuba = true;
  1532. Dsync.myPlayer.oldHat = hat;
  1533. equipHat(EHats.SCUBA, false, false);
  1534. }
  1535. if (toggleScuba && notInRiver) {
  1536. equipHat(oldHat);
  1537. toggleScuba = false;
  1538. }
  1539. if (Settings.jungleOnClown && isClown && hat !== EHats.JUNGLE && !toggleClown) {
  1540. toggleClown = true;
  1541. Dsync.myPlayer.oldHat = fastBreaking ? fastBreakHat : hat;
  1542. equipHat(EHats.JUNGLE, false, false);
  1543. }
  1544. if (!isClown && toggleClown) {
  1545. equipHat(oldHat);
  1546. toggleClown = false;
  1547. }
  1548. if (Settings.autochat) autochat();
  1549. }
  1550. if (Settings.hatReloadBar) {
  1551. if (target.oldId !== player.id) {
  1552. target.oldId = player.id;
  1553. target.oldHat = player.hat;
  1554. target.hatReload = 1300;
  1555. }
  1556. if (target.oldHat !== player.hat) {
  1557. target.oldHat = player.hat;
  1558. target.hatReload = 0;
  1559. }
  1560. target.hatReload = Math.min(target.hatReload + Dsync.step, 1300);
  1561. }
  1562. } else {
  1563. if (Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  1564. const fireballs = Dsync.entityList()[ELayer.FIREBALL].map((object => {
  1565. const fireball = formatEntity(object);
  1566. return distance(entity, fireball).dist;
  1567. }));
  1568. const total = fireballs.reduce(((total, int) => total + int), 0);
  1569. const reload = 2900;
  1570. if (target.oldId !== entity.id) {
  1571. target.oldId = entity.id;
  1572. target.total = total;
  1573. target.fireballReload = reload;
  1574. }
  1575. if ((fireballs.length === 5 && total < 600 || fireballs.length === 1 && total < 100) && target.fireballReload === reload) {
  1576. target.total = total;
  1577. target.fireballReload = 0;
  1578. }
  1579. target.fireballReload = Math.min(target.fireballReload + Dsync.step, reload);
  1580. }
  1581. if (Settings.turretReloadBar && entity.type === ELayer.TURRET) {
  1582. const projectile = Dsync.entityList()[ELayer.PROJECTILE].find((object => {
  1583. const bullet = formatProjectile(object);
  1584. return bullet.ownerID === entity.ownerID && entity.angle2 === bullet.angle2;
  1585. }));
  1586. if (target.turretReload === undefined) {
  1587. target.turretReload = 3e3;
  1588. }
  1589. if (projectile) {
  1590. const bullet = formatProjectile(projectile);
  1591. if (bullet && target.bulletID !== bullet.id) {
  1592. target.bulletID = bullet.id;
  1593. target.turretReload = 0;
  1594. }
  1595. }
  1596. target.turretReload = Math.min(target.turretReload + Dsync.step, 3e3);
  1597. }
  1598. }
  1599. };
  1600. const hooks_updatePlayer = updatePlayer;
  1601. const renderLayers = (ctx, now) => {
  1602. const entities = Dsync.entityList();
  1603. for (let i = 0; i < Dsync.itemList.length; i++) {
  1604. const id = Dsync.itemList[i];
  1605. for (let j = 0; j < entities[id].length; j++) {
  1606. const target = entities[id][j];
  1607. const object = formatObject(target);
  1608. if (object.ownerID === 0) continue;
  1609. if (Settings.turretReloadBar && target.type === ELayer.TURRET && target.turretReload !== undefined) {
  1610. drawBar(ctx, object, target.turretReload, 3e3, Settings.turretReloadBarColor);
  1611. }
  1612. const color = getMarkerColor(target, object.ownerID);
  1613. if (color === null) continue;
  1614. ctx.save();
  1615. ctx.translate(object.x + target.dirX, object.y + target.dirY);
  1616. marker(ctx, color);
  1617. ctx.restore();
  1618. windmillRotation(target);
  1619. }
  1620. }
  1621. };
  1622. const hooks_renderLayers = renderLayers;
  1623. let start = Date.now();
  1624. const moveUpdate = () => {
  1625. const now = Date.now();
  1626. Dsync.step = now - start;
  1627. start = now;
  1628. };
  1629. const hooks_moveUpdate = moveUpdate;
  1630. const version = __webpack_require__(147).i8;
  1631. const log = console.log;
  1632. window.log = log;
  1633. window.Dsync = {
  1634. props: {},
  1635. hooks: {},
  1636. settings: Settings,
  1637. myPlayer: null,
  1638. target: null,
  1639. hsl: 0,
  1640. version,
  1641. actualHat: 0,
  1642. scale: {
  1643. w: linker(1824),
  1644. h: linker(1026),
  1645. w2: 1824,
  1646. h2: 1026
  1647. },
  1648. itemList: [],
  1649. mousemove: true,
  1650. aimTarget: null,
  1651. step: 0
  1652. };
  1653. const Dsync = window.Dsync;
  1654. storage["delete"]("_adIds");
  1655. window.eval = new Proxy(window.eval, {
  1656. apply(target, _this, args) {
  1657. const code = args[0];
  1658. if (code.length > 1e5) {
  1659. const Hook = new modules_Regex(code, true);
  1660. const sendFunction = (name, fname, content = "") => {
  1661. Hook.prepend(name, [ `function`, fname ], `Dsync.${name}=${fname};` + content);
  1662. };
  1663. window.COPY_CODE = Hook.COPY_CODE.match(/^\((.+)\)\(.+\);$/)[1];
  1664. Hook.append("EXTERNAL fix", [ /\(function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/ ], `EXTERNAL.__proto__.toString=()=>COPY_CODE;`);
  1665. Hook.replace("Debugger fix", [ /debugger/ ], ``, "g");
  1666. const selectItem = Hook.match("selectItem", [ /!/, /\w+/, /\[/, /\w+/, /\]/, /&&/, /(\w+)/, /\(/, /\d/, /\)/, /,/ ])[1];
  1667. sendFunction("selectItem", selectItem);
  1668. const equipHat = Hook.match("equipHat", [ /!/, /\w+/, /\)/, /return/, /;/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1669. sendFunction("equipHat", equipHat);
  1670. const chat = Hook.match("chat", [ /break/, /\}/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1671. sendFunction("chat", chat);
  1672. const [, attack, getAngle] = Hook.match("attack", [ /&&/, /(\w+)/, /\(/, /(\w+)/, /\(/, /\)/, /\)/, /,/ ]);
  1673. sendFunction("attack", attack);
  1674. sendFunction("getAngle", getAngle);
  1675. const stopAttack = Hook.match("stopAttack", [ /&&/, /(\w+)/, /\(/, /\)/, /,/ ])[1];
  1676. sendFunction("stopAttack", stopAttack);
  1677. const autoattack = Hook.match("autoattack", [ /,/, /(\w+)/, /\(/, /\w+/, /\)/, /\)/, /\)/ ])[1];
  1678. sendFunction("autoattack", autoattack);
  1679. const move = Hook.match("move", [ /&&/, /\(/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1680. sendFunction("move", move);
  1681. const createClan = Hook.match("createClan", [ /,/, /\w+/, /=>/, /\{/, /(\w+)/, /\(/, /\w+/ ])[1];
  1682. sendFunction("createClan", createClan);
  1683. const leaveClan = Hook.match("leaveClan", [ /=>/, /\{/, /(\w+)/, /\(/, /\)/, /\}/ ])[1];
  1684. sendFunction("leaveClan", leaveClan);
  1685. const kickUser = Hook.match("kickUser", [ /return/, /;/, /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /:/ ])[1];
  1686. sendFunction("kickUser", kickUser);
  1687. const joinClan = Hook.match("joinClan", [ /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /\}/, /\)/, /\}/, /\}/ ])[1];
  1688. sendFunction("joinClan", joinClan);
  1689. const changeAngle = Hook.match("changeAngle", [ /\w+/, /\(/, /\w+/, /\)/, /\}/, /function/, /\w+/, /\(/, /\w+/, /\)/, /\{/, /(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  1690. sendFunction("changeAngle", changeAngle);
  1691. const MoveByAngle = Hook.match("MoveByAngle", [ /\w+\s\s*of/, /\w+\..+?(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  1692. sendFunction("MoveByAngle", MoveByAngle);
  1693. Hook.append("mousedown", [ /&&/, /\w+/, /\>/, /\w+/, /\)/, /return/, /;/, `(.+?=`, /(\w+)/, `.+?),`, `!(\\w+`, /\(/, /\w+/, /,/, /\w+/, `\\)).+?`, /\}/ ], `Dsync.mousedown=($3)=>{$2;return $4;};`);
  1694. Hook.append("mouseup", [ /!\w+\.\w+/, /\)/, /return/, /;/, `(\\w+`, /=/, /(\w+).+?\w+/, /\(/, /\w+/, /,/, /\w+/, `\\))`, /\}/ ], `Dsync.mouseup=($3)=>{$2};`);
  1695. const [, toggleRotation, rotVar] = Hook.match("lockRotation", [ /\[/, /\w+/, /\]/, /&&/, /(\w+)/, /\(/, /!(\w+)/, /\)/, /,/ ]);
  1696. Hook.prepend("lockRotation", [ `function`, `${toggleRotation}` ], `Dsync.toggleRotation=()=>{${rotVar}=!${rotVar};};`);
  1697. const toggleChat = Hook.match("toggleChat", [ /return/, `(\\w+`, /&&/, /\w+/, /\(/, /!\[/, /\]/, /\)/, `,.+?),\\w+\\.` ])[1];
  1698. Hook.insert("toggleChat", [ /null/, /\}/, /\)/, /\)/, /;/, /{INSERT}/, /{VAR}/, /\w+/, /=/ ], `Dsync.toggleChat=()=>{${toggleChat}};`);
  1699. const [, selectByID, defaultData, itemBar] = Hook.match("selectByID", [ /(\w+)/, /\(/, /(\w+)\.(\w+)/, /\[/, /Number/ ]);
  1700. sendFunction("selectByID", selectByID, `Dsync.defaultData=${defaultData};`);
  1701. Dsync.props.itemBar = itemBar;
  1702. Hook.append("drawEntityInfo", [ /function/, /\w+/, /\(/, /ARGS{3}/, /\)/, /\{/, /{VAR}/, /\w+/, /=/, /\w+/, /\[/, /\w+/, /\(/, /\).+?\.5;/ ], "if(Dsync.hooks.drawEntityInfo){Dsync.hooks.drawEntityInfo(...arguments);}");
  1703. const [, x, x1, x2] = Hook.match("positionX", [ /\(\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /\+/, /\(\w+\.(\w+)/ ]);
  1704. Dsync.props.x = x;
  1705. Dsync.props.x1 = x1;
  1706. Dsync.props.x2 = x2;
  1707. const [, y, y1, y2] = Hook.match("positionY", [ /,\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /\+/, /\(\w+\.(\w+)/ ]);
  1708. Dsync.props.y = y;
  1709. Dsync.props.y1 = y1;
  1710. Dsync.props.y2 = y2;
  1711. const [, angle, angle1, angle2] = Hook.match("angle", [ /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+/, /,/, /\w+\.\w+/, /=/, /\w+/, /,/ ]);
  1712. Dsync.props.angle = angle;
  1713. Dsync.props.angle1 = angle1;
  1714. Dsync.props.angle2 = angle2;
  1715. const id = Hook.match("id", [ /-NUMBER{1}/, /!==/, /\w+\.(\w+)/, /&&/ ])[1];
  1716. Dsync.props.id = id;
  1717. const health = Hook.match("health", [ /(\w+)/, /\//, /NUMBER{255}/, /\*/ ])[1];
  1718. Dsync.props.health = health;
  1719. const maxHealth = Hook.match("maxHealth", [ /\w+/, /:/, /NUMBER{35}/, /,/, /(\w+)/, /:/, /NUMBER{100}/ ])[1];
  1720. Dsync.props.maxHealth = maxHealth;
  1721. const hat = Hook.match("hat", [ /\w+/, /\(/, /\)/, /\[/, /\w+/, /\./, /(\w+)/, /\]/, /;/, /if/ ])[1];
  1722. Dsync.props.hat = hat;
  1723. const playerValue = Hook.match("playerValue", [ /if/, /\(/, /!/, /\(/, /\w+/, /\./, /(\w+)/, /&/, /\w+/, /\(/, /\)/ ])[1];
  1724. Dsync.props.playerValue = playerValue;
  1725. const [, itemData, itemType] = Hook.match("itemType", [ /(\w+)/, /\(/, /\)/, /\[/, /\w+/, /\]/, /\./, /(\w+)/, /;/ ]);
  1726. Dsync.props.itemType = itemType;
  1727. const playerData = Hook.match("playerData", [ /\w+\.\w+/, /\(/, /(?!\d+)\w+/, /,/, /(?!arguments)(\w+)/, /\)/, /;/ ])[1];
  1728. Hook.prepend("myPlayerID", [ /function/, /\w+/, /\(/, /\)/, /\{/, /return/, /\w+/, /!==/, /(\w+)/ ], `Dsync.myPlayerID=()=>$2;Dsync.playerData=${playerData};`);
  1729. const entityList = Hook.match("entityList", [ /new/, /Map/, /,/, /(\w+)/, /=/, /\[/, /\]/, /;/ ])[1];
  1730. const [, entityData, entityRadius] = Hook.match("entityData", /(\w+)\(\)\[\w+\.\w+\]\.(\w+)/);
  1731. Hook.prepend("entityData", [ /function/, /\w+/, /\(/, /ARGS{2}/, /\)/, /\{/, /{VAR}/, /\w+/, /,/ ], `Dsync.entityData=${entityData}();Dsync.itemData=${itemData}();Dsync.entityList=()=>${entityList};`);
  1732. Dsync.props.radius = entityRadius;
  1733. Hook.insert("showHoods1", [ /\w+/, /\(/, /\)/, /\./, /\w+/, /{INSERT}/, /\)/, /continue/, /;/ ], `&&!Dsync.settings.showHoods`);
  1734. Hook.insert("showHoods2", [ /\w+\.\w+/, /===/, /\w+/, /{INSERT}/, /\)/, /\{/ ], `||Dsync.settings.showHoods`);
  1735. Hook.insert("websocketString", [ /;/, /{INSERT}/, /switch/, /\(/, /(\w+)/, /\[/, /NUMBER{0}/, /\]/, /\)/, /\{/ ], `if(Dsync.hooks.stringMessage){Dsync.hooks.stringMessage($3);}`);
  1736. Hook.replace("zoomWidth", [ /(\w+)/, /:/, /NUMBER{1824}/, /,/ ], "$1:Dsync.scale.w,");
  1737. Hook.replace("zoomHeight", [ /(\w+)/, /:/, /NUMBER{1026}/, /,/ ], "$1:Dsync.scale.h,");
  1738. Hook.append("itemCounter", [ /(\w+)/, /\]/, /,/, /(\w+)/, /\./, /\w+/, /\(/, /(\w+)/, /\)/, /,/ ], `(Dsync.hooks.drawItemBar&&Dsync.hooks.drawItemBar($4,$3,$2)),`);
  1739. Hook.append("maxCount", [ `(\\w+`, `\\.`, `\\w+)`, /=/, /\[/, /ARGS{11}/, /\]/, /,/ ], `Dsync.maxCount=$2;`);
  1740. const currentCount = Hook.match("currentCount", [ /(\w+)/, /:/, /\[/, /ARGS{11}/, /\]/, /,/ ])[1];
  1741. Dsync.props.currentCount = currentCount;
  1742. const [, upgradeItem, upgradeBar] = Hook.match("upgradeList", [ /&&/, /\(/, /(\w+)/, /\(/, /\w+/, /\./, /(\w+)/, /\[/, /\w+/, /\]/, /\),/ ]);
  1743. Dsync.props.upgradeBar = upgradeBar;
  1744. sendFunction("upgradeItem", upgradeItem);
  1745. Hook.replace("ping", [ `({VAR}`, /(\w+)/, /=/, /\w+/, /\[/, /NUMBER{1}/, /\]/, /\|/, /\w+/, /\[/, /NUMBER{2}/, /\]/, /<</, /NUMBER{8}/, `;)`, /(?!{VAR})(\w+)/ ], `$1Dsync.ping=$2;$3`);
  1746. const clan = Hook.match("clan", [ /===/, /\w+/, /\./, /(\w+)/, /\)/, /\)/ ])[1];
  1747. Dsync.props.clan = clan;
  1748. const itemOwner = Hook.match("itemOwner", [ /\!/, /\(/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
  1749. Dsync.props.itemOwner = itemOwner;
  1750. const byteLength = Hook.match("byteLength", [ /NUMBER{3}/, /;/, /\w+/, /</, /(\w+)/ ])[1];
  1751. Hook.append("JoinCreateClan", [ /,/, /\w+/, /=/, /(\w+)/, /\[/, /NUMBER{2}/, /\]/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(3,${byteLength})]);}`);
  1752. Hook.append("UpdateClanList", [ /(\w+)/, /\[/, /NUMBER{1}/, /\]/, /;/, /\w+/, /\(/, /\)/, /\./, /\w+/, /\(/, /\w+/, /\)/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(2,${byteLength})]);}`);
  1753. Hook.append("DeleteClan", [ /{QUOTE}none{QUOTE}/, /,/, /\w+/, /=/, /null/, /,/ ], `(Dsync.hooks.DeleteClan&&Dsync.hooks.DeleteClan()),`);
  1754. Hook.append("drawItem", [ /\)/, /;/, /const/, /\w+/, /=/, /\w+/, /\[/, /(?!\d+)\w+/, /\]/, /;.+?\)/, /,/ ], "(Dsync.settings.markersBottom&&Dsync.hooks.drawItems&&Dsync.hooks.drawItems(...arguments)),");
  1755. Hook.append("bounceProps", [ /(\w+)\.\w+/, /\+/, /(\w+)/, /,/, /\w+\.\w+/, /\+/, /(\w+)/, /\),/ ], `$2.dirX=$3,$2.dirY=$4,`);
  1756. const [, upgradeScythe, goldenCowID] = Hook.match("scythe", [ /\w+/, /&&/, /(\w+)/, /\(/, /(\w+)/, /\)/, /,/ ]);
  1757. sendFunction("upgradeScythe", upgradeScythe, `Dsync.goldenCowID=()=>${goldenCowID};`);
  1758. const itemDamage = Hook.match("itemDamage", [ /(\w+)/, /:/, /46\.5/, /,/ ])[1];
  1759. Dsync.props.itemDamage = itemDamage;
  1760. const itemDataType = Hook.match("itemDataType", [ /\w+/, /\./, /(\w+)/, /===/, /NUMBER{2}/ ])[1];
  1761. Dsync.props.itemDataType = itemDataType;
  1762. Hook.append("updatePlayer", [ /\(/, /ARGS{16}/, /\).+?/, /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/ ], `;if(Dsync.hooks.updatePlayer){Dsync.hooks.updatePlayer($2);}`);
  1763. Hook.append("createEntity", [ /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/, /;/, /break/, /;/, /default/, /:/, /break/, /\}/ ], `if (Dsync.myPlayerID() === $2[Dsync.props.id]){Dsync.target=$2;}`);
  1764. Hook.replace("renderLayers", [ `(function`, /\w+/, /\(/, /ARGS{2}/, /\)/, /\{/, /{VAR}/, /\w+/, /,/, /\w+/, /=.+?,/, /ARGS{2}/, `\\))`, /\}/ ], `$1;if(Dsync.itemList&&Dsync.hooks.renderLayers&&!Dsync.settings.markersBottom){Dsync.hooks.renderLayers(...arguments);}}`);
  1765. Hook.replace("mousemove", [ `(const`, /\w+/, /=/, /\w+/, /\(/, /\)/, /;.+?&&/, /\w+/, /\(/, /\w+/, `\\))` ], "if(Dsync.mousemove){$1}");
  1766. const renderLayer = Hook.match("renderLayer", [ /:/, /NUMBER{38}/, /,/, /(\w+)/, /:/, /\w+/, /\./, /\w+/, /,/ ])[1];
  1767. Dsync.props.renderLayer = renderLayer;
  1768. const currentItem = Hook.match("currentItem", [ /,/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
  1769. Dsync.props.currentItem = currentItem;
  1770. const rotSpeed = Hook.match("rotSpeed", [ /\+=/, /\w+/, /\./, /(\w+)/, /\*/, /\w+/, /\)/ ])[1];
  1771. Dsync.props.rotSpeed = rotSpeed;
  1772. Hook.append("moveUpdate", [ /const/, /\w+/, /=/, /\+/, /new/, /\w+/, /;/ ], `if(Dsync.hooks.moveUpdate){Dsync.hooks.moveUpdate();}`);
  1773. args[0] = Hook.code;
  1774. window.eval = target;
  1775. target.apply(_this, args);
  1776. load();
  1777. return;
  1778. }
  1779. return target.apply(_this, args);
  1780. }
  1781. });
  1782. const load = () => {
  1783. const canvas = document.querySelector("#game-canvas");
  1784. const gridToggle = document.querySelector("#grid-toggle");
  1785. const displayPingToggle = document.querySelector("#display-ping-toggle");
  1786. const itemMarkerToggle = document.querySelector("#native-helper-toggle");
  1787. const hat_menu_content = document.querySelector("#hat_menu_content");
  1788. if (gridToggle.checked) gridToggle.click();
  1789. if (!displayPingToggle.checked) displayPingToggle.click();
  1790. if (itemMarkerToggle.checked) itemMarkerToggle.click();
  1791. window.onkeydown = null;
  1792. window.onkeyup = null;
  1793. canvas.onmousedown = null;
  1794. canvas.onmouseup = null;
  1795. Dsync.hooks.stringMessage = hooks_stringMessage;
  1796. Dsync.hooks.updatePlayer = hooks_updatePlayer;
  1797. new MutationObserver((mutations => {
  1798. if (!inGame() || isInput()) return;
  1799. for (let i = 0; i < mutations.length; i++) {
  1800. if (mutations[i].target.textContent === "UNEQUIP") {
  1801. Dsync.actualHat = i + 1;
  1802. break;
  1803. }
  1804. }
  1805. })).observe(hat_menu_content, {
  1806. childList: true,
  1807. subtree: true
  1808. });
  1809. modules_createMenu();
  1810. window.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  1811. window.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  1812. canvas.addEventListener("mousedown", (event => handleKeydown(event, event.button)));
  1813. canvas.addEventListener("mouseup", (event => handleKeyup(event, event.button)));
  1814. Dsync.hooks.drawEntityInfo = hooks_drawEntityInfo;
  1815. Dsync.hooks.drawItemBar = hooks_drawItemBar;
  1816. Dsync.hooks.drawItems = drawitems;
  1817. Dsync.hooks.UpdateClanList = UpdateClanList;
  1818. Dsync.hooks.DeleteClan = DeleteClan;
  1819. Dsync.hooks.renderLayers = hooks_renderLayers;
  1820. Dsync.hooks.moveUpdate = hooks_moveUpdate;
  1821. Dsync.itemList = Dsync.itemData.filter((item => item[Dsync.props.itemDataType] === EItemTypes.PLACEABLE)).map((item => item[Dsync.props.renderLayer]));
  1822. modules_zoomHandler();
  1823. };
  1824. })();
  1825. }).toString() + `)();`)();