Dsync Client [Sploop.io]

The most advanced hack for sploop.io

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

  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.11
  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.11"
  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 PlacementType;
  181. (function(PlacementType) {
  182. PlacementType[PlacementType["DEFAULT"] = 0] = "DEFAULT";
  183. PlacementType[PlacementType["INVISIBLE"] = 1] = "INVISIBLE";
  184. PlacementType[PlacementType["HOLDING"] = 2] = "HOLDING";
  185. })(PlacementType || (PlacementType = {}));
  186. const selectData = {
  187. placementType: PlacementType
  188. };
  189. let teammates = [];
  190. const UpdateClanList = userList => {
  191. teammates = userList;
  192. };
  193. const DeleteClan = () => {
  194. teammates = [];
  195. };
  196. const storage = {
  197. get(key) {
  198. return JSON.parse(localStorage.getItem(key));
  199. },
  200. set(key, value) {
  201. localStorage.setItem(key, JSON.stringify(value));
  202. },
  203. delete(key) {
  204. localStorage.removeItem(key);
  205. }
  206. };
  207. const defaultSettings = {
  208. primary: "Digit1",
  209. secondary: "Digit2",
  210. heal: "KeyQ",
  211. wall: "Digit4",
  212. spike: "KeyV",
  213. windmill: "KeyN",
  214. trap: "KeyF",
  215. turret: "KeyH",
  216. tree: "KeyU",
  217. platform: "KeyT",
  218. spawn: "KeyJ",
  219. up: "KeyW",
  220. left: "KeyA",
  221. down: "KeyS",
  222. right: "KeyD",
  223. attack: 0,
  224. autoattack: "KeyE",
  225. lockRotation: "KeyX",
  226. openChat: "Enter",
  227. invisibleHit: 2,
  228. spikeInsta: "KeyR",
  229. toggleMenu: "Escape",
  230. fastBreak: "KeyZ",
  231. upgradeScythe: "...",
  232. unequip: "...",
  233. bush: "...",
  234. berserker: "...",
  235. jungle: "...",
  236. crystal: "...",
  237. spikegear: "...",
  238. immunity: 4,
  239. boost: 3,
  240. applehat: "...",
  241. scuba: "...",
  242. hood: "...",
  243. demolist: "...",
  244. placementType: PlacementType.INVISIBLE,
  245. placementSpeed: 1,
  246. autoheal: true,
  247. autohealDelay: 80,
  248. jungleOnClown: true,
  249. lastHat: true,
  250. autoScuba: true,
  251. meleeAim: true,
  252. bowAim: true,
  253. spikeInstaAim: true,
  254. enemyTracers: true,
  255. teammateTracers: true,
  256. animalTracers: true,
  257. enemyColor: "#cc5151",
  258. teammateColor: "#8ecc51",
  259. animalColor: "#518ccc",
  260. arrows: true,
  261. rainbow: false,
  262. drawHP: true,
  263. showHoods: true,
  264. itemCounter: true,
  265. drawID: false,
  266. visualAim: true,
  267. hideNicknames: false,
  268. itemMarkers: true,
  269. teammateMarkers: true,
  270. enemyMarkers: true,
  271. trapActivated: true,
  272. itemMarkersColor: "#8ecc51",
  273. teammateMarkersColor: "#cfbc5f",
  274. enemyMarkersColor: "#cc5151",
  275. trapActivatedColor: "#48b2b8",
  276. markersBottom: true,
  277. hatReloadBar: true,
  278. hatReloadBarColor: "#5155cc",
  279. fireballReloadBar: true,
  280. fireballReloadBarColor: "#cf7748",
  281. turretReloadBar: true,
  282. turretReloadBarColor: "#51cc80",
  283. windmillRotation: false,
  284. possibleShots: true,
  285. autochat: true,
  286. autochatMessages: [ "Dsync Client", "What is it?", "The most advanced hack for sploop!", "Download on greasyfork!" ],
  287. kill: true,
  288. killMessage: "{NAME}, you suck! {KILL}x",
  289. autospawn: false,
  290. smoothZoom: true,
  291. skipUpgrades: true,
  292. invisHitToggle: false,
  293. reverseZoom: false,
  294. autoScythe: true,
  295. menuTransparency: false
  296. };
  297. const settings = {
  298. ...defaultSettings,
  299. ...storage.get("Dsync-settings")
  300. };
  301. for (const key in settings) {
  302. if (!defaultSettings.hasOwnProperty(key)) {
  303. delete settings[key];
  304. }
  305. }
  306. storage.set("Dsync-settings", settings);
  307. const Settings = settings;
  308. const itemBar = index => Dsync.defaultData[Dsync.props.itemBar][index];
  309. const hasSecondary = () => {
  310. const item = Dsync.itemData[itemBar(1)];
  311. return item[Dsync.props.itemType] === EItems.SECONDARY;
  312. };
  313. const canShoot = () => {
  314. const item = Dsync.itemData[itemBar(1)];
  315. return item[Dsync.props.itemDataType] === EItemTypes.SHOOTING;
  316. };
  317. const hasItemByType = type => {
  318. const items = Dsync.defaultData[Dsync.props.itemBar];
  319. return items.some((id => Dsync.itemData[id][Dsync.props.itemType] === type));
  320. };
  321. const isStoneGold = () => {
  322. const item = Dsync.itemData[itemBar(0)];
  323. return [ 1, 2 ].includes(item[Dsync.props.weaponType]);
  324. };
  325. const upgradeScythe = () => {
  326. const goldenCowID = Dsync.goldenCowID();
  327. if (goldenCowID) {
  328. Dsync.upgradeScythe(goldenCowID);
  329. }
  330. };
  331. const getAnimals = () => {
  332. const list = Dsync.entityList();
  333. 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)));
  334. };
  335. const getEnemies = () => {
  336. const players = Dsync.entityList()[0];
  337. return players.map((player => formatEntity(player))).filter((({id, ownerID}) => {
  338. const isMyPlayer = id === Dsync.myPlayerID();
  339. const isTeammate = teammates.includes(ownerID);
  340. return !isMyPlayer && !isTeammate;
  341. }));
  342. };
  343. const getEntities = () => [ ...getEnemies(), ...getAnimals() ];
  344. const lineSegmentIntersectsCircle = (x1, y1, x2, y2, cx, cy, r) => {
  345. const xL = x2 - x1;
  346. const xC = x1 - cx;
  347. const yL = y2 - y1;
  348. const yC = y1 - cy;
  349. const a = xL * xL + yL * yL;
  350. const hB = xL * xC + yL * yC;
  351. const c = xC * xC + yC * yC - r * r;
  352. return hB * hB >= a * c && (-hB <= a || c + hB + hB + a <= 0) && (hB <= 0 || c <= 0);
  353. };
  354. const getNearestEntities = shoot => {
  355. const enemies = getEnemies().map((enemy => ({
  356. ...enemy,
  357. dir: getAngle(enemy, Dsync.myPlayer).angle,
  358. distance: distance(enemy, Dsync.myPlayer).dist
  359. }))).sort(((a, b) => a.distance - b.distance));
  360. if (shoot) {
  361. enemies.sort(((a, b) => {
  362. const hasShield1 = a.target[Dsync.props.currentItem] === EWeapons.SHIELD;
  363. const hasShield2 = b.target[Dsync.props.currentItem] === EWeapons.SHIELD;
  364. return hasShield1 ? 1 : hasShield2 ? -1 : 0;
  365. }));
  366. }
  367. const animals = getAnimals().map((enemy => ({
  368. ...enemy,
  369. dir: getAngle(enemy, Dsync.myPlayer).angle,
  370. distance: distance(enemy, Dsync.myPlayer).dist
  371. }))).sort(((a, b) => a.distance - b.distance));
  372. return [ ...enemies, ...animals ];
  373. };
  374. const entityIn = (entity, layer) => Dsync.entityList()[layer].some((target => {
  375. const object = formatObject(target);
  376. return distance(entity, object).dist < entity.radius + object.radius;
  377. }));
  378. const projectileCanHitEntity = entity => {
  379. if (!canShoot()) return false;
  380. const range = Dsync.itemData[itemBar(EItems.SECONDARY)].range;
  381. const enemy = {
  382. ...entity,
  383. dir: getAngle(entity, Dsync.myPlayer).angle,
  384. distance: distance(entity, Dsync.myPlayer).dist
  385. };
  386. const x1 = Dsync.myPlayer.x2;
  387. const y1 = Dsync.myPlayer.y2;
  388. const x2 = x1 + range * Math.cos(enemy.dir);
  389. const y2 = y1 + range * Math.sin(enemy.dir);
  390. const myPlayerOnPlatform = entityIn(Dsync.myPlayer, ELayer.PLATFORM);
  391. const entityInRoof = entityIn(entity, ELayer.ROOF);
  392. if (myPlayerOnPlatform && entityInRoof) return false;
  393. const layers = Dsync.entityList();
  394. for (const layer of LayerObjects) {
  395. if (myPlayerOnPlatform && !LayerExclude.includes(layer)) continue;
  396. for (const entity of layers[layer]) {
  397. const object = formatObject(entity);
  398. const dist = distance(object, Dsync.myPlayer).dist;
  399. if (dist > enemy.distance) continue;
  400. if (lineSegmentIntersectsCircle(x1, y1, x2, y2, object.x2, object.y2, object.radius)) {
  401. const objectData = Dsync.entityData[object.type];
  402. const maxHealth = objectData[Dsync.props.maxHealth];
  403. if (maxHealth === undefined) return false;
  404. return {
  405. canHit: true,
  406. needDestroy: true
  407. };
  408. }
  409. }
  410. }
  411. return {
  412. canHit: true,
  413. needDestroy: false
  414. };
  415. };
  416. const getNearestPossibleEnemy = index => {
  417. const range = Dsync.itemData[itemBar(index)].range;
  418. const shoot = canShoot() && index === 1;
  419. const enemies = getNearestEntities(shoot).filter((enemy => {
  420. const inDistance = enemy.distance < range + enemy.radius;
  421. if (shoot) {
  422. const entityHit = projectileCanHitEntity(enemy);
  423. return inDistance && typeof entityHit === "object" && entityHit.canHit;
  424. }
  425. return inDistance;
  426. }));
  427. if (shoot) {
  428. enemies.sort(((a, b) => {
  429. const canHitA = projectileCanHitEntity(a);
  430. const canHitB = projectileCanHitEntity(b);
  431. return canHitA.needDestroy ? 1 : canHitB.needDestroy ? -1 : 0;
  432. }));
  433. }
  434. return enemies.length ? enemies[0] : null;
  435. };
  436. const createImage = src => {
  437. const img = new Image;
  438. img.src = src;
  439. img.loaded = false;
  440. img.onload = () => {
  441. img.loaded = true;
  442. };
  443. return img;
  444. };
  445. const Images = {
  446. gaugeBackground: createImage("https://i.imgur.com/xincrX4.png"),
  447. gaugeFront: createImage("https://i.imgur.com/6AkHQM4.png")
  448. };
  449. const utils_Images = Images;
  450. const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
  451. const removeClass = (target, name) => {
  452. if (target instanceof HTMLElement) {
  453. target.classList.remove(name);
  454. return;
  455. }
  456. for (const element of target) {
  457. element.classList.remove(name);
  458. }
  459. };
  460. const formatCode = code => {
  461. code = code + "";
  462. if (code === "0") return "LBTN";
  463. if (code === "1") return "MBTN";
  464. if (code === "2") return "RBTN";
  465. if (code === "3") return "XBTN2";
  466. if (code === "4") return "XBTN1";
  467. if (code === "Escape") return "ESC";
  468. if (code === "BracketLeft") return "[";
  469. if (code === "BracketRight") return "]";
  470. if (code === "NumpadDivide") return "NUMDIV";
  471. if (code === "NumpadMultiply") return "NUMMULT";
  472. if (code === "NumpadSubtract") return "NUMSUB";
  473. if (code === "NumpadDecimal") return "NUMDEC";
  474. if (code === "CapsLock") return "CAPS";
  475. if (code === "PrintScreen") return "PRNT";
  476. if (code === "Backslash") return "\\";
  477. if (code === "Backquote") return "BQUOTE";
  478. if (code === "PageDown") return "PAGEDN";
  479. const NumpadDigitArrowKey = /^(?:Numpad|Digit|Arrow|Key)(\w+)$/;
  480. if (NumpadDigitArrowKey.test(code)) {
  481. code = code.replace(NumpadDigitArrowKey, "$1").replace(/Numpad/, "NUM");
  482. }
  483. const ExtraKeysRegex = /^(Control|Shift|Alt)(.).*/;
  484. if (ExtraKeysRegex.test(code)) {
  485. code = code.replace(ExtraKeysRegex, "$2$1").replace(/Control/, "CTRL");
  486. }
  487. return code.toUpperCase();
  488. };
  489. const contains = (target, name) => target.classList.contains(name);
  490. const isInput = target => {
  491. const element = target || document.activeElement;
  492. return [ "TEXTAREA", "INPUT" ].includes(element.tagName);
  493. };
  494. const inGame = () => {
  495. const homepage = document.querySelector("#homepage");
  496. return homepage && homepage.style.display === "none";
  497. };
  498. const formatData = object => ({
  499. id: object[Dsync.props.id],
  500. type: object.type,
  501. x: object[Dsync.props.x],
  502. y: object[Dsync.props.y],
  503. x1: object[Dsync.props.x1],
  504. y1: object[Dsync.props.y1],
  505. x2: object[Dsync.props.x2],
  506. y2: object[Dsync.props.y2],
  507. angle: object[Dsync.props.angle],
  508. angle1: object[Dsync.props.angle1],
  509. angle2: object[Dsync.props.angle2],
  510. ownerID: object[Dsync.props.itemOwner],
  511. target: object
  512. });
  513. const formatProjectile = object => {
  514. const data = formatData(object);
  515. return {
  516. ...data,
  517. range: object.range
  518. };
  519. };
  520. const formatObject = object => {
  521. const data = formatData(object);
  522. const entityData = Dsync.entityData[object.type];
  523. return {
  524. ...data,
  525. radius: entityData[Dsync.props.radius]
  526. };
  527. };
  528. const formatEntity = entity => {
  529. const object = formatObject(entity);
  530. const entityData = Dsync.entityData[entity.type];
  531. const healthValue = entity[Dsync.props.health];
  532. const maxHealth = entityData[Dsync.props.maxHealth];
  533. return {
  534. ...object,
  535. healthValue,
  536. health: Math.ceil(entity[Dsync.props.health] / 255 * maxHealth),
  537. maxHealth,
  538. playerValue: entity[Dsync.props.playerValue]
  539. };
  540. };
  541. const formatPlayer = entity => {
  542. const player = formatEntity(entity);
  543. return {
  544. ...player,
  545. hat: entity[Dsync.props.hat],
  546. isClown: player.playerValue === 128
  547. };
  548. };
  549. const getTracerColor = (entity, isTeammate) => {
  550. if (entity.id === Dsync.myPlayerID() || isTeammate) return Settings.teammateColor;
  551. if (entity.type === 0) return Settings.enemyColor;
  552. return Settings.animalColor;
  553. };
  554. const trapActive = object => {
  555. const trap = formatObject(object);
  556. return getEntities().some((entity => distance(entity, trap).dist < trap.radius + entity.radius - 25));
  557. };
  558. const getMarkerColor = (target, ownerID) => {
  559. let color = null;
  560. const isMyPlayers = (Dsync.myPlayer || {}).ownerID === ownerID;
  561. const isTeammates = teammates.includes(ownerID);
  562. const isTeammateTrap = target.type === 6 && (isMyPlayers || isTeammates);
  563. if (Settings.itemMarkers && isMyPlayers) {
  564. color = Settings.itemMarkersColor;
  565. } else if (Settings.teammateMarkers && isTeammates) {
  566. color = Settings.teammateMarkersColor;
  567. } else if (Settings.enemyMarkers && !isMyPlayers && !isTeammates) {
  568. color = Settings.enemyMarkersColor;
  569. }
  570. if (Settings.trapActivated && isTeammateTrap) {
  571. const id = target[Dsync.props.id];
  572. if (!target.active && trapActive(target)) {
  573. target.active = id;
  574. }
  575. if (target.active === id) return Settings.trapActivatedColor;
  576. target.active = null;
  577. }
  578. return color;
  579. };
  580. const marker = (ctx, color) => {
  581. ctx.strokeStyle = "#303030";
  582. ctx.lineWidth = 3;
  583. ctx.fillStyle = color;
  584. ctx.beginPath();
  585. ctx.arc(0, 0, 9, 0, 2 * Math.PI);
  586. ctx.fill();
  587. ctx.stroke();
  588. ctx.closePath();
  589. };
  590. const arrow = (ctx, len, x, y, angle, color) => {
  591. ctx.save();
  592. ctx.translate(x, y);
  593. ctx.rotate(Math.PI / 4);
  594. ctx.rotate(angle);
  595. ctx.globalAlpha = .75;
  596. ctx.strokeStyle = color;
  597. ctx.lineCap = "round";
  598. ctx.lineWidth = 8;
  599. ctx.beginPath();
  600. ctx.moveTo(-len, -len);
  601. ctx.lineTo(len, -len);
  602. ctx.lineTo(len, len);
  603. ctx.stroke();
  604. ctx.closePath();
  605. ctx.restore();
  606. };
  607. const lines = (ctx, x1, y1, x2, y2, color) => {
  608. ctx.save();
  609. ctx.globalAlpha = .75;
  610. ctx.strokeStyle = color;
  611. ctx.lineCap = "round";
  612. ctx.lineWidth = 5;
  613. ctx.beginPath();
  614. ctx.moveTo(x1, y1);
  615. ctx.lineTo(x2, y2);
  616. ctx.stroke();
  617. ctx.restore();
  618. };
  619. const Common_images = {};
  620. const crosshair = (ctx, x, y, angle, color, radius, width, height) => {
  621. const canvas = Common_images[color] || function() {
  622. const canvas = document.createElement("canvas");
  623. canvas.width = 256;
  624. canvas.height = 256;
  625. const ctx = canvas.getContext("2d");
  626. ctx.translate(canvas.width / 2, canvas.height / 2);
  627. ctx.strokeStyle = color;
  628. ctx.fillStyle = color;
  629. ctx.lineWidth = width / 1.5;
  630. ctx.beginPath();
  631. ctx.arc(0, 0, radius, 0, 2 * Math.PI);
  632. ctx.stroke();
  633. ctx.closePath();
  634. for (let i = 0; i < 4; i++) {
  635. ctx.beginPath();
  636. ctx.rect(-width / 2, radius - height / 2, width, height);
  637. ctx.fill();
  638. ctx.rotate(Math.PI / 2);
  639. ctx.closePath();
  640. }
  641. Common_images[color] = canvas;
  642. return canvas;
  643. }();
  644. ctx.save();
  645. ctx.translate(x, y);
  646. ctx.rotate(angle);
  647. ctx.globalAlpha = .75;
  648. ctx.drawImage(canvas, -canvas.width / 2, -canvas.height / 2);
  649. ctx.restore();
  650. };
  651. const drawImage = (ctx, image) => {
  652. ctx.drawImage(image, -.5 * image.width / 2, -.5 * image.height, image.width * .5, image.height * .5);
  653. };
  654. const drawBar = (ctx, entity, value, maxValue, color) => {
  655. const {x, y, radius} = entity;
  656. const background = utils_Images.gaugeBackground;
  657. const front = utils_Images.gaugeFront;
  658. const scale = .5;
  659. const width = front.width * scale;
  660. const fill = value / maxValue * (width - 10);
  661. const h = entity.type === ELayer.TURRET ? 25 : 50;
  662. ctx.save();
  663. if (Settings.markersBottom && entity.type === ELayer.TURRET) {
  664. ctx.rotate(Math.PI - entity.angle);
  665. ctx.rotate(Math.PI);
  666. }
  667. ctx.translate(x, y + radius + h + front.height * scale);
  668. drawImage(ctx, background);
  669. ctx.fillStyle = color;
  670. ctx.fillRect(-width / 2 + 5, -scale * front.height + 5, fill, scale * front.height - 10);
  671. drawImage(ctx, front);
  672. ctx.restore();
  673. };
  674. const drawHealth = (ctx, entity) => {
  675. if (!Settings.drawHP) return;
  676. const {x, y, health, maxHealth, radius} = entity;
  677. const front = utils_Images.gaugeFront;
  678. let h = 0;
  679. if (Settings.hatReloadBar && entity.type === 0 || Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  680. h = front.height * .5;
  681. }
  682. renderText(ctx, `HP ${health}/${maxHealth}`, ((width, height) => [ x - width / 2, y + radius + h + 55 ]));
  683. };
  684. const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
  685. const distance = (entity1, entity2) => {
  686. const entity1Has = "x" in entity1 && "y" in entity1;
  687. const entity2Has = "x" in entity2 && "y" in entity2;
  688. return {
  689. lerpDist: entity1Has && entity2Has ? dist(entity1.x, entity1.y, entity2.x, entity2.y) : null,
  690. dist: dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2)
  691. };
  692. };
  693. const getAngle = (entity1, entity2) => {
  694. const entity1Has = "x" in entity1 && "y" in entity1;
  695. const entity2Has = "x" in entity2 && "y" in entity2;
  696. return {
  697. lerpAngle: entity1Has && entity2Has ? Math.atan2(entity1.y - entity2.y, entity1.x - entity2.x) : null,
  698. angle: Math.atan2(entity1.y2 - entity2.y2, entity1.x2 - entity2.x2)
  699. };
  700. };
  701. const lerp = (start, stop, amt) => amt * (stop - start) + start;
  702. const drawTracers = (ctx, entity, isTeammate) => {
  703. const player = formatPlayer(Dsync.target);
  704. const {x: x1, y: y1} = player;
  705. const {x: x2, y: y2} = entity;
  706. const color = Settings.rainbow ? `hsl(${Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  707. if (Settings.arrows) {
  708. const arrowWidth = 8;
  709. const angle = getAngle(entity, player).lerpAngle;
  710. const dist = Math.min(100 + arrowWidth * 2, distance(entity, player).lerpDist - arrowWidth * 2);
  711. const x = x1 + dist * Math.cos(angle);
  712. const y = y1 + dist * Math.sin(angle);
  713. arrow(ctx, arrowWidth, x, y, angle, color);
  714. } else {
  715. lines(ctx, x1, y1, x2, y2, color);
  716. }
  717. };
  718. const TextOptions = {
  719. font: "bold 15px Montserrat",
  720. textBaseline: "top"
  721. };
  722. const renderText = (ctx, text, callback, options) => {
  723. ctx.save();
  724. ctx.fillStyle = "#fff";
  725. ctx.strokeStyle = "#303030";
  726. ctx.lineWidth = 8;
  727. ctx.lineJoin = "round";
  728. Object.assign(ctx, TextOptions, options);
  729. const width = ctx.measureText(text).width;
  730. const height = parseInt(ctx.font.match(/\d+/)[0]) || 1;
  731. const data = callback(width, height);
  732. ctx.strokeText(text, ...data);
  733. ctx.fillText(text, ...data);
  734. ctx.restore();
  735. };
  736. const windmillRotation = target => {
  737. if (target.type !== ELayer.WINDMILL && target.type !== ELayer.POWERMILL) return;
  738. if (!target.rotSpeed) {
  739. target.rotSpeed = target[Dsync.props.rotSpeed];
  740. }
  741. const rot = Settings.windmillRotation ? target.rotSpeed : 0;
  742. if (target[Dsync.props.rotSpeed] !== rot) {
  743. target[Dsync.props.rotSpeed] = rot;
  744. }
  745. };
  746. const sleep = ms => new Promise((resolve => setTimeout(resolve, ms)));
  747. const linker = value => {
  748. const hook = {
  749. 0: value,
  750. toString: radix => hook[0].toString(radix),
  751. valueOf: () => hook[0].valueOf()
  752. };
  753. return hook;
  754. };
  755. const download = (data, filename) => {
  756. const blob = new Blob([ JSON.stringify(data, null, 4) ], {
  757. type: "application/json "
  758. });
  759. const url = URL.createObjectURL(blob);
  760. const a = document.createElement("a");
  761. a.href = url;
  762. a.download = (filename || "settings") + ".txt";
  763. a.click();
  764. a.remove();
  765. URL.revokeObjectURL(url);
  766. };
  767. const capitalize = word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
  768. let move = 0;
  769. let attacking = false;
  770. let autoattack = false;
  771. let weapon = false;
  772. let isHealing = false;
  773. let attackingInvis = false;
  774. let toggleInvis = false;
  775. let currentItem = null;
  776. const hotkeys = new Map;
  777. const spawn = async () => {
  778. await sleep(100);
  779. const play = document.querySelector("#play");
  780. if (play) play.click();
  781. };
  782. let chatCount = 0;
  783. let chatToggle = false;
  784. const autochat = async () => {
  785. if (chatToggle || isInput() || !inGame()) return;
  786. chatToggle = true;
  787. const messages = Settings.autochatMessages.filter((msg => msg.length));
  788. if (!messages.length) return;
  789. Dsync.chat(messages[chatCount++]);
  790. chatCount %= messages.length;
  791. await sleep(2e3);
  792. chatToggle = false;
  793. };
  794. const Controller_reset = () => {
  795. move = 0;
  796. attacking = false;
  797. autoattack = false;
  798. weapon = false;
  799. isHealing = false;
  800. attackingInvis = false;
  801. toggleInvis = false;
  802. currentItem = null;
  803. for (const [key] of hotkeys) {
  804. hotkeys.delete(key);
  805. }
  806. };
  807. const equipHat = (id, ignore = false, actual = true) => {
  808. const hat = (Dsync.myPlayer || {}).hat || 0;
  809. if (id === 0) {
  810. id = hat;
  811. } else if (hat === id && !ignore) return;
  812. if (actual) {
  813. Dsync.actualHat = id;
  814. }
  815. Dsync.equipHat(id);
  816. Dsync.equipHat(id);
  817. };
  818. const whichWeapon = type => {
  819. if (type !== undefined) {
  820. weapon = type;
  821. }
  822. Dsync.selectByID(itemBar(Number(weapon)));
  823. };
  824. const attack = (angle = null) => {
  825. Dsync.attack(angle !== null ? angle : Dsync.getAngle());
  826. };
  827. const place = (id, angle = null) => {
  828. whichWeapon();
  829. if (attacking || autoattack) attack(angle);
  830. Dsync.selectItem(id);
  831. attack(angle);
  832. Dsync.stopAttack();
  833. if (Settings.placementType !== PlacementType.HOLDING) whichWeapon();
  834. };
  835. let count = 0;
  836. const placement = () => {
  837. if (currentItem === null) return;
  838. place(currentItem);
  839. count++;
  840. if ((count %= Settings.placementSpeed) === 0) {
  841. setTimeout(placement);
  842. } else {
  843. queueMicrotask(placement);
  844. }
  845. };
  846. const placementHandler = (type, code) => {
  847. if (!hasItemByType(type)) return;
  848. if (Settings.placementType === PlacementType.DEFAULT) {
  849. Dsync.selectItem(type);
  850. return;
  851. }
  852. hotkeys.set(code, type);
  853. currentItem = type;
  854. if (hotkeys.size === 1) {
  855. placement();
  856. }
  857. };
  858. const heal = () => {
  859. Dsync.selectItem(EItems.HEAL);
  860. attack();
  861. Dsync.stopAttack();
  862. whichWeapon();
  863. if (attacking) {
  864. attack();
  865. }
  866. };
  867. const healing = () => {
  868. if (!isHealing) return;
  869. heal();
  870. setTimeout(healing, 0);
  871. };
  872. const invisibleHit = () => {
  873. Dsync.mousemove = true;
  874. Dsync.aimTarget = null;
  875. if (Settings.invisHitToggle && !toggleInvis || !Settings.invisHitToggle && !attackingInvis) {
  876. toggleInvis = false;
  877. attackingInvis = false;
  878. return;
  879. }
  880. let angle = null;
  881. const enemy = getNearestPossibleEnemy(+!weapon);
  882. const shoot = canShoot() && !weapon;
  883. if (enemy && (Settings.meleeAim && !shoot || Settings.bowAim && shoot)) {
  884. angle = enemy.dir;
  885. Dsync.mousemove = false;
  886. Dsync.aimTarget = enemy.target;
  887. }
  888. if (enemy && shoot || !shoot) {
  889. whichWeapon(!weapon);
  890. attack(angle);
  891. Dsync.stopAttack();
  892. whichWeapon(!weapon);
  893. }
  894. setTimeout(invisibleHit, 75);
  895. };
  896. const spikeInsta = () => {
  897. let angle = null;
  898. if (Settings.spikeInstaAim) {
  899. const enemy = getNearestPossibleEnemy(0);
  900. if (enemy) {
  901. angle = enemy.dir;
  902. }
  903. }
  904. const oldWeapon = weapon;
  905. equipHat(EHats.BERSERKER);
  906. whichWeapon(false);
  907. place(EItems.SPIKE, angle);
  908. attack(angle);
  909. Dsync.stopAttack();
  910. whichWeapon(oldWeapon);
  911. };
  912. let fastBreakHat = 0;
  913. let oldWeapon = false;
  914. let fastBreaking = false;
  915. let startFastBreak = 0;
  916. const fastBreak = () => {
  917. if (fastBreaking) return;
  918. startFastBreak = Date.now();
  919. const primary = itemBar(0);
  920. const secondary = itemBar(1);
  921. const pickWeapon = hasSecondary() && !canShoot() && (secondary === EWeapons.HAMMER || primary === EWeapons.STICK);
  922. oldWeapon = weapon;
  923. fastBreaking = true;
  924. fastBreakHat = Dsync.myPlayer.hat;
  925. whichWeapon(pickWeapon);
  926. equipHat(EHats.DEMOLIST);
  927. attacking = true;
  928. attack();
  929. };
  930. const fastBreakStop = async () => {
  931. if (!fastBreaking) return;
  932. Dsync.stopAttack();
  933. attacking = false;
  934. whichWeapon(oldWeapon);
  935. const step = Date.now() - startFastBreak;
  936. if (step < 1300) await sleep(1300 - step);
  937. if (!Dsync.myPlayer.isClown) equipHat(fastBreakHat);
  938. fastBreaking = false;
  939. };
  940. const handleKeydown = (event, code) => {
  941. if (code === 1) event.preventDefault();
  942. if (event instanceof KeyboardEvent && event.repeat) return;
  943. if (Dsync.active) return;
  944. if (code === Settings.toggleMenu && !isInput(event.target)) {
  945. Dsync.toggleMenu();
  946. }
  947. if (!inGame()) return;
  948. if (code === Settings.openChat) {
  949. if (!isInput()) event.preventDefault();
  950. Dsync.toggleChat();
  951. }
  952. if (isInput(event.target)) return;
  953. if (code === Settings.primary) whichWeapon(false);
  954. if (code === Settings.secondary && hasSecondary()) whichWeapon(true);
  955. if (code === Settings.heal) {
  956. isHealing = true;
  957. healing();
  958. }
  959. if (code === Settings.wall) placementHandler(EItems.WALL, code);
  960. if (code === Settings.spike) placementHandler(EItems.SPIKE, code);
  961. if (code === Settings.windmill) placementHandler(EItems.WINDMILL, code);
  962. if (code === Settings.trap) placementHandler(EItems.TRAP, code);
  963. if (code === Settings.turret) placementHandler(EItems.TURRET, code);
  964. if (code === Settings.tree) placementHandler(EItems.TREE, code);
  965. if (code === Settings.platform) placementHandler(EItems.PLATFORM, code);
  966. if (code === Settings.spawn) placementHandler(EItems.SPAWN, code);
  967. if (code === Settings.unequip) equipHat(Dsync.myPlayer.hat, true);
  968. if (code === Settings.bush) equipHat(EHats.BUSH);
  969. if (code === Settings.berserker) equipHat(EHats.BERSERKER);
  970. if (code === Settings.jungle) equipHat(EHats.JUNGLE);
  971. if (code === Settings.crystal) equipHat(EHats.CRYSTAL);
  972. if (code === Settings.spikegear) equipHat(EHats.SPIKEGEAR);
  973. if (code === Settings.immunity) equipHat(EHats.IMMUNITY);
  974. if (code === Settings.boost) equipHat(EHats.BOOST);
  975. if (code === Settings.applehat) equipHat(EHats.APPLEHAT);
  976. if (code === Settings.scuba) equipHat(EHats.SCUBA);
  977. if (code === Settings.hood) equipHat(EHats.HOOD);
  978. if (code === Settings.demolist) equipHat(EHats.DEMOLIST);
  979. if (code === Settings.invisibleHit && hasSecondary()) {
  980. if (Settings.invisHitToggle) {
  981. toggleInvis = !toggleInvis;
  982. } else {
  983. attackingInvis = true;
  984. }
  985. if (toggleInvis || attackingInvis) invisibleHit();
  986. }
  987. if (code === Settings.spikeInsta) spikeInsta();
  988. if (code === Settings.fastBreak) fastBreak();
  989. const copyMove = move;
  990. if (code === Settings.up) move |= 1;
  991. if (code === Settings.left) move |= 4;
  992. if (code === Settings.down) move |= 2;
  993. if (code === Settings.right) move |= 8;
  994. if (copyMove !== move) Dsync.move(move);
  995. if (event instanceof MouseEvent && code === Settings.attack) {
  996. const canAttack = !Dsync.mousedown(event);
  997. if (canAttack && Dsync.mousemove) {
  998. attacking = true;
  999. Dsync.attack(Dsync.getAngle());
  1000. }
  1001. }
  1002. if (code === Settings.autoattack) {
  1003. autoattack = !autoattack;
  1004. Dsync.autoattack(autoattack);
  1005. }
  1006. if (code === Settings.lockRotation) Dsync.toggleRotation();
  1007. if (code === Settings.upgradeScythe) upgradeScythe();
  1008. };
  1009. const handleKeyup = (event, code) => {
  1010. if (code === Settings.heal && isHealing) {
  1011. isHealing = false;
  1012. }
  1013. if (code === Settings.invisibleHit && attackingInvis) {
  1014. attackingInvis = false;
  1015. }
  1016. if (code === Settings.fastBreak) fastBreakStop();
  1017. const copyMove = move;
  1018. if (code === Settings.up) move &= -2;
  1019. if (code === Settings.left) move &= -5;
  1020. if (code === Settings.down) move &= -3;
  1021. if (code === Settings.right) move &= -9;
  1022. if (copyMove !== move) Dsync.move(move);
  1023. if (event instanceof MouseEvent && code === Settings.attack) {
  1024. Dsync.mouseup(event);
  1025. attacking = false;
  1026. }
  1027. if (currentItem !== null && hotkeys.delete(code)) {
  1028. const entries = [ ...hotkeys ];
  1029. currentItem = entries.length ? entries[entries.length - 1][1] : null;
  1030. if (currentItem === null) {
  1031. whichWeapon();
  1032. }
  1033. }
  1034. };
  1035. 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>';
  1036. const Header = code;
  1037. 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>';
  1038. const Navbar = Navbar_code;
  1039. 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 class="section-option"> <span class="section-option-title">Upgrade scythe</span> <button id="upgradeScythe" class="section-option-hotkeyInput"></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>';
  1040. const Keybinds = Keybinds_code;
  1041. 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 class="section-option"> <span class="section-option-title">Placement type</span> <select id="placementType"></select> </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> </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 class="section opened"> <div class="section-title"> <h2>Autoaim</h2> </div> <div class="section-content"> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Melee</span> <label class="switch-checkbox"> <input id="meleeAim" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Bow</span> <label class="switch-checkbox"> <input id="bowAim" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Spike insta</span> <label class="switch-checkbox"> <input id="spikeInstaAim" type="checkbox"> <span></span> </label> </div> </div> </div> </div> </div>';
  1042. const Combat = Combat_code;
  1043. 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 class="section-option"> <span class="section-option-title"> Visual aim <span class="tooltip"> * <span class="tooltip-text">It will show where are you aiming</span> </span> </span> <label class="switch-checkbox"> <input id="visualAim" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title"> Hide nicknames <span class="tooltip"> * <span class="tooltip-text">It will not render the badge, clan name and nickname of the user</span> </span> </span> <label class="switch-checkbox"> <input id="hideNicknames" 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>';
  1044. const Visuals = Visuals_code;
  1045. 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 class="section-option"> <span class="section-option-title"> Autoscythe <span class="tooltip"> * <span class="tooltip-text">To make autoscythe work, you must have at least diamond weapon. If you want to get "secret weapon", use keybind.</span> </span> </span> <label class="switch-checkbox"> <input id="autoScythe" 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>';
  1046. const Misc = Misc_code;
  1047. 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>';
  1048. const Credits = Credits_code;
  1049. 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}.menu-page .section .section-content .section-option select[id]{outline:none;border:none;font-weight:900;width:195px;font-size:.6em;border-radius:7.5px;padding:2.5px;background:#7d7d9b;color:#adbcd8;box-shadow:0px 4px 0px 0px #68687c inset}@-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}';
  1050. const createMenu = () => {
  1051. 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 `;
  1052. 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 `;
  1053. const IFRAME = document.createElement("iframe");
  1054. const blob = new Blob([ IFRAME_CONTENT ], {
  1055. type: "text/html; charset=utf-8"
  1056. });
  1057. IFRAME.src = URL.createObjectURL(blob);
  1058. IFRAME.id = "iframe-page-container";
  1059. document.body.appendChild(IFRAME);
  1060. const style = document.createElement("style");
  1061. style.innerHTML = IFRAME_STYLE;
  1062. document.head.appendChild(style);
  1063. IFRAME.onload = () => {
  1064. const iframeWindow = IFRAME.contentWindow;
  1065. const iframeDocument = iframeWindow.document;
  1066. URL.revokeObjectURL(IFRAME.src);
  1067. const menuContainer = iframeDocument.getElementById("menu-container");
  1068. const openMenu = iframeDocument.querySelectorAll(".open-menu");
  1069. const menuPage = iframeDocument.querySelectorAll(".menu-page");
  1070. const sections = iframeDocument.querySelectorAll(".section");
  1071. const hotkeyInputs = iframeDocument.querySelectorAll(".section-option-hotkeyInput[id]");
  1072. const closeMenu = iframeDocument.querySelector("#close-menu");
  1073. const checkboxs = iframeDocument.querySelectorAll("input[type='checkbox'][id]");
  1074. const sliders = iframeDocument.querySelectorAll("input[type='range'][id]");
  1075. const headerVersion = iframeDocument.querySelector("#version > span");
  1076. const autochatInputs = iframeDocument.querySelectorAll(".input.autochat");
  1077. const killMessage = iframeDocument.querySelector("#killMessage");
  1078. const resetSettings = iframeDocument.querySelector("#reset-settings");
  1079. const downloadSettings = iframeDocument.querySelector("#download-settings");
  1080. const uploadSettings = iframeDocument.querySelector("#upload-settings");
  1081. const menuTransparency = iframeDocument.querySelector("#menuTransparency");
  1082. const colorPickers = iframeDocument.querySelectorAll("input[type='color'][id]");
  1083. const selects = iframeDocument.querySelectorAll("select[id]");
  1084. const update = () => {
  1085. for (const select of selects) {
  1086. const data = selectData[select.id];
  1087. for (const key in data) {
  1088. if (!isNaN(Number(key))) continue;
  1089. const option = document.createElement("option");
  1090. option.value = data[key];
  1091. option.textContent = capitalize(key);
  1092. if (data[key] === Settings[select.id]) {
  1093. option.selected = true;
  1094. option.defaultSelected = true;
  1095. }
  1096. select.appendChild(option);
  1097. }
  1098. select.onchange = () => {
  1099. Settings[select.id] = Number(select.value);
  1100. storage.set("Dsync-settings", Settings);
  1101. };
  1102. }
  1103. for (const picker of colorPickers) {
  1104. const resetColor = picker.previousElementSibling;
  1105. if (resetColor) {
  1106. const defaultColor = defaultSettings[picker.id];
  1107. resetColor.style.backgroundColor = defaultColor;
  1108. resetColor.onclick = () => {
  1109. picker.value = defaultColor;
  1110. Settings[picker.id] = defaultColor;
  1111. storage.set("Dsync-settings", Settings);
  1112. };
  1113. }
  1114. picker.value = Settings[picker.id];
  1115. picker.onchange = () => {
  1116. Settings[picker.id] = picker.value;
  1117. storage.set("Dsync-settings", Settings);
  1118. picker.blur();
  1119. };
  1120. }
  1121. menuContainer.classList[Settings.menuTransparency ? "add" : "remove"]("transparent");
  1122. killMessage.value = Settings.killMessage;
  1123. killMessage.onchange = () => {
  1124. Settings.killMessage = killMessage.value;
  1125. storage.set("Dsync-settings", Settings);
  1126. killMessage.blur();
  1127. };
  1128. for (let i = 0; i < autochatInputs.length; i++) {
  1129. const input = autochatInputs[i];
  1130. input.value = Settings.autochatMessages[i] || "";
  1131. input.onchange = () => {
  1132. Settings.autochatMessages[i] = input.value;
  1133. storage.set("Dsync-settings", Settings);
  1134. input.blur();
  1135. };
  1136. }
  1137. headerVersion.textContent = "v" + Dsync.version;
  1138. for (const slider of sliders) {
  1139. const sliderValue = slider.nextElementSibling;
  1140. slider.value = Settings[slider.id];
  1141. if (sliderValue) {
  1142. sliderValue.textContent = slider.value;
  1143. }
  1144. slider.oninput = () => {
  1145. const value = Number(slider.value) % 5;
  1146. slider.value -= value;
  1147. if (sliderValue) {
  1148. sliderValue.textContent = slider.value;
  1149. }
  1150. Settings[slider.id] = Number(slider.value);
  1151. storage.set("Dsync-settings", Settings);
  1152. };
  1153. }
  1154. for (const checkbox of checkboxs) {
  1155. checkbox.checked = Settings[checkbox.id];
  1156. checkbox.onchange = () => {
  1157. Settings[checkbox.id] = checkbox.checked;
  1158. storage.set("Dsync-settings", Settings);
  1159. checkbox.blur();
  1160. };
  1161. }
  1162. Dsync.toggleMenu = () => {
  1163. menuContainer.classList.toggle("close");
  1164. menuContainer.classList.toggle("open");
  1165. setTimeout((() => {
  1166. IFRAME.classList.toggle("iframe-opened");
  1167. }), 100);
  1168. };
  1169. closeMenu.onclick = Dsync.toggleMenu;
  1170. for (let i = 0; i < openMenu.length; i++) {
  1171. openMenu[i].onclick = () => {
  1172. removeClass(openMenu, "active");
  1173. openMenu[i].classList.add("active");
  1174. removeClass(menuPage, "opened");
  1175. menuPage[i].classList.add("opened");
  1176. };
  1177. }
  1178. for (const section of sections) {
  1179. const title = section.children[0];
  1180. const content = section.children[1];
  1181. if (!title || !content) continue;
  1182. if (contains(section, "opened")) {
  1183. content.classList.add("opened");
  1184. continue;
  1185. }
  1186. content.style.display = "none";
  1187. title.onclick = () => {
  1188. if (!content.classList.contains("opened")) {
  1189. content.style.display = "grid";
  1190. } else {
  1191. setTimeout((() => {
  1192. content.style.display = "none";
  1193. }), 100);
  1194. }
  1195. setTimeout((() => {
  1196. content.classList.toggle("opened");
  1197. title.children[1].classList.toggle("rotate");
  1198. }), 0);
  1199. };
  1200. }
  1201. for (const hotkeyInput of hotkeyInputs) {
  1202. try {
  1203. hotkeyInput.textContent = formatCode(Settings[hotkeyInput.id]);
  1204. } catch (err) {
  1205. throw new Error(hotkeyInput.id + " doesn't exist in settings");
  1206. }
  1207. }
  1208. checkForRepeats();
  1209. };
  1210. menuTransparency.addEventListener("change", (() => {
  1211. menuContainer.classList[menuTransparency.checked ? "add" : "remove"]("transparent");
  1212. }));
  1213. resetSettings.onclick = () => {
  1214. Object.assign(Settings, defaultSettings);
  1215. storage.set("Dsync-settings", Settings);
  1216. update();
  1217. };
  1218. downloadSettings.onclick = () => {
  1219. download(Settings, "DsyncSettings" + Dsync.version);
  1220. };
  1221. uploadSettings.onchange = async event => {
  1222. const target = event.target;
  1223. const parent = uploadSettings.parentElement;
  1224. const spanText = parent.children[1];
  1225. parent.classList.remove("red");
  1226. parent.classList.remove("green");
  1227. try {
  1228. const text = await target.files[0].text();
  1229. const sets = JSON.parse(text);
  1230. if (Object.keys(sets).every((key => defaultSettings.hasOwnProperty(key)))) {
  1231. Object.assign(Settings, sets);
  1232. storage.set("Dsync-settings", Settings);
  1233. update();
  1234. parent.classList.add("green");
  1235. spanText.innerHTML = `SETTINGS LOADED SUCCESSFULLY`;
  1236. } else {
  1237. throw new Error("Invalid settings");
  1238. }
  1239. } catch (err) {
  1240. parent.classList.add("red");
  1241. spanText.innerHTML = "SETTINGS ARE NOT VALID, TRY ANOTHER";
  1242. }
  1243. };
  1244. const checkForRepeats = () => {
  1245. const list = new Map;
  1246. for (const hotkeyInput of hotkeyInputs) {
  1247. const value = Settings[hotkeyInput.id];
  1248. const [count, inputs] = list.get(value) || [ 0, [] ];
  1249. list.set(value, [ (count || 0) + 1, [ ...inputs, hotkeyInput ] ]);
  1250. hotkeyInput.classList.remove("red");
  1251. }
  1252. for (const data of list) {
  1253. const [number, hotkeyInputs] = data[1];
  1254. if (number === 1) continue;
  1255. for (const hotkeyInput of hotkeyInputs) {
  1256. hotkeyInput.classList.add("red");
  1257. }
  1258. }
  1259. };
  1260. Dsync.active = null;
  1261. const applyCode = code => {
  1262. if (!Dsync.active) return;
  1263. const key = code === "Backspace" ? "..." : formatCode(code);
  1264. Settings[Dsync.active.id] = code === "Backspace" ? "..." : code;
  1265. Dsync.active.textContent = key;
  1266. storage.set("Dsync-settings", Settings);
  1267. Dsync.active = null;
  1268. checkForRepeats();
  1269. };
  1270. menuContainer.addEventListener("keyup", (event => {
  1271. if (event.keyCode < 5 || !Dsync.active) return;
  1272. applyCode(event.code);
  1273. }));
  1274. menuContainer.addEventListener("mouseup", (event => {
  1275. const target = event.target;
  1276. if (Dsync.active) return applyCode(event.button);
  1277. if (!contains(target, "section-option-hotkeyInput") || !target.id) return;
  1278. target.textContent = "Wait...";
  1279. Dsync.active = target;
  1280. }));
  1281. iframeWindow.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  1282. iframeWindow.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  1283. const resize = () => {
  1284. const width = window.innerWidth;
  1285. const height = window.innerHeight;
  1286. const scale = Math.min(1, Math.min(width / 1024, height / 700));
  1287. menuContainer.style.transform = `translate(-50%, -50%) scale(${scale})`;
  1288. };
  1289. resize();
  1290. window.addEventListener("resize", resize);
  1291. setTimeout((() => IFRAME.classList.add("iframe-opened")), 0);
  1292. iframeWindow.addEventListener("contextmenu", (event => event.preventDefault()));
  1293. iframeWindow.addEventListener("mousedown", (event => 1 === event.button && event.preventDefault()));
  1294. iframeWindow.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1295. window.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1296. update();
  1297. };
  1298. };
  1299. const modules_createMenu = createMenu;
  1300. const ANY_LETTER = "(?:[^\\x00-\\x7F-]|\\$|\\w)";
  1301. const NumberSystem = [ {
  1302. radix: 2,
  1303. prefix: "0b0*"
  1304. }, {
  1305. radix: 8,
  1306. prefix: "0+"
  1307. }, {
  1308. radix: 10,
  1309. prefix: ""
  1310. }, {
  1311. radix: 16,
  1312. prefix: "0x0*"
  1313. } ];
  1314. var Template;
  1315. (function(Template) {
  1316. Template[Template["APPEND"] = 0] = "APPEND";
  1317. Template[Template["PREPEND"] = 1] = "PREPEND";
  1318. })(Template || (Template = {}));
  1319. class Regex {
  1320. constructor(code, unicode) {
  1321. this.code = code;
  1322. this.COPY_CODE = code;
  1323. this.unicode = unicode || false;
  1324. this.hooks = {};
  1325. }
  1326. static parseValue(value) {
  1327. try {
  1328. return Function(`return (${value})`)();
  1329. } catch (err) {
  1330. return null;
  1331. }
  1332. }
  1333. isRegexp(value) {
  1334. return TYPEOF(value) === "regexp";
  1335. }
  1336. generateNumberSystem(int) {
  1337. const copy = [ ...NumberSystem ];
  1338. const template = copy.map((({prefix, radix}) => prefix + int.toString(radix)));
  1339. return `(?:${template.join("|")})`;
  1340. }
  1341. parseVariables(regex) {
  1342. regex = regex.replace(/\{VAR\}/g, "(?:let|var|const)");
  1343. regex = regex.replace(/\{QUOTE\}/g, "['\"`]");
  1344. regex = regex.replace(/ARGS\{(\d+)\}/g, ((...args) => {
  1345. let count = Number(args[1]), arr = [];
  1346. while (count--) arr.push("\\w+");
  1347. return arr.join("\\s*,\\s*");
  1348. }));
  1349. regex = regex.replace(/NUMBER\{(\d+)\}/g, ((...args) => {
  1350. const int = Number(args[1]);
  1351. return this.generateNumberSystem(int);
  1352. }));
  1353. return regex;
  1354. }
  1355. format(name, inputRegex, flags) {
  1356. let regex = null;
  1357. if (Array.isArray(inputRegex)) {
  1358. regex = inputRegex.map((exp => this.isRegexp(exp) ? exp.source : exp)).join("\\s*");
  1359. } else if (this.isRegexp(inputRegex)) {
  1360. regex = inputRegex.source;
  1361. }
  1362. regex = this.parseVariables(regex);
  1363. if (this.unicode) {
  1364. regex = regex.replace(/\\w/g, ANY_LETTER);
  1365. }
  1366. const expression = new RegExp(regex.replace(/\{INSERT\}/, ""), flags);
  1367. const match = this.code.match(expression);
  1368. if (match === null) throw new Error("Failed to find: " + name);
  1369. return regex.includes("{INSERT}") ? new RegExp(regex, flags) : expression;
  1370. }
  1371. template(type, name, regex, substr) {
  1372. const expression = new RegExp(`(${this.format(name, regex).source})`);
  1373. this.code = this.code.replace(expression, type === Template.APPEND ? "$1" + substr : substr + "$1");
  1374. }
  1375. match(name, regex, flags, debug = false) {
  1376. const expression = this.format(name, regex, flags);
  1377. const match = this.code.match(expression);
  1378. this.hooks[name] = {
  1379. expression,
  1380. match
  1381. };
  1382. if (debug) log(name, this.hooks[name]);
  1383. return match;
  1384. }
  1385. matchAll(name, regex, flags, debug = false) {
  1386. const expression = this.format(name, regex, flags);
  1387. const matches = this.code.matchAll(expression);
  1388. this.hooks[name] = {
  1389. expression,
  1390. match: [ ...matches ]
  1391. };
  1392. if (debug) log(name, this.hooks[name]);
  1393. return matches;
  1394. }
  1395. replace(name, regex, substr, flags) {
  1396. const expression = this.format(name, regex, flags);
  1397. this.code = this.code.replace(expression, substr);
  1398. }
  1399. append(name, regex, substr) {
  1400. this.template(Template.APPEND, name, regex, substr);
  1401. }
  1402. prepend(name, regex, substr) {
  1403. this.template(Template.PREPEND, name, regex, substr);
  1404. }
  1405. insert(name, regex, substr) {
  1406. const {source} = this.format(name, regex);
  1407. if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
  1408. const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
  1409. this.code = this.code.replace(findExpression, `$1${substr}$2`);
  1410. }
  1411. }
  1412. const modules_Regex = Regex;
  1413. let kills = 0;
  1414. const stringMessage = data => {
  1415. const [id] = data;
  1416. if (id === WebsocketString.SPAWN && Settings.lastHat) {
  1417. equipHat(Dsync.actualHat, true);
  1418. }
  1419. if (id === WebsocketString.DIED) {
  1420. Controller_reset();
  1421. kills = 0;
  1422. if (Settings.autospawn) {
  1423. spawn();
  1424. }
  1425. }
  1426. if (id === WebsocketString.KILLUPDATE) {
  1427. kills = data[1][0];
  1428. }
  1429. if (Settings.kill && id === WebsocketString.KILLED) {
  1430. const killMessage = Settings.killMessage.length ? Settings.killMessage : "{KILL}x";
  1431. const name = data[1].replace(/^Killed\s/, "").trim();
  1432. const message = killMessage.replace(/\{KILL\}/g, kills + "").replace(/\{NAME\}/g, name);
  1433. Dsync.chat(message);
  1434. }
  1435. };
  1436. const hooks_stringMessage = stringMessage;
  1437. const drawItemBar = (ctx, imageData, index) => {
  1438. if (!Settings.itemCounter) return;
  1439. const itemId = itemBar(index);
  1440. const itemType = Dsync.itemData[itemId][Dsync.props.itemType];
  1441. const currentCount = Dsync.defaultData[Dsync.props.currentCount][itemType];
  1442. const maxCount = Dsync.maxCount[itemType];
  1443. if (maxCount === 0) return;
  1444. const x = imageData[Dsync.props.x] - 10;
  1445. const y = imageData[Dsync.props.y] + 10;
  1446. const w = imageData.width;
  1447. renderText(ctx, `${currentCount}/${maxCount}`, ((width, height) => [ x + w - width, y ]), {
  1448. font: "bold 16px Montserrat"
  1449. });
  1450. };
  1451. const hooks_drawItemBar = drawItemBar;
  1452. const drawEntityInfo = (target, ctx, isTeammate) => {
  1453. const entity = formatEntity(target);
  1454. const id = Dsync.myPlayerID();
  1455. if (id === entity.id) {
  1456. if (Settings.rainbow) {
  1457. Dsync.hsl = (Dsync.hsl + .3) % 360;
  1458. }
  1459. if (Dsync.aimTarget) {
  1460. const aimTarget = formatEntity(Dsync.aimTarget);
  1461. Dsync.target[Dsync.props.angle] = Settings.visualAim ? getAngle(aimTarget, entity).lerpAngle : Dsync.getAngle();
  1462. }
  1463. }
  1464. drawHealth(ctx, entity);
  1465. if (target.oldId) {
  1466. if (Settings.hatReloadBar && entity.type === 0) {
  1467. drawBar(ctx, entity, target.hatReload, 1300, Settings.hatReloadBarColor);
  1468. }
  1469. if (Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  1470. drawBar(ctx, entity, target.fireballReload, 3e3, Settings.fireballReloadBarColor);
  1471. }
  1472. }
  1473. if (Settings.drawID && entity.type === 0) {
  1474. const front = utils_Images.gaugeFront;
  1475. const w = front.width * .5;
  1476. const h = front.height * .5;
  1477. renderText(ctx, entity.id.toString(), (() => [ entity.x + w / 2 + 5, entity.y - h + (entity.radius + 50) + 5 ]), {
  1478. font: "bold 14px Montserrat",
  1479. textBaseline: "top"
  1480. });
  1481. }
  1482. if (id === entity.id || Dsync.myPlayer === null) return;
  1483. if (Settings.possibleShots && !isTeammate) {
  1484. const entityHit = projectileCanHitEntity(entity);
  1485. if (typeof entityHit === "object" && entityHit.canHit && !entityHit.needDestroy) {
  1486. const color = Settings.rainbow ? `hsl(${Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  1487. crosshair(ctx, entity.x, entity.y, entity.angle, color, 20, 8, 18);
  1488. }
  1489. }
  1490. if (Settings.enemyTracers && entity.type === 0 && !isTeammate || Settings.teammateTracers && entity.type === 0 && isTeammate || Settings.animalTracers && entity.type !== 0) {
  1491. drawTracers(ctx, entity, isTeammate);
  1492. }
  1493. };
  1494. const hooks_drawEntityInfo = drawEntityInfo;
  1495. const zoomHandler = () => {
  1496. let canZoom = true;
  1497. let wheels = 0;
  1498. const scaleFactor = 150;
  1499. const zoomLoop = () => {
  1500. const {w, h, w2, h2} = Dsync.scale;
  1501. const wx = Math.abs(w[0] - w2);
  1502. const hy = Math.abs(h[0] - h2);
  1503. if (wx < 3 || hy < 3) {
  1504. canZoom = true;
  1505. return;
  1506. }
  1507. w[0] = lerp(w[0], w2, .175);
  1508. h[0] = lerp(h[0], h2, .175);
  1509. window.dispatchEvent(new Event("resize"));
  1510. setTimeout(zoomLoop, 0);
  1511. };
  1512. window.addEventListener("wheel", (event => {
  1513. if (!(event.target instanceof HTMLCanvasElement) || event.ctrlKey || event.shiftKey || event.altKey || isInput() || !inGame()) return;
  1514. const scale = Dsync.scale;
  1515. const {w, h, w2, h2} = scale;
  1516. if (w2 === 1824 && h2 === 1026 && (wheels = (wheels + 1) % 5) !== 0) return;
  1517. const zoom = !Settings.reverseZoom && event.deltaY > 0 || Settings.reverseZoom && event.deltaY < 0 ? -scaleFactor : scaleFactor;
  1518. scale.w2 = Math.max(924, w2 + zoom);
  1519. scale.h2 = Math.max(126, h2 + zoom);
  1520. if (Settings.smoothZoom) {
  1521. if (canZoom) {
  1522. canZoom = false;
  1523. zoomLoop();
  1524. }
  1525. return;
  1526. }
  1527. w[0] = scale.w2;
  1528. h[0] = scale.h2;
  1529. window.dispatchEvent(new Event("resize"));
  1530. }));
  1531. };
  1532. const modules_zoomHandler = zoomHandler;
  1533. const drawItems = (target, id, ctx, step) => {
  1534. const object = formatObject(target);
  1535. if (object.ownerID === 0) return;
  1536. if (Settings.turretReloadBar && object.type === ELayer.TURRET && target.turretReload !== undefined) {
  1537. drawBar(ctx, {
  1538. ...object,
  1539. x: 0,
  1540. y: 0
  1541. }, target.turretReload, 3e3, Settings.turretReloadBarColor);
  1542. }
  1543. const color = getMarkerColor(target, object.ownerID) || "red";
  1544. if (color === null) return;
  1545. marker(ctx, color);
  1546. windmillRotation(target);
  1547. };
  1548. const drawitems = drawItems;
  1549. let toggleClown = false;
  1550. let toggleScuba = false;
  1551. let updatePlayer_isHealing = false;
  1552. const getDelay = health => {
  1553. if (health < 74) return 60;
  1554. if (health < 36) return 45;
  1555. return 130;
  1556. };
  1557. const updatePlayer_healing = () => {
  1558. const {health, maxHealth, isClown} = Dsync.myPlayer;
  1559. if (Settings.autoheal && health < maxHealth && !isClown && inGame()) heal();
  1560. setTimeout(updatePlayer_healing, getDelay(health));
  1561. };
  1562. const updatePlayer = target => {
  1563. const entity = formatEntity(target);
  1564. const player = formatPlayer(target);
  1565. if (entity.type === 0) {
  1566. if (player.id === Dsync.myPlayerID()) {
  1567. Dsync.myPlayer = {
  1568. ...Dsync.myPlayer,
  1569. ...player
  1570. };
  1571. if (Settings.skipUpgrades) {
  1572. const upgradeBar = Dsync.defaultData[Dsync.props.upgradeBar];
  1573. if (upgradeBar.length === 1) {
  1574. Dsync.upgradeItem(upgradeBar[0]);
  1575. }
  1576. }
  1577. const {y2, health, maxHealth, isClown, hat, oldHat} = Dsync.myPlayer;
  1578. if (Settings.autoheal && health < maxHealth && !updatePlayer_isHealing) {
  1579. updatePlayer_isHealing = true;
  1580. updatePlayer_healing();
  1581. }
  1582. const inRiver = y2 > 8075 && y2 < 8925;
  1583. const notInRiver = !(y2 > 8e3 && y2 < 9e3);
  1584. if (Settings.autoScuba && inRiver && !toggleScuba) {
  1585. toggleScuba = true;
  1586. Dsync.myPlayer.oldHat = hat;
  1587. equipHat(EHats.SCUBA, false, false);
  1588. }
  1589. if (toggleScuba && notInRiver) {
  1590. equipHat(oldHat);
  1591. toggleScuba = false;
  1592. }
  1593. if (Settings.jungleOnClown && isClown && hat !== EHats.JUNGLE && !toggleClown) {
  1594. toggleClown = true;
  1595. Dsync.myPlayer.oldHat = fastBreaking ? fastBreakHat : hat;
  1596. equipHat(EHats.JUNGLE, false, false);
  1597. }
  1598. if (!isClown && toggleClown) {
  1599. equipHat(oldHat);
  1600. toggleClown = false;
  1601. }
  1602. if (Settings.autochat) autochat();
  1603. if (Settings.autoScythe && Dsync.entityList()[ELayer.GOLDENCOW].length && !isStoneGold()) {
  1604. upgradeScythe();
  1605. }
  1606. }
  1607. if (Settings.hatReloadBar) {
  1608. if (target.oldId !== player.id) {
  1609. target.oldId = player.id;
  1610. target.oldHat = player.hat;
  1611. target.hatReload = 1300;
  1612. }
  1613. if (target.oldHat !== player.hat) {
  1614. target.oldHat = player.hat;
  1615. target.hatReload = 0;
  1616. }
  1617. target.hatReload = Math.min(target.hatReload + Dsync.step, 1300);
  1618. }
  1619. } else {
  1620. if (Settings.fireballReloadBar && entity.type === ELayer.DRAGON) {
  1621. const fireballs = Dsync.entityList()[ELayer.FIREBALL].map((object => {
  1622. const fireball = formatEntity(object);
  1623. return distance(entity, fireball).dist;
  1624. }));
  1625. const total = fireballs.reduce(((total, int) => total + int), 0);
  1626. const reload = 2900;
  1627. if (target.oldId !== entity.id) {
  1628. target.oldId = entity.id;
  1629. target.total = total;
  1630. target.fireballReload = reload;
  1631. }
  1632. if ((fireballs.length === 5 && total < 600 || fireballs.length === 1 && total < 100) && target.fireballReload === reload) {
  1633. target.total = total;
  1634. target.fireballReload = 0;
  1635. }
  1636. target.fireballReload = Math.min(target.fireballReload + Dsync.step, reload);
  1637. }
  1638. if (Settings.turretReloadBar && entity.type === ELayer.TURRET) {
  1639. const projectile = Dsync.entityList()[ELayer.PROJECTILE].find((object => {
  1640. const bullet = formatProjectile(object);
  1641. return bullet.ownerID === entity.ownerID && entity.angle2 === bullet.angle2;
  1642. }));
  1643. if (target.turretReload === undefined) {
  1644. target.turretReload = 3e3;
  1645. }
  1646. if (projectile) {
  1647. const bullet = formatProjectile(projectile);
  1648. if (bullet && target.bulletID !== bullet.id) {
  1649. target.bulletID = bullet.id;
  1650. target.turretReload = 0;
  1651. }
  1652. }
  1653. target.turretReload = Math.min(target.turretReload + Dsync.step, 3e3);
  1654. }
  1655. }
  1656. };
  1657. const hooks_updatePlayer = updatePlayer;
  1658. const renderLayers = (ctx, now) => {
  1659. const entities = Dsync.entityList();
  1660. for (let i = 0; i < Dsync.itemList.length; i++) {
  1661. const id = Dsync.itemList[i];
  1662. for (let j = 0; j < entities[id].length; j++) {
  1663. const target = entities[id][j];
  1664. const object = formatObject(target);
  1665. if (object.ownerID === 0) continue;
  1666. if (Settings.turretReloadBar && target.type === ELayer.TURRET && target.turretReload !== undefined) {
  1667. drawBar(ctx, object, target.turretReload, 3e3, Settings.turretReloadBarColor);
  1668. }
  1669. const color = getMarkerColor(target, object.ownerID);
  1670. if (color === null) continue;
  1671. ctx.save();
  1672. ctx.translate(object.x + target.dirX, object.y + target.dirY);
  1673. marker(ctx, color);
  1674. ctx.restore();
  1675. windmillRotation(target);
  1676. }
  1677. }
  1678. };
  1679. const hooks_renderLayers = renderLayers;
  1680. let start = Date.now();
  1681. const moveUpdate = () => {
  1682. const now = Date.now();
  1683. Dsync.step = now - start;
  1684. start = now;
  1685. };
  1686. const hooks_moveUpdate = moveUpdate;
  1687. const version = __webpack_require__(147).i8;
  1688. const log = console.log;
  1689. window.log = log;
  1690. window.Dsync = {
  1691. props: {},
  1692. hooks: {},
  1693. settings: Settings,
  1694. myPlayer: null,
  1695. target: null,
  1696. hsl: 0,
  1697. version,
  1698. actualHat: 0,
  1699. scale: {
  1700. w: linker(1824),
  1701. h: linker(1026),
  1702. w2: 1824,
  1703. h2: 1026
  1704. },
  1705. itemList: [],
  1706. mousemove: true,
  1707. aimTarget: null,
  1708. step: 0
  1709. };
  1710. const Dsync = window.Dsync;
  1711. storage["delete"]("_adIds");
  1712. window.eval = new Proxy(window.eval, {
  1713. apply(target, _this, args) {
  1714. const code = args[0];
  1715. if (code.length > 1e5) {
  1716. const Hook = new modules_Regex(code, true);
  1717. const sendFunction = (name, fname, content = "") => {
  1718. Hook.prepend(name, [ `function`, fname ], `Dsync.${name}=${fname};` + content);
  1719. };
  1720. window.COPY_CODE = Hook.COPY_CODE.match(/^\((.+)\)\(.+\);$/)[1];
  1721. Hook.append("EXTERNAL fix", [ /\(function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/ ], `EXTERNAL.__proto__.toString=()=>COPY_CODE;`);
  1722. Hook.replace("Debugger fix", [ /debugger/ ], ``, "g");
  1723. const selectItem = Hook.match("selectItem", [ /!/, /\w+/, /\[/, /\w+/, /\]/, /&&/, /(\w+)/, /\(/, /\d/, /\)/, /,/ ])[1];
  1724. sendFunction("selectItem", selectItem);
  1725. const equipHat = Hook.match("equipHat", [ /!/, /\w+/, /\)/, /return/, /;/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1726. sendFunction("equipHat", equipHat);
  1727. const chat = Hook.match("chat", [ /break/, /\}/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1728. sendFunction("chat", chat);
  1729. const [, attack, getAngle] = Hook.match("attack", [ /&&/, /(\w+)/, /\(/, /(\w+)/, /\(/, /\)/, /\)/, /,/ ]);
  1730. sendFunction("attack", attack);
  1731. sendFunction("getAngle", getAngle);
  1732. const stopAttack = Hook.match("stopAttack", [ /&&/, /(\w+)/, /\(/, /\)/, /,/ ])[1];
  1733. sendFunction("stopAttack", stopAttack);
  1734. const autoattack = Hook.match("autoattack", [ /,/, /(\w+)/, /\(/, /\w+/, /\)/, /\)/, /\)/ ])[1];
  1735. sendFunction("autoattack", autoattack);
  1736. const move = Hook.match("move", [ /&&/, /\(/, /(\w+)/, /\(/, /\w+/, /\)/ ])[1];
  1737. sendFunction("move", move);
  1738. const createClan = Hook.match("createClan", [ /,/, /\w+/, /=>/, /\{/, /(\w+)/, /\(/, /\w+/ ])[1];
  1739. sendFunction("createClan", createClan);
  1740. const leaveClan = Hook.match("leaveClan", [ /=>/, /\{/, /(\w+)/, /\(/, /\)/, /\}/ ])[1];
  1741. sendFunction("leaveClan", leaveClan);
  1742. const kickUser = Hook.match("kickUser", [ /return/, /;/, /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /:/ ])[1];
  1743. sendFunction("kickUser", kickUser);
  1744. const joinClan = Hook.match("joinClan", [ /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /\}/, /\)/, /\}/, /\}/ ])[1];
  1745. sendFunction("joinClan", joinClan);
  1746. const changeAngle = Hook.match("changeAngle", [ /\w+/, /\(/, /\w+/, /\)/, /\}/, /function/, /\w+/, /\(/, /\w+/, /\)/, /\{/, /(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  1747. sendFunction("changeAngle", changeAngle);
  1748. const MoveByAngle = Hook.match("MoveByAngle", [ /\w+\s\s*of/, /\w+\..+?(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  1749. sendFunction("MoveByAngle", MoveByAngle);
  1750. Hook.append("mousedown", [ /&&/, /\w+/, /\>/, /\w+/, /\)/, /return/, /;/, `(.+?=`, /(\w+)/, `.+?),`, `!(\\w+`, /\(/, /\w+/, /,/, /\w+/, `\\)).+?`, /\}/ ], `Dsync.mousedown=($3)=>{$2;return $4;};`);
  1751. Hook.append("mouseup", [ /!\w+\.\w+/, /\)/, /return/, /;/, `(\\w+`, /=/, /(\w+).+?\w+/, /\(/, /\w+/, /,/, /\w+/, `\\))`, /\}/ ], `Dsync.mouseup=($3)=>{$2};`);
  1752. const [, toggleRotation, rotVar] = Hook.match("lockRotation", [ /\[/, /\w+/, /\]/, /&&/, /(\w+)/, /\(/, /!(\w+)/, /\)/, /,/ ]);
  1753. Hook.prepend("lockRotation", [ `function`, `${toggleRotation}` ], `Dsync.toggleRotation=()=>{${rotVar}=!${rotVar};};`);
  1754. const toggleChat = Hook.match("toggleChat", [ /return/, `(\\w+`, /&&/, /\w+/, /\(/, /!\[/, /\]/, /\)/, `,.+?),\\w+\\.` ])[1];
  1755. Hook.insert("toggleChat", [ /null/, /\}/, /\)/, /\)/, /;/, /{INSERT}/, /{VAR}/, /\w+/, /=/ ], `Dsync.toggleChat=()=>{${toggleChat}};`);
  1756. const [, selectByID, defaultData, itemBar] = Hook.match("selectByID", [ /(\w+)/, /\(/, /(\w+)\.(\w+)/, /\[/, /Number/ ]);
  1757. sendFunction("selectByID", selectByID, `Dsync.defaultData=${defaultData};`);
  1758. Dsync.props.itemBar = itemBar;
  1759. Hook.append("drawEntityInfo", [ /function/, /\w+/, /\(/, /ARGS{3}/, /\)/, /\{/, /{VAR}/, /\w+/, /=/, /\w+/, /\[/, /\w+/, /\(/, /\).+?\.5;/ ], "if(Dsync.hooks.drawEntityInfo){Dsync.hooks.drawEntityInfo(...arguments);}");
  1760. const [, x, x1, x2] = Hook.match("positionX", [ /\(\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /\+/, /\(\w+\.(\w+)/ ]);
  1761. Dsync.props.x = x;
  1762. Dsync.props.x1 = x1;
  1763. Dsync.props.x2 = x2;
  1764. const [, y, y1, y2] = Hook.match("positionY", [ /,\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /\+/, /\(\w+\.(\w+)/ ]);
  1765. Dsync.props.y = y;
  1766. Dsync.props.y1 = y1;
  1767. Dsync.props.y2 = y2;
  1768. const [, angle, angle1, angle2] = Hook.match("angle", [ /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+/, /,/, /\w+\.\w+/, /=/, /\w+/, /,/ ]);
  1769. Dsync.props.angle = angle;
  1770. Dsync.props.angle1 = angle1;
  1771. Dsync.props.angle2 = angle2;
  1772. const id = Hook.match("id", [ /-NUMBER{1}/, /!==/, /\w+\.(\w+)/, /&&/ ])[1];
  1773. Dsync.props.id = id;
  1774. const health = Hook.match("health", [ /(\w+)/, /\//, /NUMBER{255}/, /\*/ ])[1];
  1775. Dsync.props.health = health;
  1776. const maxHealth = Hook.match("maxHealth", [ /\w+/, /:/, /NUMBER{35}/, /,/, /(\w+)/, /:/, /NUMBER{100}/ ])[1];
  1777. Dsync.props.maxHealth = maxHealth;
  1778. const hat = Hook.match("hat", [ /\w+/, /\(/, /\)/, /\[/, /\w+/, /\./, /(\w+)/, /\]/, /;/, /if/ ])[1];
  1779. Dsync.props.hat = hat;
  1780. const playerValue = Hook.match("playerValue", [ /if/, /\(/, /!/, /\(/, /\w+/, /\./, /(\w+)/, /&/, /\w+/, /\(/, /\)/ ])[1];
  1781. Dsync.props.playerValue = playerValue;
  1782. const [, itemData, itemType] = Hook.match("itemType", [ /(\w+)/, /\(/, /\)/, /\[/, /\w+/, /\]/, /\./, /(\w+)/, /;/ ]);
  1783. Dsync.props.itemType = itemType;
  1784. const playerData = Hook.match("playerData", [ /\w+\.\w+/, /\(/, /(?!\d+)\w+/, /,/, /(?!arguments)(\w+)/, /\)/, /;/ ])[1];
  1785. Hook.prepend("myPlayerID", [ /function/, /\w+/, /\(/, /\)/, /\{/, /return/, /\w+/, /!==/, /(\w+)/ ], `Dsync.myPlayerID=()=>$2;Dsync.playerData=${playerData};`);
  1786. const entityList = Hook.match("entityList", [ /new/, /Map/, /,/, /(\w+)/, /=/, /\[/, /\]/, /;/ ])[1];
  1787. const [, entityData, entityRadius] = Hook.match("entityData", /(\w+)\(\)\[\w+\.\w+\]\.(\w+)/);
  1788. Hook.prepend("entityData", [ /function/, /\w+/, /\(/, /ARGS{2}/, /\)/, /\{/, /{VAR}/, /\w+/, /,/ ], `Dsync.entityData=${entityData}();Dsync.itemData=${itemData}();Dsync.entityList=()=>${entityList};`);
  1789. Dsync.props.radius = entityRadius;
  1790. Hook.insert("showHoods1", [ /\w+/, /\(/, /\)/, /\./, /\w+/, /{INSERT}/, /\)/, /continue/, /;/ ], `&&!Dsync.settings.showHoods`);
  1791. Hook.insert("showHoods2", [ /\w+\.\w+/, /===/, /\w+/, /{INSERT}/, /\)/, /\{/ ], `||Dsync.settings.showHoods`);
  1792. Hook.insert("websocketString", [ /;/, /{INSERT}/, /switch/, /\(/, /(\w+)/, /\[/, /NUMBER{0}/, /\]/, /\)/, /\{/ ], `if(Dsync.hooks.stringMessage){Dsync.hooks.stringMessage($3);}`);
  1793. Hook.replace("zoomWidth", [ /(\w+)/, /:/, /NUMBER{1824}/, /,/ ], "$1:Dsync.scale.w,");
  1794. Hook.replace("zoomHeight", [ /(\w+)/, /:/, /NUMBER{1026}/, /,/ ], "$1:Dsync.scale.h,");
  1795. Hook.append("itemCounter", [ /(\w+)/, /\]/, /,/, /(\w+)/, /\./, /\w+/, /\(/, /(\w+)/, /\)/, /,/ ], `(Dsync.hooks.drawItemBar&&Dsync.hooks.drawItemBar($4,$3,$2)),`);
  1796. Hook.append("maxCount", [ `(\\w+`, `\\.`, `\\w+)`, /=/, /\[/, /ARGS{11}/, /\]/, /,/ ], `Dsync.maxCount=$2;`);
  1797. const currentCount = Hook.match("currentCount", [ /(\w+)/, /:/, /\[/, /ARGS{11}/, /\]/, /,/ ])[1];
  1798. Dsync.props.currentCount = currentCount;
  1799. const [, upgradeItem, upgradeBar] = Hook.match("upgradeList", [ /&&/, /\(/, /(\w+)/, /\(/, /\w+/, /\./, /(\w+)/, /\[/, /\w+/, /\]/, /\),/ ]);
  1800. Dsync.props.upgradeBar = upgradeBar;
  1801. sendFunction("upgradeItem", upgradeItem);
  1802. Hook.replace("ping", [ `({VAR}`, /(\w+)/, /=/, /\w+/, /\[/, /NUMBER{1}/, /\]/, /\|/, /\w+/, /\[/, /NUMBER{2}/, /\]/, /<</, /NUMBER{8}/, `;)`, /(?!{VAR})(\w+)/ ], `$1Dsync.ping=$2;$3`);
  1803. const clan = Hook.match("clan", [ /===/, /\w+/, /\./, /(\w+)/, /\)/, /\)/ ])[1];
  1804. Dsync.props.clan = clan;
  1805. const itemOwner = Hook.match("itemOwner", [ /\!/, /\(/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
  1806. Dsync.props.itemOwner = itemOwner;
  1807. const byteLength = Hook.match("byteLength", [ /NUMBER{3}/, /;/, /\w+/, /</, /(\w+)/ ])[1];
  1808. Hook.append("JoinCreateClan", [ /,/, /\w+/, /=/, /(\w+)/, /\[/, /NUMBER{2}/, /\]/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(3,${byteLength})]);}`);
  1809. Hook.append("UpdateClanList", [ /(\w+)/, /\[/, /NUMBER{1}/, /\]/, /;/, /\w+/, /\(/, /\)/, /\./, /\w+/, /\(/, /\w+/, /\)/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(2,${byteLength})]);}`);
  1810. Hook.append("DeleteClan", [ /{QUOTE}none{QUOTE}/, /,/, /\w+/, /=/, /null/, /,/ ], `(Dsync.hooks.DeleteClan&&Dsync.hooks.DeleteClan()),`);
  1811. Hook.append("drawItem", [ /\)/, /;/, /const/, /\w+/, /=/, /\w+/, /\[/, /(?!\d+)\w+/, /\]/, /;.+?\)/, /,/ ], "(Dsync.settings.markersBottom&&Dsync.hooks.drawItems&&Dsync.hooks.drawItems(...arguments)),");
  1812. Hook.append("bounceProps", [ /(\w+)\.\w+/, /\+/, /(\w+)/, /,/, /\w+\.\w+/, /\+/, /(\w+)/, /\),/ ], `$2.dirX=$3,$2.dirY=$4,`);
  1813. const [, upgradeScythe, goldenCowID] = Hook.match("scythe", [ /\w+/, /&&/, /(\w+)/, /\(/, /(\w+)/, /\)/, /,/ ]);
  1814. sendFunction("upgradeScythe", upgradeScythe, `Dsync.goldenCowID=()=>${goldenCowID};`);
  1815. const itemDamage = Hook.match("itemDamage", [ /(\w+)/, /:/, /46\.5/, /,/ ])[1];
  1816. Dsync.props.itemDamage = itemDamage;
  1817. const itemDataType = Hook.match("itemDataType", [ /\w+/, /\./, /(\w+)/, /===/, /NUMBER{2}/ ])[1];
  1818. Dsync.props.itemDataType = itemDataType;
  1819. Hook.append("updatePlayer", [ /\(/, /ARGS{16}/, /\).+?/, /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/ ], `;if(Dsync.hooks.updatePlayer){Dsync.hooks.updatePlayer($2);}`);
  1820. Hook.append("createEntity", [ /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/, /;/, /break/, /;/, /default/, /:/, /break/, /\}/ ], `if (Dsync.myPlayerID() === $2[Dsync.props.id]){Dsync.target=$2;}`);
  1821. 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);}}`);
  1822. Hook.replace("mousemove", [ `(const`, /\w+/, /=/, /\w+/, /\(/, /\)/, /;.+?&&/, /\w+/, /\(/, /\w+/, `\\))` ], "if(Dsync.mousemove){$1}");
  1823. const renderLayer = Hook.match("renderLayer", [ /:/, /NUMBER{38}/, /,/, /(\w+)/, /:/, /\w+/, /\./, /\w+/, /,/ ])[1];
  1824. Dsync.props.renderLayer = renderLayer;
  1825. const currentItem = Hook.match("currentItem", [ /,/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
  1826. Dsync.props.currentItem = currentItem;
  1827. const rotSpeed = Hook.match("rotSpeed", [ /\+=/, /\w+/, /\./, /(\w+)/, /\*/, /\w+/, /\)/ ])[1];
  1828. Dsync.props.rotSpeed = rotSpeed;
  1829. Hook.append("moveUpdate", [ /const/, /\w+/, /=/, /\+/, /new/, /\w+/, /;/ ], `if(Dsync.hooks.moveUpdate){Dsync.hooks.moveUpdate();}`);
  1830. Hook.replace("hideNicknames", [ `(const`, /\w+/, /=/, /\w+\.\w+/, `\\|\\|.+),`, `(\\w+`, /\(/, /ARGS{3}/, `&&)` ], `if(!Dsync.settings.hideNicknames){$1}$2`);
  1831. const weaponType = Hook.match("weaponType", [ /(\w+)/, /:/, /\w+\.\w+/, /,/, `${Dsync.props.id}`, /:/, /\w+\.\w+/, /,/ ])[1];
  1832. Dsync.props.weaponType = weaponType;
  1833. args[0] = Hook.code;
  1834. window.eval = target;
  1835. target.apply(_this, args);
  1836. load();
  1837. return;
  1838. }
  1839. return target.apply(_this, args);
  1840. }
  1841. });
  1842. const load = () => {
  1843. const canvas = document.querySelector("#game-canvas");
  1844. const gridToggle = document.querySelector("#grid-toggle");
  1845. const displayPingToggle = document.querySelector("#display-ping-toggle");
  1846. const itemMarkerToggle = document.querySelector("#native-helper-toggle");
  1847. const hat_menu_content = document.querySelector("#hat_menu_content");
  1848. if (gridToggle.checked) gridToggle.click();
  1849. if (!displayPingToggle.checked) displayPingToggle.click();
  1850. if (itemMarkerToggle.checked) itemMarkerToggle.click();
  1851. window.onkeydown = null;
  1852. window.onkeyup = null;
  1853. canvas.onmousedown = null;
  1854. canvas.onmouseup = null;
  1855. Dsync.hooks.stringMessage = hooks_stringMessage;
  1856. Dsync.hooks.updatePlayer = hooks_updatePlayer;
  1857. new MutationObserver((mutations => {
  1858. if (!inGame() || isInput()) return;
  1859. for (let i = 0; i < mutations.length; i++) {
  1860. if (mutations[i].target.textContent === "UNEQUIP") {
  1861. Dsync.actualHat = i + 1;
  1862. break;
  1863. }
  1864. }
  1865. })).observe(hat_menu_content, {
  1866. childList: true,
  1867. subtree: true
  1868. });
  1869. modules_createMenu();
  1870. window.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  1871. window.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  1872. canvas.addEventListener("mousedown", (event => handleKeydown(event, event.button)));
  1873. canvas.addEventListener("mouseup", (event => handleKeyup(event, event.button)));
  1874. Dsync.hooks.drawEntityInfo = hooks_drawEntityInfo;
  1875. Dsync.hooks.drawItemBar = hooks_drawItemBar;
  1876. Dsync.hooks.drawItems = drawitems;
  1877. Dsync.hooks.UpdateClanList = UpdateClanList;
  1878. Dsync.hooks.DeleteClan = DeleteClan;
  1879. Dsync.hooks.renderLayers = hooks_renderLayers;
  1880. Dsync.hooks.moveUpdate = hooks_moveUpdate;
  1881. Dsync.itemList = Dsync.itemData.filter((item => item[Dsync.props.itemDataType] === EItemTypes.PLACEABLE)).map((item => item[Dsync.props.renderLayer]));
  1882. modules_zoomHandler();
  1883. };
  1884. })();
  1885. }).toString() + ")();")();