Dsync Client [Sploop.io]

The most advanced hack for sploop.io

当前为 2022-10-01 提交的版本,查看 最新版本

  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.16
  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/scripts/449995-dsync-client-sploop-io
  20.  
  21. I need your support, please follow these steps:
  22. 1. Join my DISCORD server
  23. 2. Write a feedback about this script on GREASYFORK "script works, thank you so much"
  24. 3. Star my repository on GITHUB
  25. */
  26.  
  27. Function("(" + ((GM_info) => {
  28. "use strict";
  29. var __webpack_modules__ = {
  30. 147: module => {
  31. module.exports = {
  32. i8: "1.0.16"
  33. };
  34. }
  35. };
  36. var __webpack_module_cache__ = {};
  37. function __webpack_require__(moduleId) {
  38. var cachedModule = __webpack_module_cache__[moduleId];
  39. if (cachedModule !== undefined) {
  40. return cachedModule.exports;
  41. }
  42. var module = __webpack_module_cache__[moduleId] = {
  43. exports: {}
  44. };
  45. __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  46. return module.exports;
  47. }
  48. (() => {
  49. __webpack_require__.d = (exports, definition) => {
  50. for (var key in definition) {
  51. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  52. Object.defineProperty(exports, key, {
  53. enumerable: true,
  54. get: definition[key]
  55. });
  56. }
  57. }
  58. };
  59. })();
  60. (() => {
  61. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  62. })();
  63. var __webpack_exports__ = {};
  64. (() => {
  65. __webpack_require__.d(__webpack_exports__, {
  66. sv: () => src_Dsync,
  67. vU: () => error,
  68. cM: () => log,
  69. lZ: () => pingCount
  70. });
  71. var WebsocketString;
  72. (function(WebsocketString) {
  73. WebsocketString[WebsocketString["LEADERBOARD"] = 3] = "LEADERBOARD";
  74. WebsocketString[WebsocketString["CONNECT"] = 12] = "CONNECT";
  75. WebsocketString[WebsocketString["UPGRADE"] = 14] = "UPGRADE";
  76. WebsocketString[WebsocketString["DIED"] = 19] = "DIED";
  77. WebsocketString[WebsocketString["KILLUPDATE"] = 22] = "KILLUPDATE";
  78. WebsocketString[WebsocketString["KILLED"] = 28] = "KILLED";
  79. WebsocketString[WebsocketString["PLAYERSPAWNED"] = 32] = "PLAYERSPAWNED";
  80. WebsocketString[WebsocketString["DEFAULTDATA"] = 33] = "DEFAULTDATA";
  81. WebsocketString[WebsocketString["SPAWN"] = 35] = "SPAWN";
  82. })(WebsocketString || (WebsocketString = {}));
  83. var EItems;
  84. (function(EItems) {
  85. EItems[EItems["PRIMARY"] = 0] = "PRIMARY";
  86. EItems[EItems["SECONDARY"] = 1] = "SECONDARY";
  87. EItems[EItems["HEAL"] = 2] = "HEAL";
  88. EItems[EItems["WALL"] = 3] = "WALL";
  89. EItems[EItems["SPIKE"] = 4] = "SPIKE";
  90. EItems[EItems["WINDMILL"] = 5] = "WINDMILL";
  91. EItems[EItems["TREE"] = 6] = "TREE";
  92. EItems[EItems["TRAP"] = 7] = "TRAP";
  93. EItems[EItems["PLATFORM"] = 8] = "PLATFORM";
  94. EItems[EItems["SPAWN"] = 9] = "SPAWN";
  95. EItems[EItems["TURRET"] = 10] = "TURRET";
  96. })(EItems || (EItems = {}));
  97. var ELayer;
  98. (function(ELayer) {
  99. ELayer[ELayer["PLAYER"] = 0] = "PLAYER";
  100. ELayer[ELayer["STONE"] = 1] = "STONE";
  101. ELayer[ELayer["HARDSPIKE"] = 2] = "HARDSPIKE";
  102. ELayer[ELayer["TREE"] = 3] = "TREE";
  103. ELayer[ELayer["GOLD"] = 4] = "GOLD";
  104. ELayer[ELayer["BUSH"] = 5] = "BUSH";
  105. ELayer[ELayer["TRAP"] = 6] = "TRAP";
  106. ELayer[ELayer["SPIKE"] = 7] = "SPIKE";
  107. ELayer[ELayer["WOODWALL"] = 8] = "WOODWALL";
  108. ELayer[ELayer["PLATFORM"] = 9] = "PLATFORM";
  109. ELayer[ELayer["BOOST"] = 10] = "BOOST";
  110. ELayer[ELayer["LOOTBOX"] = 11] = "LOOTBOX";
  111. ELayer[ELayer["PROJECTILE"] = 12] = "PROJECTILE";
  112. ELayer[ELayer["WINDMILL"] = 13] = "WINDMILL";
  113. ELayer[ELayer["COW"] = 14] = "COW";
  114. ELayer[ELayer["SPAWN"] = 15] = "SPAWN";
  115. ELayer[ELayer["POWERMILL"] = 16] = "POWERMILL";
  116. ELayer[ELayer["CASTLESPIKE"] = 17] = "CASTLESPIKE";
  117. ELayer[ELayer["TURRET"] = 18] = "TURRET";
  118. ELayer[ELayer["WOODFARM"] = 19] = "WOODFARM";
  119. ELayer[ELayer["CHERRYWOODFARM"] = 20] = "CHERRYWOODFARM";
  120. ELayer[ELayer["STONEWARM"] = 21] = "STONEWARM";
  121. ELayer[ELayer["CASTLEWALL"] = 22] = "CASTLEWALL";
  122. ELayer[ELayer["SHARK"] = 23] = "SHARK";
  123. ELayer[ELayer["WOLF"] = 24] = "WOLF";
  124. ELayer[ELayer["GOLDENCOW"] = 25] = "GOLDENCOW";
  125. ELayer[ELayer["ROOF"] = 26] = "ROOF";
  126. ELayer[ELayer["DRAGON"] = 27] = "DRAGON";
  127. ELayer[ELayer["MAMMOTH"] = 28] = "MAMMOTH";
  128. ELayer[ELayer["FIREBALL"] = 29] = "FIREBALL";
  129. ELayer[ELayer["CHEST"] = 30] = "CHEST";
  130. ELayer[ELayer["DRAGONWALLBIG"] = 31] = "DRAGONWALLBIG";
  131. ELayer[ELayer["DRAGONWALLMEDIUM"] = 32] = "DRAGONWALLMEDIUM";
  132. ELayer[ELayer["DRAGONWALLSMALL"] = 33] = "DRAGONWALLSMALL";
  133. ELayer[ELayer["MAMMOTHWALL"] = 34] = "MAMMOTHWALL";
  134. ELayer[ELayer["MAMMOTHWALLSMALL"] = 35] = "MAMMOTHWALLSMALL";
  135. ELayer[ELayer["DUCK"] = 36] = "DUCK";
  136. ELayer[ELayer["TELEPORT"] = 37] = "TELEPORT";
  137. ELayer[ELayer["CACTUS"] = 38] = "CACTUS";
  138. ELayer[ELayer["TORNADO"] = 39] = "TORNADO";
  139. })(ELayer || (ELayer = {}));
  140. 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 ];
  141. const types_CannotPlaceOn = [ ELayer.STONE, ELayer.HARDSPIKE, ELayer.TREE, ELayer.GOLD, ELayer.BUSH, ELayer.TRAP, ELayer.SPIKE, ELayer.WOODWALL, ELayer.PLATFORM, ELayer.BOOST, ELayer.LOOTBOX, 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 ];
  142. const LayerExclude = [ ELayer.TREE, ELayer.WOODFARM, ELayer.CHERRYWOODFARM ];
  143. var EObjects;
  144. (function(EObjects) {
  145. EObjects[EObjects["BOOST"] = 6] = "BOOST";
  146. EObjects[EObjects["PLATFORM"] = 8] = "PLATFORM";
  147. EObjects[EObjects["TRAP"] = 9] = "TRAP";
  148. EObjects[EObjects["WINDMILL"] = 14] = "WINDMILL";
  149. EObjects[EObjects["SPAWN"] = 16] = "SPAWN";
  150. EObjects[EObjects["POWERMILL"] = 19] = "POWERMILL";
  151. EObjects[EObjects["ROOF"] = 48] = "ROOF";
  152. })(EObjects || (EObjects = {}));
  153. var EHats;
  154. (function(EHats) {
  155. EHats[EHats["BUSH"] = 1] = "BUSH";
  156. EHats[EHats["BERSERKER"] = 2] = "BERSERKER";
  157. EHats[EHats["JUNGLE"] = 3] = "JUNGLE";
  158. EHats[EHats["CRYSTAL"] = 4] = "CRYSTAL";
  159. EHats[EHats["SPIKEGEAR"] = 5] = "SPIKEGEAR";
  160. EHats[EHats["IMMUNITY"] = 6] = "IMMUNITY";
  161. EHats[EHats["BOOST"] = 7] = "BOOST";
  162. EHats[EHats["APPLEHAT"] = 8] = "APPLEHAT";
  163. EHats[EHats["SCUBA"] = 9] = "SCUBA";
  164. EHats[EHats["HOOD"] = 10] = "HOOD";
  165. EHats[EHats["DEMOLIST"] = 11] = "DEMOLIST";
  166. })(EHats || (EHats = {}));
  167. var EWeapons;
  168. (function(EWeapons) {
  169. EWeapons[EWeapons["MUSKET"] = 4] = "MUSKET";
  170. EWeapons[EWeapons["SHIELD"] = 11] = "SHIELD";
  171. EWeapons[EWeapons["STICK"] = 13] = "STICK";
  172. EWeapons[EWeapons["HAMMER"] = 15] = "HAMMER";
  173. EWeapons[EWeapons["BOW"] = 26] = "BOW";
  174. EWeapons[EWeapons["XBOW"] = 27] = "XBOW";
  175. EWeapons[EWeapons["PEARL"] = 50] = "PEARL";
  176. EWeapons[EWeapons["SCYTHE"] = 57] = "SCYTHE";
  177. })(EWeapons || (EWeapons = {}));
  178. var EItemTypes;
  179. (function(EItemTypes) {
  180. EItemTypes[EItemTypes["ATTACKING"] = 0] = "ATTACKING";
  181. EItemTypes[EItemTypes["SHOOTING"] = 1] = "SHOOTING";
  182. EItemTypes[EItemTypes["PLACEABLE"] = 2] = "PLACEABLE";
  183. EItemTypes[EItemTypes["FOOD"] = 3] = "FOOD";
  184. })(EItemTypes || (EItemTypes = {}));
  185. var EAnimals;
  186. (function(EAnimals) {
  187. EAnimals[EAnimals["COW"] = 14] = "COW";
  188. EAnimals[EAnimals["SHARK"] = 23] = "SHARK";
  189. EAnimals[EAnimals["WOLF"] = 24] = "WOLF";
  190. EAnimals[EAnimals["GOLDENCOW"] = 25] = "GOLDENCOW";
  191. EAnimals[EAnimals["DRAGON"] = 27] = "DRAGON";
  192. EAnimals[EAnimals["MAMMOTH"] = 28] = "MAMMOTH";
  193. EAnimals[EAnimals["DUCK"] = 36] = "DUCK";
  194. })(EAnimals || (EAnimals = {}));
  195. var PlacementType;
  196. (function(PlacementType) {
  197. PlacementType[PlacementType["DEFAULT"] = 0] = "DEFAULT";
  198. PlacementType[PlacementType["INVISIBLE"] = 1] = "INVISIBLE";
  199. PlacementType[PlacementType["HOLDING"] = 2] = "HOLDING";
  200. })(PlacementType || (PlacementType = {}));
  201. var EServers;
  202. (function(EServers) {
  203. EServers["SAND_EU_1"] = "SFRA";
  204. EServers["SAND_EU_2"] = "SFRA2BIS";
  205. EServers["SAND_USA_1"] = "SCA";
  206. EServers["SAND_USA_2"] = "SCA2";
  207. EServers["SAND_AS_1"] = "SGP";
  208. EServers["SAND_AS_2"] = "SGP2";
  209. EServers["SAND_AS_3"] = "SGP3BIS";
  210. EServers["NORMAL_EU_1"] = "FRA1FFA";
  211. EServers["NORMAL_USA_1"] = "CA1FFA";
  212. EServers["NORMAL_AS_1"] = "SGP1FFA";
  213. EServers["ROYALE_USA_1"] = "BRSCA";
  214. })(EServers || (EServers = {}));
  215. const selectData = {
  216. placementType: PlacementType,
  217. connectTo: EServers
  218. };
  219. var TargetReload;
  220. (function(TargetReload) {
  221. TargetReload[TargetReload["TURRET"] = 3e3] = "TURRET";
  222. TargetReload[TargetReload["HAT"] = 1300] = "HAT";
  223. TargetReload[TargetReload["DRAGON"] = 3e3] = "DRAGON";
  224. })(TargetReload || (TargetReload = {}));
  225. const storage = {
  226. get(key) {
  227. return JSON.parse(localStorage.getItem(key));
  228. },
  229. set(key, value) {
  230. localStorage.setItem(key, JSON.stringify(value));
  231. },
  232. delete(key) {
  233. localStorage.removeItem(key);
  234. }
  235. };
  236. const defaultSettings = {
  237. primary: "Digit1",
  238. secondary: "Digit2",
  239. heal: "KeyQ",
  240. wall: "Digit4",
  241. spike: "KeyV",
  242. windmill: "KeyN",
  243. trap: "KeyF",
  244. turret: "KeyH",
  245. tree: "KeyU",
  246. platform: "KeyT",
  247. spawn: "KeyJ",
  248. up: "KeyW",
  249. left: "KeyA",
  250. down: "KeyS",
  251. right: "KeyD",
  252. autoattack: "KeyE",
  253. lockRotation: "KeyX",
  254. openChat: "Enter",
  255. invisibleHit: 2,
  256. spikeInsta: "KeyR",
  257. toggleMenu: "Escape",
  258. fastBreak: "KeyZ",
  259. upgradeScythe: "...",
  260. unequip: "...",
  261. bush: "...",
  262. berserker: "...",
  263. jungle: "...",
  264. crystal: "...",
  265. spikegear: "...",
  266. immunity: 4,
  267. boost: 3,
  268. applehat: "...",
  269. scuba: "...",
  270. hood: "...",
  271. demolist: "...",
  272. placementType: PlacementType.INVISIBLE,
  273. placementSpeed: 1,
  274. autobed: true,
  275. automill: true,
  276. autoheal: true,
  277. jungleOnClown: true,
  278. lastHat: true,
  279. autoScuba: true,
  280. meleeAim: true,
  281. bowAim: true,
  282. spikeInstaAim: true,
  283. enemyTracers: true,
  284. teammateTracers: true,
  285. animalTracers: true,
  286. enemyColor: "#cc5151",
  287. teammateColor: "#8ecc51",
  288. animalColor: "#518ccc",
  289. arrows: true,
  290. rainbow: false,
  291. drawHP: true,
  292. showHoods: true,
  293. itemCounter: true,
  294. drawID: false,
  295. visualAim: true,
  296. hideNicknames: false,
  297. itemMarkers: true,
  298. teammateMarkers: true,
  299. enemyMarkers: true,
  300. trapActivated: true,
  301. itemMarkersColor: "#8ecc51",
  302. teammateMarkersColor: "#cfbc5f",
  303. enemyMarkersColor: "#cc5151",
  304. trapActivatedColor: "#48b2b8",
  305. markersBottom: true,
  306. hatReloadBar: true,
  307. hatReloadBarColor: "#5155cc",
  308. fireballReloadBar: true,
  309. fireballReloadBarColor: "#cf7148",
  310. turretReloadBar: true,
  311. turretReloadBarColor: "#51cc80",
  312. weaponReloadBar: true,
  313. weaponReloadBarColor: "#cc8251",
  314. windmillRotation: false,
  315. possibleShots: true,
  316. hideMessages: false,
  317. autochat: true,
  318. autochatMessages: [ "Dsync Client", "What is it?", "The most advanced hack for sploop!", "Download on greasyfork!" ],
  319. kill: true,
  320. killMessage: "{NAME}, you suck! {KILL}x",
  321. autospawn: false,
  322. smoothZoom: true,
  323. skipUpgrades: true,
  324. invisHitToggle: false,
  325. reverseZoom: false,
  326. autoAccept: false,
  327. connectTo: "SFRA",
  328. menuTransparency: false,
  329. blindUsers: [ 0, 0, 0 ]
  330. };
  331. const settings = {
  332. ...defaultSettings,
  333. ...storage.get("Dsync-settings")
  334. };
  335. for (const key in settings) {
  336. if (!defaultSettings.hasOwnProperty(key)) {
  337. delete settings[key];
  338. }
  339. }
  340. storage.set("Dsync-settings", settings);
  341. const Settings = settings;
  342. const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
  343. const removeClass = (target, name) => {
  344. if (target instanceof HTMLElement) {
  345. target.classList.remove(name);
  346. return;
  347. }
  348. for (const element of target) {
  349. element.classList.remove(name);
  350. }
  351. };
  352. const formatCode = code => {
  353. code = code + "";
  354. if (code === "0") return "LBTN";
  355. if (code === "1") return "MBTN";
  356. if (code === "2") return "RBTN";
  357. if (code === "3") return "XBTN2";
  358. if (code === "4") return "XBTN1";
  359. if (code === "Escape") return "ESC";
  360. if (code === "BracketLeft") return "[";
  361. if (code === "BracketRight") return "]";
  362. if (code === "NumpadDivide") return "NUMDIV";
  363. if (code === "NumpadMultiply") return "NUMMULT";
  364. if (code === "NumpadSubtract") return "NUMSUB";
  365. if (code === "NumpadDecimal") return "NUMDEC";
  366. if (code === "CapsLock") return "CAPS";
  367. if (code === "PrintScreen") return "PRNT";
  368. if (code === "Backslash") return "\\";
  369. if (code === "Backquote") return "BQUOTE";
  370. if (code === "PageDown") return "PAGEDN";
  371. const NumpadDigitArrowKey = /^(?:Numpad|Digit|Arrow|Key)(\w+)$/;
  372. if (NumpadDigitArrowKey.test(code)) {
  373. code = code.replace(NumpadDigitArrowKey, "$1").replace(/Numpad/, "NUM");
  374. }
  375. const ExtraKeysRegex = /^(Control|Shift|Alt)(.).*/;
  376. if (ExtraKeysRegex.test(code)) {
  377. code = code.replace(ExtraKeysRegex, "$2$1").replace(/Control/, "CTRL");
  378. }
  379. return code.toUpperCase();
  380. };
  381. const contains = (target, name) => target.classList.contains(name);
  382. const isInput = target => {
  383. const element = target || document.activeElement;
  384. return [ "TEXTAREA", "INPUT" ].includes(element.tagName);
  385. };
  386. const inGame = () => {
  387. const homepage = document.querySelector("#homepage");
  388. return homepage && homepage.style.display === "none";
  389. };
  390. const formatData = object => {
  391. const data = {
  392. id: object[src_Dsync.props.id],
  393. type: object.type,
  394. x: object[src_Dsync.props.x],
  395. y: object[src_Dsync.props.y],
  396. x1: object[src_Dsync.props.x1],
  397. y1: object[src_Dsync.props.y1],
  398. x2: object[src_Dsync.props.x2],
  399. y2: object[src_Dsync.props.y2],
  400. angle: object[src_Dsync.props.angle],
  401. angle1: object[src_Dsync.props.angle1],
  402. angle2: object[src_Dsync.props.angle2],
  403. ownerID: object[src_Dsync.props.itemOwner],
  404. target: object
  405. };
  406. return {
  407. ...data,
  408. dir: angleObject(data, src_Dsync.myPlayer || {
  409. x2: 0,
  410. y2: 0
  411. }),
  412. distance: distObject(data, src_Dsync.myPlayer || {
  413. x2: 0,
  414. y2: 0
  415. })
  416. };
  417. };
  418. const formatProjectile = object => {
  419. const data = formatData(object);
  420. return {
  421. ...data,
  422. range: object.range,
  423. projectileType: object[src_Dsync.props.projectileType]
  424. };
  425. };
  426. const Common_formatObject = object => {
  427. const data = formatData(object);
  428. const entityData = src_Dsync.entityData[object.type];
  429. return {
  430. ...data,
  431. radius: entityData[src_Dsync.props.radius]
  432. };
  433. };
  434. const formatEntity = entity => {
  435. const object = Common_formatObject(entity);
  436. const entityData = src_Dsync.entityData[entity.type];
  437. const healthValue = entity[src_Dsync.props.health];
  438. const maxHealth = entityData[src_Dsync.props.maxHealth];
  439. return {
  440. ...object,
  441. healthValue,
  442. health: Math.ceil(entity[src_Dsync.props.health] / 255 * maxHealth),
  443. maxHealth,
  444. playerValue: entity[src_Dsync.props.playerValue]
  445. };
  446. };
  447. const Common_formatPlayer = entity => {
  448. const player = formatEntity(entity);
  449. return {
  450. ...player,
  451. hat: entity[src_Dsync.props.hat],
  452. isClown: player.playerValue === 128,
  453. currentItem: entity[src_Dsync.props.currentItem]
  454. };
  455. };
  456. const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
  457. const distObject = (entity1, entity2) => dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2);
  458. const distance = (entity1, entity2) => {
  459. const entity1Has = "x" in entity1 && "y" in entity1;
  460. const entity2Has = "x" in entity2 && "y" in entity2;
  461. return {
  462. lerpDist: entity1Has && entity2Has ? dist(entity1.x, entity1.y, entity2.x, entity2.y) : null,
  463. dist: dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2)
  464. };
  465. };
  466. const angle = (x1, y1, x2, y2) => Math.atan2(y1 - y2, x1 - x2);
  467. const angleObject = (entity1, entity2) => angle(entity1.x2, entity1.y2, entity2.x2, entity2.y2);
  468. const getAngle = (entity1, entity2) => {
  469. const entity1Has = "x" in entity1 && "y" in entity1;
  470. const entity2Has = "x" in entity2 && "y" in entity2;
  471. return {
  472. lerpAngle: entity1Has && entity2Has ? Math.atan2(entity1.y - entity2.y, entity1.x - entity2.x) : null,
  473. angle: Math.atan2(entity1.y2 - entity2.y2, entity1.x2 - entity2.x2)
  474. };
  475. };
  476. const random = (min, max) => {
  477. const isInteger = Number.isInteger(min) && Number.isInteger(max);
  478. if (isInteger) return Math.floor(Math.random() * (max - min + 1) + min);
  479. return Math.random() * (max - min) + min;
  480. };
  481. const toRad = deg => deg * (Math.PI / 180);
  482. const diff = (a, b) => Math.abs(a - b);
  483. const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
  484. const lerp = (start, stop, amt) => amt * (stop - start) + start;
  485. const sleep = ms => new Promise((resolve => setTimeout(resolve, ms)));
  486. const linker = value => {
  487. const hook = {
  488. 0: value,
  489. toString: radix => hook[0].toString(radix),
  490. valueOf: () => hook[0].valueOf()
  491. };
  492. return hook;
  493. };
  494. const download = (data, filename) => {
  495. const blob = new Blob([ JSON.stringify(data, null, 4) ], {
  496. type: "application/json "
  497. });
  498. const url = URL.createObjectURL(blob);
  499. const a = document.createElement("a");
  500. a.href = url;
  501. a.download = (filename || "settings") + ".txt";
  502. a.click();
  503. a.remove();
  504. URL.revokeObjectURL(url);
  505. };
  506. const capitalize = word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
  507. const GM = (property, value) => {
  508. if (!src_Dsync.PRODUCTION) return true;
  509. try {
  510. return GM_info.script[property] === value;
  511. } catch (err) {
  512. return false;
  513. }
  514. };
  515. const fromCharCode = codes => codes.map((code => String.fromCharCode(code))).join("");
  516. const isBlind = () => !Settings.blindUsers.every((a => a === 1));
  517. let teammates = [];
  518. const UpdateClanList = userList => {
  519. teammates = userList;
  520. };
  521. const DeleteClan = () => {
  522. teammates = [];
  523. };
  524. const itemBar = index => src_Dsync.defaultData[src_Dsync.props.itemBar][index];
  525. const hasSecondary = () => {
  526. const item = src_Dsync.itemData[itemBar(1)];
  527. return item[src_Dsync.props.itemType] === EItems.SECONDARY;
  528. };
  529. const canShoot = () => {
  530. const item = src_Dsync.itemData[itemBar(1)];
  531. return item[src_Dsync.props.itemDataType] === EItemTypes.SHOOTING;
  532. };
  533. const hasItemByType = type => {
  534. const items = src_Dsync.defaultData[src_Dsync.props.itemBar];
  535. return items.find((id => src_Dsync.itemData[id][src_Dsync.props.itemType] === type));
  536. };
  537. const isWeapon = id => {
  538. const type = src_Dsync.itemData[id][src_Dsync.props.itemType];
  539. return type === 0 || type === 1;
  540. };
  541. const isSecondary = id => {
  542. const type = src_Dsync.itemData[id][src_Dsync.props.itemType];
  543. return type === 1;
  544. };
  545. const isStoneGold = () => {
  546. const item = Dsync.itemData[itemBar(0)];
  547. return [ 1, 2 ].includes(item[Dsync.props.weaponType]);
  548. };
  549. const getCount = type => src_Dsync.defaultData[src_Dsync.props.currentCount][type];
  550. const hasResources = id => {
  551. const cost = src_Dsync.itemData[id][src_Dsync.props.resourceAmount] || [ 0, 0, 0, 0 ];
  552. const {food, wood, stone, gold} = src_Dsync.resources;
  553. const hasFood = food >= cost[0];
  554. const hasWood = wood >= cost[1];
  555. const hasStone = stone >= cost[2];
  556. const hasGold = gold >= cost[3];
  557. return hasFood && hasWood && hasStone && hasGold;
  558. };
  559. let scytheToggle = false;
  560. const upgradeScythe = async () => {
  561. const goldenCowID = src_Dsync.goldenCowID();
  562. if (goldenCowID && itemBar(0) !== EWeapons.SCYTHE && !scytheToggle) {
  563. scytheToggle = true;
  564. src_Dsync.upgradeScythe(goldenCowID);
  565. await sleep(200);
  566. scytheToggle = false;
  567. }
  568. };
  569. const getAnimals = () => {
  570. const list = src_Dsync.entityList();
  571. 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)));
  572. };
  573. const getEnemies = () => {
  574. const players = src_Dsync.entityList()[0];
  575. return players.map((player => formatEntity(player))).filter((({id, ownerID}) => {
  576. const isMyPlayer = id === src_Dsync.myPlayerID();
  577. const isTeammate = teammates.includes(ownerID);
  578. return !isMyPlayer && !isTeammate;
  579. }));
  580. };
  581. const getPlayerByOwner = ownerID => {
  582. const players = Dsync.players();
  583. for (const TObjectAny of players) {
  584. const player = formatPlayer(TObjectAny);
  585. if (player.ownerID === ownerID) return player;
  586. }
  587. return null;
  588. };
  589. const getEntities = () => [ ...getEnemies(), ...getAnimals() ];
  590. const getPlaceOnItems = () => {
  591. const entities = Dsync.entityList();
  592. const objects = [];
  593. for (let i = 0; i < CannotPlaceOn.length; i++) {
  594. const id = CannotPlaceOn[i];
  595. const items = entities[id].map((object => formatObject(object)));
  596. objects.push(...items);
  597. }
  598. return objects.sort(((a, b) => a.distance - b.distance));
  599. };
  600. const lineSegmentIntersectsCircle = (x1, y1, x2, y2, cx, cy, r) => {
  601. const xL = x2 - x1;
  602. const xC = x1 - cx;
  603. const yL = y2 - y1;
  604. const yC = y1 - cy;
  605. const a = xL * xL + yL * yL;
  606. const hB = xL * xC + yL * yC;
  607. const c = xC * xC + yC * yC - r * r;
  608. return hB * hB >= a * c && (-hB <= a || c + hB + hB + a <= 0) && (hB <= 0 || c <= 0);
  609. };
  610. const futurePosition = entity => {
  611. const {x1, y1, x2, y2} = entity;
  612. const distance = dist(x2, y2, x1, y1) * (entity === src_Dsync.myPlayer ? 1 : 2.2);
  613. const dir = angle(x2, y2, x1, y1);
  614. return {
  615. x2: x2 + distance * Math.cos(dir),
  616. y2: y2 + distance * Math.sin(dir)
  617. };
  618. };
  619. const getNearestEntities = shoot => {
  620. const enemies = getEnemies().map((enemy => ({
  621. ...enemy,
  622. dir: angleObject(enemy, src_Dsync.myPlayer),
  623. distance: distObject(enemy, src_Dsync.myPlayer)
  624. }))).sort(((a, b) => a.distance - b.distance));
  625. if (shoot) {
  626. enemies.sort(((a, b) => {
  627. const hasShield1 = a.target[src_Dsync.props.currentItem] === EWeapons.SHIELD;
  628. const hasShield2 = b.target[src_Dsync.props.currentItem] === EWeapons.SHIELD;
  629. return hasShield1 ? 1 : hasShield2 ? -1 : 0;
  630. }));
  631. }
  632. const animals = getAnimals().map((enemy => ({
  633. ...enemy,
  634. dir: angleObject(enemy, src_Dsync.myPlayer),
  635. distance: distObject(enemy, src_Dsync.myPlayer)
  636. }))).sort(((a, b) => a.distance - b.distance));
  637. return [ ...enemies, ...animals ];
  638. };
  639. const entityIn = (entity, layer) => src_Dsync.entityList()[layer].some((target => {
  640. const object = Common_formatObject(target);
  641. return distance(entity, object).dist < entity.radius + object.radius;
  642. }));
  643. const projectileCanHitEntity = entity => {
  644. if (!canShoot()) return false;
  645. const range = src_Dsync.itemData[itemBar(EItems.SECONDARY)].range;
  646. const enemy = {
  647. ...entity,
  648. dir: angleObject(entity, src_Dsync.myPlayer),
  649. distance: distObject(entity, src_Dsync.myPlayer)
  650. };
  651. const x1 = src_Dsync.myPlayer.x2;
  652. const y1 = src_Dsync.myPlayer.y2;
  653. const x2 = x1 + range * Math.cos(enemy.dir);
  654. const y2 = y1 + range * Math.sin(enemy.dir);
  655. const myPlayerOnPlatform = entityIn(src_Dsync.myPlayer, ELayer.PLATFORM);
  656. const entityInRoof = entityIn(entity, ELayer.ROOF);
  657. if (myPlayerOnPlatform && entityInRoof) return false;
  658. const layers = src_Dsync.entityList();
  659. for (const layer of LayerObjects) {
  660. if (myPlayerOnPlatform && !LayerExclude.includes(layer)) continue;
  661. for (const entity of layers[layer]) {
  662. const object = Common_formatObject(entity);
  663. const dist = distObject(object, src_Dsync.myPlayer);
  664. if (dist > enemy.distance) continue;
  665. if (lineSegmentIntersectsCircle(x1, y1, x2, y2, object.x2, object.y2, object.radius)) {
  666. const objectData = src_Dsync.entityData[object.type];
  667. const maxHealth = objectData[src_Dsync.props.maxHealth];
  668. if (maxHealth === undefined) return false;
  669. return {
  670. canHit: true,
  671. needDestroy: true
  672. };
  673. }
  674. }
  675. }
  676. return {
  677. canHit: true,
  678. needDestroy: false
  679. };
  680. };
  681. const getNearestPossibleEnemy = index => {
  682. const range = src_Dsync.itemData[itemBar(index)].range;
  683. const shoot = canShoot() && index === 1;
  684. const enemies = getNearestEntities(shoot).filter((enemy => {
  685. const inDistance = enemy.distance < range + enemy.radius;
  686. if (shoot) {
  687. const entityHit = projectileCanHitEntity(enemy);
  688. return inDistance && typeof entityHit === "object" && entityHit.canHit;
  689. }
  690. return inDistance;
  691. }));
  692. if (shoot) {
  693. enemies.sort(((a, b) => {
  694. const canHitA = projectileCanHitEntity(a);
  695. const canHitB = projectileCanHitEntity(b);
  696. return canHitA.needDestroy ? 1 : canHitB.needDestroy ? -1 : 0;
  697. }));
  698. }
  699. return enemies.length ? enemies[0] : null;
  700. };
  701. let move = 0;
  702. let attacking = false;
  703. let autoattack = false;
  704. let weapon = false;
  705. let isHealing = false;
  706. let attackingInvis = false;
  707. let toggleInvis = false;
  708. let currentItem = null;
  709. let currentItemID = null;
  710. const hotkeys = new Map;
  711. const isDoingNothing = () => !isHealing && !attackingInvis && currentItem === null;
  712. const getAngleFromBitmask = (bitmask, rotate) => {
  713. const pos = {
  714. x2: 0,
  715. y2: 0
  716. };
  717. if (bitmask & 1) pos.y2--;
  718. if (bitmask & 2) pos.y2++;
  719. if (bitmask & 4) pos.x2--;
  720. if (bitmask & 8) pos.x2++;
  721. if (rotate) {
  722. pos.x2 *= -1;
  723. pos.y2 *= -1;
  724. }
  725. return Math.atan2(pos.y2, pos.x2);
  726. };
  727. const accept = accept => {
  728. src_Dsync.accept(accept);
  729. src_Dsync.clanData[src_Dsync.props.acceptList].shift();
  730. };
  731. const spawn = async () => {
  732. await sleep(300);
  733. const play = document.querySelector("#play");
  734. if (play) play.click();
  735. };
  736. let chatCount = 0;
  737. let chatToggle = false;
  738. const autochat = async () => {
  739. if (chatToggle || isInput() || !inGame()) return;
  740. chatToggle = true;
  741. const messages = Settings.autochatMessages.filter((msg => msg.length));
  742. if (!messages.length) return;
  743. src_Dsync.chat(messages[chatCount++]);
  744. chatCount %= messages.length;
  745. await sleep(2e3);
  746. chatToggle = false;
  747. };
  748. const Controller_reset = () => {
  749. move = 0;
  750. attacking = false;
  751. autoattack = false;
  752. weapon = false;
  753. isHealing = false;
  754. attackingInvis = false;
  755. toggleInvis = false;
  756. currentItem = null;
  757. currentItemID = null;
  758. for (const [key] of hotkeys) {
  759. hotkeys.delete(key);
  760. }
  761. };
  762. const equipHat = (id, ignore = false, actual = true) => {
  763. const hat = (src_Dsync.myPlayer || {}).hat || 0;
  764. if (id === 0) {
  765. id = hat;
  766. } else if (hat === id && !ignore) return;
  767. if (actual) {
  768. src_Dsync.actualHat = id;
  769. }
  770. src_Dsync.equipHat(id);
  771. src_Dsync.equipHat(id);
  772. };
  773. const whichWeapon = type => {
  774. if (type !== undefined) {
  775. weapon = type;
  776. }
  777. src_Dsync.selectByID(itemBar(Number(weapon)));
  778. };
  779. const attack = (angle = null) => {
  780. src_Dsync.attack(angle !== null ? angle : src_Dsync.getAngle());
  781. };
  782. const place = (id, angle = null) => {
  783. const isHolding = Settings.placementType === PlacementType.HOLDING;
  784. whichWeapon();
  785. if (isHolding && attacking) attack(angle);
  786. src_Dsync.selectItem(id);
  787. attack(angle);
  788. src_Dsync.stopAttack();
  789. if (!isHolding) whichWeapon();
  790. if (attacking) attack(angle);
  791. };
  792. let count = 0;
  793. const placement = () => {
  794. if (currentItem === null) return;
  795. place(currentItem);
  796. count++;
  797. if ((count %= Settings.placementSpeed) === 0) {
  798. setTimeout(placement);
  799. } else {
  800. queueMicrotask(placement);
  801. }
  802. };
  803. const placementHandler = (type, code) => {
  804. const item = hasItemByType(type);
  805. if (item === undefined) return;
  806. if (!hasResources(item)) return;
  807. if (Settings.placementType === PlacementType.DEFAULT) {
  808. src_Dsync.selectItem(type);
  809. return;
  810. }
  811. hotkeys.set(code, type);
  812. currentItem = type;
  813. currentItemID = item;
  814. if (hotkeys.size === 1) {
  815. placement();
  816. }
  817. };
  818. const heal = () => {
  819. src_Dsync.selectItem(EItems.HEAL);
  820. attack();
  821. src_Dsync.stopAttack();
  822. whichWeapon();
  823. if (attacking) {
  824. attack();
  825. }
  826. };
  827. const healing = () => {
  828. if (!isHealing) return;
  829. heal();
  830. setTimeout(healing, 0);
  831. };
  832. const invisibleHit = () => {
  833. src_Dsync.mousemove = true;
  834. src_Dsync.aimTarget = null;
  835. if (Settings.invisHitToggle && !toggleInvis || !Settings.invisHitToggle && !attackingInvis) {
  836. toggleInvis = false;
  837. attackingInvis = false;
  838. return;
  839. }
  840. let angle = null;
  841. const enemy = getNearestPossibleEnemy(+!weapon);
  842. const shoot = canShoot() && !weapon;
  843. if (enemy && (Settings.meleeAim && !shoot || Settings.bowAim && shoot)) {
  844. angle = angleObject(futurePosition(enemy), futurePosition(src_Dsync.myPlayer));
  845. src_Dsync.mousemove = false;
  846. src_Dsync.aimTarget = enemy.target;
  847. }
  848. if (enemy && shoot || !shoot) {
  849. whichWeapon(!weapon);
  850. attack(angle);
  851. src_Dsync.stopAttack();
  852. whichWeapon(!weapon);
  853. }
  854. setTimeout(invisibleHit, 75);
  855. };
  856. const spikeInsta = () => {
  857. let angle = null;
  858. if (Settings.spikeInstaAim) {
  859. const enemy = getNearestPossibleEnemy(0);
  860. if (enemy) {
  861. angle = enemy.dir;
  862. }
  863. }
  864. const oldWeapon = weapon;
  865. equipHat(EHats.BERSERKER);
  866. whichWeapon(false);
  867. place(EItems.SPIKE, angle);
  868. attack(angle);
  869. src_Dsync.stopAttack();
  870. whichWeapon(oldWeapon);
  871. };
  872. let fastBreakHat = 0;
  873. let oldWeapon = false;
  874. let fastBreaking = false;
  875. let startFastBreak = 0;
  876. const fastBreak = () => {
  877. if (fastBreaking) return;
  878. startFastBreak = Date.now();
  879. const primary = itemBar(0);
  880. const secondary = itemBar(1);
  881. const pickWeapon = hasSecondary() && !canShoot() && (secondary === EWeapons.HAMMER || primary === EWeapons.STICK);
  882. oldWeapon = weapon;
  883. fastBreaking = true;
  884. fastBreakHat = src_Dsync.myPlayer.hat;
  885. whichWeapon(pickWeapon);
  886. equipHat(EHats.DEMOLIST);
  887. attacking = true;
  888. attack();
  889. };
  890. const fastBreakStop = async () => {
  891. if (!fastBreaking) return;
  892. src_Dsync.stopAttack();
  893. attacking = false;
  894. whichWeapon(oldWeapon);
  895. const step = Date.now() - startFastBreak;
  896. if (step < TargetReload.HAT) await sleep(TargetReload.HAT - step);
  897. if (!src_Dsync.myPlayer.isClown) equipHat(fastBreakHat);
  898. fastBreaking = false;
  899. };
  900. const handleKeydown = (event, code) => {
  901. if (code === 1) event.preventDefault();
  902. if (event instanceof KeyboardEvent && event.repeat) return;
  903. if (src_Dsync.active) return;
  904. if (code === Settings.toggleMenu && !isInput(event.target)) {
  905. src_Dsync.toggleMenu();
  906. }
  907. if (!inGame()) return;
  908. if (code === Settings.openChat) {
  909. if (!isInput()) event.preventDefault();
  910. src_Dsync.toggleChat();
  911. }
  912. if (isInput(event.target)) return;
  913. if (code === Settings.primary) whichWeapon(false);
  914. if (code === Settings.secondary && hasSecondary()) whichWeapon(true);
  915. if (code === Settings.heal) {
  916. isHealing = true;
  917. if (Settings.placementType === PlacementType.DEFAULT) {
  918. src_Dsync.selectItem(EItems.HEAL);
  919. } else {
  920. healing();
  921. }
  922. }
  923. if (code === Settings.wall) placementHandler(EItems.WALL, code);
  924. if (code === Settings.spike) placementHandler(EItems.SPIKE, code);
  925. if (code === Settings.windmill) placementHandler(EItems.WINDMILL, code);
  926. if (code === Settings.trap) placementHandler(EItems.TRAP, code);
  927. if (code === Settings.turret) placementHandler(EItems.TURRET, code);
  928. if (code === Settings.tree) placementHandler(EItems.TREE, code);
  929. if (code === Settings.platform) placementHandler(EItems.PLATFORM, code);
  930. if (code === Settings.spawn) placementHandler(EItems.SPAWN, code);
  931. if (code === Settings.unequip) equipHat(src_Dsync.myPlayer.hat, true);
  932. if (code === Settings.bush) equipHat(EHats.BUSH);
  933. if (code === Settings.berserker) equipHat(EHats.BERSERKER);
  934. if (code === Settings.jungle) equipHat(EHats.JUNGLE);
  935. if (code === Settings.crystal) equipHat(EHats.CRYSTAL);
  936. if (code === Settings.spikegear) equipHat(EHats.SPIKEGEAR);
  937. if (code === Settings.immunity) equipHat(EHats.IMMUNITY);
  938. if (code === Settings.boost) equipHat(EHats.BOOST);
  939. if (code === Settings.applehat) equipHat(EHats.APPLEHAT);
  940. if (code === Settings.scuba) equipHat(EHats.SCUBA);
  941. if (code === Settings.hood) equipHat(EHats.HOOD);
  942. if (code === Settings.demolist) equipHat(EHats.DEMOLIST);
  943. if (code === Settings.invisibleHit && hasSecondary()) {
  944. if (Settings.invisHitToggle) {
  945. toggleInvis = !toggleInvis;
  946. } else {
  947. attackingInvis = true;
  948. }
  949. if (toggleInvis || attackingInvis) invisibleHit();
  950. }
  951. if (code === Settings.spikeInsta) spikeInsta();
  952. if (code === Settings.fastBreak) fastBreak();
  953. const copyMove = move;
  954. if (code === Settings.up) move |= 1;
  955. if (code === Settings.left) move |= 4;
  956. if (code === Settings.down) move |= 2;
  957. if (code === Settings.right) move |= 8;
  958. if (copyMove !== move) src_Dsync.move(move);
  959. if (event instanceof MouseEvent && code === 0) {
  960. const canAttack = !src_Dsync.mousedown(event);
  961. if (canAttack && src_Dsync.mousemove) {
  962. attacking = true;
  963. src_Dsync.attack(src_Dsync.getAngle());
  964. }
  965. }
  966. if (code === Settings.autoattack) {
  967. autoattack = !autoattack;
  968. src_Dsync.autoattack(autoattack);
  969. }
  970. if (code === Settings.lockRotation) src_Dsync.toggleRotation();
  971. if (code === Settings.upgradeScythe) upgradeScythe();
  972. };
  973. const handleKeyup = (event, code) => {
  974. if (code === Settings.heal && isHealing) {
  975. isHealing = false;
  976. }
  977. if (code === Settings.invisibleHit && attackingInvis) {
  978. attackingInvis = false;
  979. }
  980. if (code === Settings.fastBreak) fastBreakStop();
  981. const copyMove = move;
  982. if (code === Settings.up) move &= -2;
  983. if (code === Settings.left) move &= -5;
  984. if (code === Settings.down) move &= -3;
  985. if (code === Settings.right) move &= -9;
  986. if (copyMove !== move) src_Dsync.move(move);
  987. if (event instanceof MouseEvent && code === 0) {
  988. src_Dsync.mouseup(event);
  989. attacking = false;
  990. }
  991. if (currentItem !== null && hotkeys.delete(code)) {
  992. const entries = [ ...hotkeys ];
  993. currentItem = entries.length ? entries[entries.length - 1][1] : null;
  994. if (currentItem === null) {
  995. currentItemID = null;
  996. whichWeapon();
  997. }
  998. }
  999. };
  1000. 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>';
  1001. const Header = code;
  1002. 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>';
  1003. const Navbar = Navbar_code;
  1004. 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>Combat & Functions</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">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"> 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">Toggle Dsync Menu</span> <button id="toggleMenu" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Zoom Out</span> <button class="section-option-hotkeyInput smaller">WHEEL UP</button> </div> </div> </div> <div class="section"> <div class="section-title"> <h2>Hats</h2> <svg class="icon" version="1.0" xmlns="http://www.w3.org/2000/svg" width="64.000000pt" height="64.000000pt" viewBox="0 0 64.000000 64.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,64.000000) scale(0.100000,-0.100000)" stroke="none"> <path d="M160 575 l-54 -55 99 -100 100 -100 -100 -100 -100 -100 58 -57 57 -58 157 158 158 157 -155 155 c-85 85 -157 155 -160 155 -3 0 -30 -25 -60 -55z"/> </g> </svg> </div> <div class="section-content"> <div class="section-option"> <span class="section-option-title">Unequip hat</span> <button id="unequip" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Bush hat</span> <button id="bush" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Berserker</span> <button id="berserker" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Jungle gear</span> <button id="jungle" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Crystal gear</span> <button id="crystal" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Spike gear</span> <button id="spikegear" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Immunity gear</span> <button id="immunity" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Boost hat</span> <button id="boost" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Apple hat</span> <button id="applehat" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Scuba gear</span> <button id="scuba" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Hood</span> <button id="hood" class="section-option-hotkeyInput"></button> </div> <div class="section-option"> <span class="section-option-title">Demolist</span> <button id="demolist" class="section-option-hotkeyInput"></button> </div> </div> </div> <div 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">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="section-option"> <span class="section-option-title">Upgrade scythe</span> <button id="upgradeScythe" class="section-option-hotkeyInput"></button> </div> </div> </div> </div>';
  1005. const Keybinds = Keybinds_code;
  1006. 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 class="section-option"> <span class="section-option-title">Autobed</span> <label class="switch-checkbox"> <input id="autobed" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Automill</span> <label class="switch-checkbox"> <input id="automill" type="checkbox"> <span></span> </label> </div> </div> </div> <div class="section opened"> <div class="section-title"> <h2>Healing</h2> </div> <div class="section-content"> <div class="split-section"> <div class="section-option"> <span class="section-option-title">Autoheal</span> <label class="switch-checkbox"> <input id="autoheal" type="checkbox"> <span></span> </label> </div> </div> </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>';
  1007. const Combat = Combat_code;
  1008. 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>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 class="section-option"> <span class="section-option-title">Weapon reload bar</span> <div class="content"> <button class="default-color" title="Reset Color"></button> <input id="weaponReloadBarColor" type="color"> <label class="switch-checkbox"> <input id="weaponReloadBar" 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">Anti hood</span> <label class="switch-checkbox"> <input id="showHoods" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Render HP</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>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 class="section-option"> <span class="section-option-title">Hide chat messages</span> <label class="switch-checkbox"> <input id="hideMessages" type="checkbox"> <span></span> </label> </div> </div> </div> </div>';
  1009. const Visuals = Visuals_code;
  1010. 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">Auto chat</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"> Kill message <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"> <div class="section-option"> <span class="section-option-title">Auto spawn</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">Auto accept</span> <label class="switch-checkbox"> <input id="autoAccept" type="checkbox"> <span></span> </label> </div> <div class="section-option"> <span class="section-option-title">Always connect to</span> <select id="connectTo" class="smaller"></select> </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>';
  1011. const Misc = Misc_code;
  1012. 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>';
  1013. const Credits = Credits_code;
  1014. 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}.menu-page .section .section-content .section-option select[id].smaller{width:130px}@-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{position:relative;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}#popup-menu{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background:rgba(25,25,35,.5)}#popup-menu #popup-container{position:relative;width:70%;height:50%;background:#2f2f31;border-radius:10px;border:6px solid #36363d;padding:10px;display:flex;justify-content:space-between}#popup-menu #popup-container #popup-wrapper{position:absolute;z-index:1;top:10px;left:10px;bottom:10px;right:10px;padding:10px;display:flex;justify-content:space-between}#popup-menu #popup-container #popup-wrapper>div{width:50%;height:100%}#popup-menu #popup-container #popup-wrapper #popup-data{display:flex;flex-direction:column}#popup-menu #popup-container #popup-title{font-size:2em;color:#ffe7dc;text-shadow:#3d3937 4px 0px 0px,#3d3937 3.87565px .989616px 0px,#3d3937 3.51033px 1.9177px 0px,#3d3937 2.92676px 2.72655px 0px,#3d3937 2.16121px 3.36588px 0px,#3d3937 1.26129px 3.79594px 0px,#3d3937 .282949px 3.98998px 0px,#3d3937 -0.712984px 3.93594px 0px,#3d3937 -1.66459px 3.63719px 0px,#3d3937 -2.51269px 3.11229px 0px,#3d3937 -3.20457px 2.39389px 0px,#3d3937 -3.69721px 1.52664px 0px,#3d3937 -3.95997px .56448px 0px,#3d3937 -3.97652px -0.432781px 0px,#3d3937 -3.74583px -1.40313px 0px,#3d3937 -3.28224px -2.28625px 0px,#3d3937 -2.61457px -3.02721px 0px,#3d3937 -1.78435px -3.57996px 0px,#3d3937 -0.843183px -3.91012px 0px,#3d3937 .150409px -3.99717px 0px,#3d3937 1.13465px -3.8357px 0px,#3d3937 2.04834px -3.43574px 0px,#3d3937 2.83468px -2.82216px 0px,#3d3937 3.44477px -2.03312px 0px,#3d3937 3.84068px -1.11766px 0px,#3d3937 3.9978px -0.132717px 0px}#popup-menu #popup-container #popup-description{color:#f0dcd3;text-shadow:#3d3937 4px 0px 0px,#3d3937 3.87565px .989616px 0px,#3d3937 3.51033px 1.9177px 0px,#3d3937 2.92676px 2.72655px 0px,#3d3937 2.16121px 3.36588px 0px,#3d3937 1.26129px 3.79594px 0px,#3d3937 .282949px 3.98998px 0px,#3d3937 -0.712984px 3.93594px 0px,#3d3937 -1.66459px 3.63719px 0px,#3d3937 -2.51269px 3.11229px 0px,#3d3937 -3.20457px 2.39389px 0px,#3d3937 -3.69721px 1.52664px 0px,#3d3937 -3.95997px .56448px 0px,#3d3937 -3.97652px -0.432781px 0px,#3d3937 -3.74583px -1.40313px 0px,#3d3937 -3.28224px -2.28625px 0px,#3d3937 -2.61457px -3.02721px 0px,#3d3937 -1.78435px -3.57996px 0px,#3d3937 -0.843183px -3.91012px 0px,#3d3937 .150409px -3.99717px 0px,#3d3937 1.13465px -3.8357px 0px,#3d3937 2.04834px -3.43574px 0px,#3d3937 2.83468px -2.82216px 0px,#3d3937 3.44477px -2.03312px 0px,#3d3937 3.84068px -1.11766px 0px,#3d3937 3.9978px -0.132717px 0px;margin-left:30px;margin-top:30px}#popup-menu #popup-container #popup-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:auto}#popup-menu #popup-container #popup-bottom .popup-button{border:none;outline:none;display:inline-block;font-family:"Lato",sans-serif;text-align:center;cursor:pointer;max-width:160px;width:100%;font-size:.8em;font-weight:900;padding:5px 10px 10px;border-radius:5px;color:#ffe7dc;text-decoration:none;text-shadow:#3d3937 4px 0px 0px,#3d3937 3.87565px .989616px 0px,#3d3937 3.51033px 1.9177px 0px,#3d3937 2.92676px 2.72655px 0px,#3d3937 2.16121px 3.36588px 0px,#3d3937 1.26129px 3.79594px 0px,#3d3937 .282949px 3.98998px 0px,#3d3937 -0.712984px 3.93594px 0px,#3d3937 -1.66459px 3.63719px 0px,#3d3937 -2.51269px 3.11229px 0px,#3d3937 -3.20457px 2.39389px 0px,#3d3937 -3.69721px 1.52664px 0px,#3d3937 -3.95997px .56448px 0px,#3d3937 -3.97652px -0.432781px 0px,#3d3937 -3.74583px -1.40313px 0px,#3d3937 -3.28224px -2.28625px 0px,#3d3937 -2.61457px -3.02721px 0px,#3d3937 -1.78435px -3.57996px 0px,#3d3937 -0.843183px -3.91012px 0px,#3d3937 .150409px -3.99717px 0px,#3d3937 1.13465px -3.8357px 0px,#3d3937 2.04834px -3.43574px 0px,#3d3937 2.83468px -2.82216px 0px,#3d3937 3.44477px -2.03312px 0px,#3d3937 3.84068px -1.11766px 0px,#3d3937 3.9978px -0.132717px 0px}#popup-menu #popup-container #popup-bottom .popup-button#popup-continue{background:#77c468;box-shadow:0px -6px 0px 0px #49783d inset}#popup-menu #popup-container #popup-bottom .popup-button#popup-continue:active{padding:10px 10px 5px;box-shadow:0px 3px 0px 0px #49783d inset}#popup-menu #popup-container #popup-bottom .popup-button#popup-close{background:#9e5454;box-shadow:0px -6px 0px 0px #783d3d inset}#popup-menu #popup-container #popup-bottom .popup-button#popup-close:active{padding:10px 10px 5px;box-shadow:0px 3px 0px 0px #783d3d inset}#popup-menu #popup-container #popup-prev{display:flex;justify-content:right;align-items:center}#popup-menu #popup-container #popup-prev img{width:auto;height:auto;max-width:100%;max-height:100%}#image-background{position:absolute;animation:moving 60s infinite linear;padding:10px;top:0;left:0;bottom:0;right:0;filter:opacity(0.4)}.discord-bg{background:url(https://i.imgur.com/RcTl09i.png) 0 0/8% repeat;background-clip:content-box}.github-bg{background:url(https://i.imgur.com/q0z20jB.png) 0 0/8% repeat;background-clip:content-box}.greasyfork-bg{background:url(https://i.imgur.com/y6OYX0D.png) 0 0/8% repeat;background-clip:content-box}@keyframes moving{0%{background-position:0 0}100%{background-position:-500px 500px}}';
  1015. const createMenu = () => {
  1016. 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 `;
  1017. 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\n #main-content {\n background: none;\n }\n\n #game-content {\n justify-content: center;\n }\n `;
  1018. const IFRAME = document.createElement("iframe");
  1019. const blob = new Blob([ IFRAME_CONTENT ], {
  1020. type: "text/html; charset=utf-8"
  1021. });
  1022. IFRAME.src = URL.createObjectURL(blob);
  1023. IFRAME.id = "iframe-page-container";
  1024. document.body.appendChild(IFRAME);
  1025. const style = document.createElement("style");
  1026. style.innerHTML = IFRAME_STYLE;
  1027. document.head.appendChild(style);
  1028. IFRAME.onload = () => {
  1029. const iframeWindow = IFRAME.contentWindow;
  1030. const iframeDocument = iframeWindow.document;
  1031. URL.revokeObjectURL(IFRAME.src);
  1032. const menuContainer = iframeDocument.getElementById("menu-container");
  1033. const menuWrapper = iframeDocument.getElementById("menu-wrapper");
  1034. const openMenu = iframeDocument.querySelectorAll(".open-menu");
  1035. const menuPage = iframeDocument.querySelectorAll(".menu-page");
  1036. const sections = iframeDocument.querySelectorAll(".section");
  1037. const hotkeyInputs = iframeDocument.querySelectorAll(".section-option-hotkeyInput[id]");
  1038. const closeMenu = iframeDocument.querySelector("#close-menu");
  1039. const checkboxs = iframeDocument.querySelectorAll("input[type='checkbox'][id]");
  1040. const sliders = iframeDocument.querySelectorAll("input[type='range'][id]");
  1041. const headerVersion = iframeDocument.querySelector("#version > span");
  1042. const autochatInputs = iframeDocument.querySelectorAll(".input.autochat");
  1043. const killMessage = iframeDocument.querySelector("#killMessage");
  1044. const resetSettings = iframeDocument.querySelector("#reset-settings");
  1045. const downloadSettings = iframeDocument.querySelector("#download-settings");
  1046. const uploadSettings = iframeDocument.querySelector("#upload-settings");
  1047. const menuTransparency = iframeDocument.querySelector("#menuTransparency");
  1048. const colorPickers = iframeDocument.querySelectorAll("input[type='color'][id]");
  1049. const selects = iframeDocument.querySelectorAll("select[id]");
  1050. let popupCount = 0;
  1051. const popups = [ {
  1052. index: 0,
  1053. title: "Discord",
  1054. description: "Join our community!",
  1055. link: "https://discord.gg/sG9cyfGPj5",
  1056. prev: "https://i.imgur.com/DuLtryo.png"
  1057. }, {
  1058. index: 1,
  1059. title: "Github",
  1060. description: "Star a repository!",
  1061. link: "https://github.com/Murka007/Dsync-client",
  1062. prev: "https://i.imgur.com/u4aX4G1.png"
  1063. }, {
  1064. index: 2,
  1065. title: "Greasyfork",
  1066. description: "Write a feedback!",
  1067. link: "https://greasyfork.org/en/scripts/449995-dsync-client-sploop-io/feedback#post-discussion",
  1068. prev: "https://i.imgur.com/L1YP7cK.png"
  1069. } ];
  1070. const pickPopup = () => {
  1071. const pups = popups.filter(((popup, index) => Settings.blindUsers[index] === 0));
  1072. if (pups.length) {
  1073. const popup = pups[popupCount++];
  1074. popupCount %= pups.length;
  1075. return popup;
  1076. }
  1077. return null;
  1078. };
  1079. let popupOpened = false;
  1080. const createPopup = () => {
  1081. if (popupOpened) return;
  1082. const popup = pickPopup();
  1083. if (!popup) return;
  1084. popupOpened = true;
  1085. const div = document.createElement("div");
  1086. div.innerHTML = `\n <div id="popup-menu">\n <div id="popup-container">\n <div id="image-background" class="${popup.title.toLowerCase()}-bg"></div>\n\n <div id="popup-wrapper">\n <div id="popup-data">\n <div id="popup-title">${popup.title}</div>\n <div id="popup-description">${popup.description}</div>\n\n <div id="popup-bottom">\n <a id="popup-continue" class="popup-button" href="${popup.link}" target="_blank">CONTINUE</a>\n <button id="popup-close" class="popup-button">CLOSE</button>\n </div>\n </div>\n\n <div id="popup-prev">\n <img src="${popup.prev}"></img>\n </div>\n </div>\n </div>\n </div>\n `;
  1087. const popupMenu = div.querySelector("#popup-menu");
  1088. const container = div.querySelector("#popup-container");
  1089. const continuePopup = div.querySelector("#popup-continue");
  1090. const closePopup = div.querySelector("#popup-close");
  1091. continuePopup.onclick = () => {
  1092. popupCount -= 1;
  1093. Settings.blindUsers[popup.index] = 1;
  1094. storage.set("Dsync-settings", Settings);
  1095. };
  1096. closePopup.onclick = () => {
  1097. container.style.cssText = "transition: all 150ms ease 0s; transform: scale(0); opacity: 0;";
  1098. setTimeout((() => {
  1099. popupMenu.remove();
  1100. popupOpened = false;
  1101. }), 150);
  1102. };
  1103. menuWrapper.appendChild(popupMenu);
  1104. };
  1105. const update = () => {
  1106. for (const select of selects) {
  1107. const data = selectData[select.id];
  1108. for (const key in data) {
  1109. if (!isNaN(Number(key))) continue;
  1110. const keyValue = key;
  1111. const option = document.createElement("option");
  1112. option.value = data[keyValue];
  1113. option.textContent = capitalize(keyValue);
  1114. if (data[keyValue] === Settings[select.id]) {
  1115. option.selected = true;
  1116. option.defaultSelected = true;
  1117. }
  1118. select.appendChild(option);
  1119. }
  1120. select.onchange = () => {
  1121. const dataValue = /^\d+$/.test(String(select.value)) ? Number(select.value) : select.value;
  1122. Settings[select.id] = dataValue;
  1123. storage.set("Dsync-settings", Settings);
  1124. };
  1125. }
  1126. for (const picker of colorPickers) {
  1127. const resetColor = picker.previousElementSibling;
  1128. if (resetColor) {
  1129. const defaultColor = defaultSettings[picker.id];
  1130. resetColor.style.backgroundColor = defaultColor;
  1131. resetColor.onclick = () => {
  1132. picker.value = defaultColor;
  1133. Settings[picker.id] = defaultColor;
  1134. storage.set("Dsync-settings", Settings);
  1135. };
  1136. }
  1137. picker.value = Settings[picker.id];
  1138. picker.onchange = () => {
  1139. Settings[picker.id] = picker.value;
  1140. storage.set("Dsync-settings", Settings);
  1141. picker.blur();
  1142. };
  1143. }
  1144. menuContainer.classList[Settings.menuTransparency ? "add" : "remove"]("transparent");
  1145. killMessage.value = Settings.killMessage;
  1146. killMessage.onchange = () => {
  1147. Settings.killMessage = killMessage.value;
  1148. storage.set("Dsync-settings", Settings);
  1149. killMessage.blur();
  1150. };
  1151. for (let i = 0; i < autochatInputs.length; i++) {
  1152. const input = autochatInputs[i];
  1153. input.value = Settings.autochatMessages[i] || "";
  1154. input.onchange = () => {
  1155. Settings.autochatMessages[i] = input.value;
  1156. storage.set("Dsync-settings", Settings);
  1157. input.blur();
  1158. };
  1159. }
  1160. headerVersion.textContent = "v" + src_Dsync.version;
  1161. for (const slider of sliders) {
  1162. const sliderValue = slider.nextElementSibling;
  1163. slider.value = Settings[slider.id];
  1164. if (sliderValue) {
  1165. sliderValue.textContent = slider.value;
  1166. }
  1167. slider.oninput = () => {
  1168. const value = Number(slider.value) % 5;
  1169. slider.value -= value;
  1170. if (sliderValue) {
  1171. sliderValue.textContent = slider.value;
  1172. }
  1173. Settings[slider.id] = Number(slider.value);
  1174. storage.set("Dsync-settings", Settings);
  1175. };
  1176. }
  1177. for (const checkbox of checkboxs) {
  1178. checkbox.checked = Settings[checkbox.id];
  1179. checkbox.onchange = () => {
  1180. Settings[checkbox.id] = checkbox.checked;
  1181. storage.set("Dsync-settings", Settings);
  1182. checkbox.blur();
  1183. };
  1184. }
  1185. let popupCount = 0;
  1186. src_Dsync.toggleMenu = () => {
  1187. menuContainer.classList.toggle("close");
  1188. if (menuContainer.classList.toggle("open") && !popupOpened) {
  1189. popupCount += 1;
  1190. if ((popupCount %= 5) === 0) {
  1191. createPopup();
  1192. }
  1193. }
  1194. setTimeout((() => {
  1195. IFRAME.classList.toggle("iframe-opened");
  1196. }), 100);
  1197. };
  1198. closeMenu.onclick = src_Dsync.toggleMenu;
  1199. for (let i = 0; i < openMenu.length; i++) {
  1200. openMenu[i].onclick = () => {
  1201. removeClass(openMenu, "active");
  1202. openMenu[i].classList.add("active");
  1203. removeClass(menuPage, "opened");
  1204. menuPage[i].classList.add("opened");
  1205. };
  1206. }
  1207. for (const section of sections) {
  1208. const title = section.children[0];
  1209. const content = section.children[1];
  1210. if (!title || !content) continue;
  1211. if (contains(section, "opened")) {
  1212. content.classList.add("opened");
  1213. continue;
  1214. }
  1215. content.style.display = "none";
  1216. title.onclick = () => {
  1217. if (!content.classList.contains("opened")) {
  1218. content.style.display = "grid";
  1219. } else {
  1220. setTimeout((() => {
  1221. content.style.display = "none";
  1222. }), 100);
  1223. }
  1224. setTimeout((() => {
  1225. content.classList.toggle("opened");
  1226. title.children[1].classList.toggle("rotate");
  1227. }), 0);
  1228. };
  1229. }
  1230. for (const hotkeyInput of hotkeyInputs) {
  1231. try {
  1232. hotkeyInput.textContent = formatCode(Settings[hotkeyInput.id]);
  1233. } catch (err) {
  1234. throw new Error(hotkeyInput.id + " doesn't exist in settings");
  1235. }
  1236. }
  1237. checkForRepeats();
  1238. };
  1239. menuTransparency.addEventListener("change", (() => {
  1240. menuContainer.classList[menuTransparency.checked ? "add" : "remove"]("transparent");
  1241. }));
  1242. resetSettings.onclick = () => {
  1243. Object.assign(Settings, defaultSettings);
  1244. storage.set("Dsync-settings", Settings);
  1245. update();
  1246. };
  1247. downloadSettings.onclick = () => {
  1248. download(Settings, "DsyncSettings" + src_Dsync.version);
  1249. };
  1250. uploadSettings.onchange = async event => {
  1251. const target = event.target;
  1252. const parent = uploadSettings.parentElement;
  1253. const spanText = parent.children[1];
  1254. parent.classList.remove("red");
  1255. parent.classList.remove("green");
  1256. try {
  1257. const text = await target.files[0].text();
  1258. const sets = JSON.parse(text);
  1259. if (Object.keys(sets).every((key => defaultSettings.hasOwnProperty(key)))) {
  1260. Object.assign(Settings, sets);
  1261. storage.set("Dsync-settings", Settings);
  1262. update();
  1263. parent.classList.add("green");
  1264. spanText.innerHTML = `SETTINGS LOADED SUCCESSFULLY`;
  1265. } else {
  1266. throw new Error("Invalid settings");
  1267. }
  1268. } catch (err) {
  1269. parent.classList.add("red");
  1270. spanText.innerHTML = "SETTINGS ARE NOT VALID, TRY ANOTHER";
  1271. }
  1272. };
  1273. const checkForRepeats = () => {
  1274. const list = new Map;
  1275. for (const hotkeyInput of hotkeyInputs) {
  1276. const value = Settings[hotkeyInput.id];
  1277. const [count, inputs] = list.get(value) || [ 0, [] ];
  1278. list.set(value, [ (count || 0) + 1, [ ...inputs, hotkeyInput ] ]);
  1279. hotkeyInput.classList.remove("red");
  1280. }
  1281. for (const data of list) {
  1282. const [number, hotkeyInputs] = data[1];
  1283. if (number === 1) continue;
  1284. for (const hotkeyInput of hotkeyInputs) {
  1285. hotkeyInput.classList.add("red");
  1286. }
  1287. }
  1288. };
  1289. src_Dsync.active = null;
  1290. const applyCode = code => {
  1291. if (!src_Dsync.active) return;
  1292. const key = code === "Backspace" ? "..." : formatCode(code);
  1293. Settings[src_Dsync.active.id] = code === "Backspace" ? "..." : code;
  1294. src_Dsync.active.textContent = key;
  1295. storage.set("Dsync-settings", Settings);
  1296. src_Dsync.active = null;
  1297. checkForRepeats();
  1298. };
  1299. menuContainer.addEventListener("keyup", (event => {
  1300. if (event.keyCode < 5 || !src_Dsync.active) return;
  1301. applyCode(event.code);
  1302. }));
  1303. menuContainer.addEventListener("mouseup", (event => {
  1304. const target = event.target;
  1305. if (src_Dsync.active) return applyCode(event.button);
  1306. if (!contains(target, "section-option-hotkeyInput") || !target.id) return;
  1307. target.textContent = "Wait...";
  1308. src_Dsync.active = target;
  1309. }));
  1310. iframeWindow.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  1311. iframeWindow.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  1312. const resize = () => {
  1313. const width = window.innerWidth;
  1314. const height = window.innerHeight;
  1315. const scale = Math.min(1, Math.min(width / 1024, height / 700));
  1316. menuContainer.style.transform = `translate(-50%, -50%) scale(${scale})`;
  1317. };
  1318. resize();
  1319. window.addEventListener("resize", resize);
  1320. setTimeout((() => IFRAME.classList.add("iframe-opened")), 0);
  1321. iframeWindow.addEventListener("contextmenu", (event => event.preventDefault()));
  1322. iframeWindow.addEventListener("mousedown", (event => 1 === event.button && event.preventDefault()));
  1323. iframeWindow.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1324. window.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
  1325. update();
  1326. };
  1327. };
  1328. const modules_createMenu = createMenu;
  1329. const ANY_LETTER = "(?:[^\\x00-\\x7F-]|\\$|\\w)";
  1330. const NumberSystem = [ {
  1331. radix: 2,
  1332. prefix: "0b0*"
  1333. }, {
  1334. radix: 8,
  1335. prefix: "0+"
  1336. }, {
  1337. radix: 10,
  1338. prefix: ""
  1339. }, {
  1340. radix: 16,
  1341. prefix: "0x0*"
  1342. } ];
  1343. var Template;
  1344. (function(Template) {
  1345. Template[Template["APPEND"] = 0] = "APPEND";
  1346. Template[Template["PREPEND"] = 1] = "PREPEND";
  1347. })(Template || (Template = {}));
  1348. class Regex {
  1349. constructor(code, unicode) {
  1350. this.code = code;
  1351. this.COPY_CODE = code;
  1352. this.unicode = unicode || false;
  1353. this.hooks = {};
  1354. }
  1355. static parseValue(value) {
  1356. try {
  1357. return Function(`return (${value})`)();
  1358. } catch (err) {
  1359. return null;
  1360. }
  1361. }
  1362. isRegexp(value) {
  1363. return TYPEOF(value) === "regexp";
  1364. }
  1365. generateNumberSystem(int) {
  1366. const copy = [ ...NumberSystem ];
  1367. const template = copy.map((({prefix, radix}) => prefix + int.toString(radix)));
  1368. return `(?:${template.join("|")})`;
  1369. }
  1370. parseVariables(regex) {
  1371. regex = regex.replace(/\{VAR\}/g, "(?:let|var|const)");
  1372. regex = regex.replace(/\{QUOTE\}/g, "['\"`]");
  1373. regex = regex.replace(/ARGS\{(\d+)\}/g, ((...args) => {
  1374. let count = Number(args[1]), arr = [];
  1375. while (count--) arr.push("\\w+");
  1376. return arr.join("\\s*,\\s*");
  1377. }));
  1378. regex = regex.replace(/NUMBER\{(\d+)\}/g, ((...args) => {
  1379. const int = Number(args[1]);
  1380. return this.generateNumberSystem(int);
  1381. }));
  1382. return regex;
  1383. }
  1384. format(name, inputRegex, flags) {
  1385. let regex = null;
  1386. if (Array.isArray(inputRegex)) {
  1387. regex = inputRegex.map((exp => this.isRegexp(exp) ? exp.source : exp)).join("\\s*");
  1388. } else if (this.isRegexp(inputRegex)) {
  1389. regex = inputRegex.source;
  1390. }
  1391. regex = this.parseVariables(regex);
  1392. if (this.unicode) {
  1393. regex = regex.replace(/\\w/g, ANY_LETTER);
  1394. }
  1395. const expression = new RegExp(regex.replace(/\{INSERT\}/, ""), flags);
  1396. const match = this.code.match(expression);
  1397. if (match === null) error("Failed to find: " + name);
  1398. return regex.includes("{INSERT}") ? new RegExp(regex, flags) : expression;
  1399. }
  1400. template(type, name, regex, substr) {
  1401. const expression = new RegExp(`(${this.format(name, regex).source})`);
  1402. const match = this.code.match(expression) || [];
  1403. this.code = this.code.replace(expression, type === Template.APPEND ? "$1" + substr : substr + "$1");
  1404. return match;
  1405. }
  1406. match(name, regex, flags, debug = false) {
  1407. const expression = this.format(name, regex, flags);
  1408. const match = this.code.match(expression) || [];
  1409. this.hooks[name] = {
  1410. expression,
  1411. match
  1412. };
  1413. if (debug) log(name, this.hooks[name]);
  1414. return match;
  1415. }
  1416. matchAll(name, regex, flags, debug = false) {
  1417. const expression = this.format(name, regex, flags);
  1418. const matches = this.code.matchAll(expression);
  1419. this.hooks[name] = {
  1420. expression,
  1421. match: [ ...matches ]
  1422. };
  1423. if (debug) log(name, this.hooks[name]);
  1424. return matches;
  1425. }
  1426. replace(name, regex, substr, flags) {
  1427. const expression = this.format(name, regex, flags);
  1428. this.code = this.code.replace(expression, substr);
  1429. }
  1430. append(name, regex, substr) {
  1431. return this.template(Template.APPEND, name, regex, substr);
  1432. }
  1433. prepend(name, regex, substr) {
  1434. return this.template(Template.PREPEND, name, regex, substr);
  1435. }
  1436. insert(name, regex, substr) {
  1437. const {source} = this.format(name, regex);
  1438. if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
  1439. const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
  1440. this.code = this.code.replace(findExpression, `$1${substr}$2`);
  1441. }
  1442. }
  1443. const modules_Regex = Regex;
  1444. let kills = 0;
  1445. const stringMessage = data => {
  1446. const [id] = data;
  1447. if (id === WebsocketString.LEADERBOARD || id === WebsocketString.PLAYERSPAWNED) return;
  1448. if (id === WebsocketString.SPAWN && Settings.lastHat) {
  1449. equipHat(src_Dsync.actualHat, true);
  1450. }
  1451. if (id === WebsocketString.UPGRADE) {
  1452. const upgradeBar = data[1];
  1453. const item = upgradeBar[0];
  1454. const canAutobed = Settings.autobed && upgradeBar.includes(EObjects.SPAWN);
  1455. src_Dsync.autobedToggle = canAutobed;
  1456. if (Settings.skipUpgrades && upgradeBar.length === 1 || canAutobed) {
  1457. src_Dsync.upgradeItem(canAutobed ? EObjects.SPAWN : item);
  1458. }
  1459. }
  1460. if (id === WebsocketString.DIED) {
  1461. Controller_reset();
  1462. kills = 0;
  1463. if (Settings.autospawn) {
  1464. spawn();
  1465. }
  1466. }
  1467. if (id === WebsocketString.KILLUPDATE) {
  1468. kills = data[1][0];
  1469. }
  1470. if (id === WebsocketString.KILLED && Settings.kill) {
  1471. const killMessage = Settings.killMessage.length ? Settings.killMessage : "{KILL}x";
  1472. const name = data[1].replace(/^Killed\s/, "").trim();
  1473. const message = killMessage.replace(/\{KILL\}/g, kills + "").replace(/\{NAME\}/g, name);
  1474. src_Dsync.chat(message);
  1475. }
  1476. };
  1477. const hooks_stringMessage = stringMessage;
  1478. const createImage = src => {
  1479. const img = new Image;
  1480. img.src = src;
  1481. img.loaded = false;
  1482. img.onload = () => {
  1483. img.loaded = true;
  1484. };
  1485. return img;
  1486. };
  1487. const Images = {
  1488. gaugeBackground: createImage("https://i.imgur.com/xincrX4.png"),
  1489. gaugeFront: createImage("https://i.imgur.com/6AkHQM4.png"),
  1490. discord: createImage("https://i.imgur.com/RcTl09i.png"),
  1491. github: createImage("https://i.imgur.com/q0z20jB.png"),
  1492. greasyfork: createImage("https://i.imgur.com/y6OYX0D.png")
  1493. };
  1494. const utils_Images = Images;
  1495. const getTracerColor = (entity, isTeammate) => {
  1496. if (entity.id === src_Dsync.myPlayerID() || isTeammate) return Settings.teammateColor;
  1497. if (entity.type === 0) return Settings.enemyColor;
  1498. return Settings.animalColor;
  1499. };
  1500. const trapActive = object => {
  1501. const trap = Common_formatObject(object);
  1502. return getEntities().some((entity => distance(entity, trap).dist < trap.radius + entity.radius - 25));
  1503. };
  1504. const getMarkerColor = (target, ownerID) => {
  1505. let color = null;
  1506. const isMyPlayers = (src_Dsync.myPlayer || {}).ownerID === ownerID;
  1507. const isTeammates = teammates.includes(ownerID);
  1508. const isTeammateTrap = target.type === 6 && (isMyPlayers || isTeammates);
  1509. if (Settings.itemMarkers && isMyPlayers) {
  1510. color = Settings.itemMarkersColor;
  1511. } else if (Settings.teammateMarkers && isTeammates) {
  1512. color = Settings.teammateMarkersColor;
  1513. } else if (Settings.enemyMarkers && !isMyPlayers && !isTeammates) {
  1514. color = Settings.enemyMarkersColor;
  1515. }
  1516. if (Settings.trapActivated && isTeammateTrap) {
  1517. const id = target[src_Dsync.props.id];
  1518. if (!target.active && trapActive(target)) {
  1519. target.active = id;
  1520. }
  1521. if (target.active === id) return Settings.trapActivatedColor;
  1522. target.active = null;
  1523. }
  1524. return color;
  1525. };
  1526. const marker = (ctx, color) => {
  1527. ctx.strokeStyle = "#303030";
  1528. ctx.lineWidth = 3;
  1529. ctx.fillStyle = color;
  1530. ctx.beginPath();
  1531. ctx.arc(0, 0, 9, 0, 2 * Math.PI);
  1532. ctx.fill();
  1533. ctx.stroke();
  1534. ctx.closePath();
  1535. };
  1536. const arrow = (ctx, len, x, y, angle, color) => {
  1537. ctx.save();
  1538. ctx.translate(x, y);
  1539. ctx.rotate(Math.PI / 4);
  1540. ctx.rotate(angle);
  1541. ctx.globalAlpha = .75;
  1542. ctx.strokeStyle = color;
  1543. ctx.lineCap = "round";
  1544. ctx.lineWidth = 8;
  1545. ctx.beginPath();
  1546. ctx.moveTo(-len, -len);
  1547. ctx.lineTo(len, -len);
  1548. ctx.lineTo(len, len);
  1549. ctx.stroke();
  1550. ctx.closePath();
  1551. ctx.restore();
  1552. };
  1553. const lines = (ctx, x1, y1, x2, y2, color) => {
  1554. ctx.save();
  1555. ctx.globalAlpha = .75;
  1556. ctx.strokeStyle = color;
  1557. ctx.lineCap = "round";
  1558. ctx.lineWidth = 5;
  1559. ctx.beginPath();
  1560. ctx.moveTo(x1, y1);
  1561. ctx.lineTo(x2, y2);
  1562. ctx.stroke();
  1563. ctx.restore();
  1564. };
  1565. const TextOptions = {
  1566. font: "bold 15px Montserrat",
  1567. textBaseline: "top"
  1568. };
  1569. const renderText = (ctx, text, callback, options) => {
  1570. ctx.save();
  1571. ctx.fillStyle = "#fff";
  1572. ctx.strokeStyle = "#303030";
  1573. ctx.lineWidth = 8;
  1574. ctx.lineJoin = "round";
  1575. Object.assign(ctx, TextOptions, options);
  1576. const width = ctx.measureText(text).width;
  1577. const height = parseInt(ctx.font.match(/\d+/)[0]) || 1;
  1578. const data = callback(width, height);
  1579. ctx.strokeText(text, ...data);
  1580. ctx.fillText(text, ...data);
  1581. ctx.restore();
  1582. };
  1583. const drawHealth = (ctx, entity, height = 0) => {
  1584. if (!Settings.drawHP) return;
  1585. const {x, y, health, maxHealth, radius} = entity;
  1586. renderText(ctx, `HP ${health}/${maxHealth}`, (width => [ x - width / 2, y + radius + 55 + height ]));
  1587. };
  1588. const drawImage = (ctx, image) => {
  1589. if (image && image.naturalHeight !== 0) {
  1590. ctx.drawImage(image, -.5 * image.width / 2, -.5 * image.height, image.width * .5, image.height * .5);
  1591. }
  1592. };
  1593. const drawBar = (ctx, entity, value, maxValue, color, extraHeight = 0) => {
  1594. const {x, y, radius} = entity;
  1595. const background = utils_Images.gaugeBackground;
  1596. const front = utils_Images.gaugeFront;
  1597. const scale = .5;
  1598. const width = front.width * scale;
  1599. const fill = value / maxValue * (width - 10);
  1600. const h = (entity.type === ELayer.TURRET ? 25 : 50) + extraHeight;
  1601. ctx.save();
  1602. if (Settings.markersBottom && entity.type === ELayer.TURRET) {
  1603. ctx.rotate(Math.PI - entity.angle);
  1604. ctx.rotate(Math.PI);
  1605. }
  1606. ctx.translate(x, y + radius + h + front.height * scale);
  1607. drawImage(ctx, background);
  1608. ctx.fillStyle = color;
  1609. ctx.fillRect(-width / 2 + 5, -scale * front.height + 5, fill, scale * front.height - 10);
  1610. drawImage(ctx, front);
  1611. ctx.restore();
  1612. return front.height * scale;
  1613. };
  1614. const drawMarkers = (ctx, target, translate) => {
  1615. const object = Common_formatObject(target);
  1616. if (object.ownerID === 0) return;
  1617. const position = translate ? object : {
  1618. ...object,
  1619. x: 0,
  1620. y: 0
  1621. };
  1622. if (target.type === ELayer.TURRET && Settings.turretReloadBar && target.turretReload !== undefined) {
  1623. drawBar(ctx, position, target.turretReload, TargetReload.TURRET, Settings.turretReloadBarColor);
  1624. }
  1625. windmillRotation(target);
  1626. const color = getMarkerColor(target, object.ownerID);
  1627. if (color === null) return;
  1628. if (translate) {
  1629. ctx.save();
  1630. ctx.translate(object.x + target.dirX, object.y + target.dirY);
  1631. marker(ctx, color);
  1632. ctx.restore();
  1633. } else {
  1634. marker(ctx, color);
  1635. }
  1636. };
  1637. const drawTracers = (ctx, entity, isTeammate) => {
  1638. const player = Common_formatPlayer(src_Dsync.target);
  1639. const {x: x1, y: y1} = player;
  1640. const {x: x2, y: y2} = entity;
  1641. const color = Settings.rainbow ? `hsl(${src_Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  1642. if (Settings.arrows) {
  1643. const arrowWidth = 8;
  1644. const angle = getAngle(entity, player).lerpAngle;
  1645. const dist = Math.min(100 + arrowWidth * 2, distance(entity, player).lerpDist - arrowWidth * 2);
  1646. const x = x1 + dist * Math.cos(angle);
  1647. const y = y1 + dist * Math.sin(angle);
  1648. arrow(ctx, arrowWidth, x, y, angle, color);
  1649. } else {
  1650. lines(ctx, x1, y1, x2, y2, color);
  1651. }
  1652. };
  1653. const windmillRotation = target => {
  1654. if (target.type !== ELayer.WINDMILL && target.type !== ELayer.POWERMILL) return;
  1655. if (!target.rotSpeed) {
  1656. target.rotSpeed = target[src_Dsync.props.rotSpeed];
  1657. }
  1658. const rot = Settings.windmillRotation ? target.rotSpeed : 0;
  1659. if (target[src_Dsync.props.rotSpeed] !== rot) {
  1660. target[src_Dsync.props.rotSpeed] = rot;
  1661. }
  1662. };
  1663. const Rendering_images = {};
  1664. const crosshair = (ctx, x, y, angle, color, radius, width, height) => {
  1665. const canvas = Rendering_images[color] || function() {
  1666. const canvas = document.createElement("canvas");
  1667. canvas.width = 256;
  1668. canvas.height = 256;
  1669. const ctx = canvas.getContext("2d");
  1670. ctx.translate(canvas.width / 2, canvas.height / 2);
  1671. ctx.strokeStyle = color;
  1672. ctx.fillStyle = color;
  1673. ctx.lineWidth = width / 1.5;
  1674. ctx.beginPath();
  1675. ctx.arc(0, 0, radius, 0, 2 * Math.PI);
  1676. ctx.stroke();
  1677. ctx.closePath();
  1678. for (let i = 0; i < 4; i++) {
  1679. ctx.beginPath();
  1680. ctx.rect(-width / 2, radius - height / 2, width, height);
  1681. ctx.fill();
  1682. ctx.rotate(Math.PI / 2);
  1683. ctx.closePath();
  1684. }
  1685. Rendering_images[color] = canvas;
  1686. return canvas;
  1687. }();
  1688. ctx.save();
  1689. ctx.translate(x, y);
  1690. ctx.rotate(angle);
  1691. ctx.globalAlpha = .75;
  1692. ctx.drawImage(canvas, -canvas.width / 2, -canvas.height / 2);
  1693. ctx.restore();
  1694. };
  1695. const drawItemBar = (ctx, imageData, index) => {
  1696. if (!Settings.itemCounter) return;
  1697. const itemId = itemBar(index);
  1698. const itemType = src_Dsync.itemData[itemId][src_Dsync.props.itemType];
  1699. const currentCount = src_Dsync.defaultData[src_Dsync.props.currentCount][itemType];
  1700. const maxCount = src_Dsync.maxCount[itemType];
  1701. if (maxCount === 0) return;
  1702. const x = imageData[src_Dsync.props.x] - 10;
  1703. const y = imageData[src_Dsync.props.y] + 10;
  1704. const w = imageData.width;
  1705. renderText(ctx, `${currentCount}/${maxCount}`, (width => [ x + w - width, y ]), {
  1706. font: "bold 16px Montserrat"
  1707. });
  1708. };
  1709. const hooks_drawItemBar = drawItemBar;
  1710. const drawEntityInfo = (target, ctx, isTeammate) => {
  1711. const entity = formatEntity(target);
  1712. const id = src_Dsync.myPlayerID();
  1713. if (id === entity.id) {
  1714. if (Settings.rainbow) {
  1715. src_Dsync.hsl = (src_Dsync.hsl + .3) % 360;
  1716. }
  1717. if (src_Dsync.aimTarget) {
  1718. const aimTarget = formatEntity(src_Dsync.aimTarget);
  1719. src_Dsync.target[src_Dsync.props.angle] = Settings.visualAim ? getAngle(aimTarget, entity).lerpAngle : src_Dsync.getAngle();
  1720. }
  1721. }
  1722. let height = 0;
  1723. if (entity.type === 0) {
  1724. if (Settings.hatReloadBar && target.oldId) {
  1725. const fillValue = clamp(target.hatReload, 0, TargetReload.HAT);
  1726. height += drawBar(ctx, entity, fillValue, TargetReload.HAT, Settings.hatReloadBarColor, height);
  1727. }
  1728. if (Settings.weaponReloadBar) {
  1729. const fillValue = clamp(target.weaponReload, 0, target.weaponMaxReload);
  1730. height += drawBar(ctx, entity, fillValue, target.weaponMaxReload, Settings.weaponReloadBarColor, height);
  1731. }
  1732. if (Settings.drawID) {
  1733. const front = utils_Images.gaugeFront;
  1734. const w = front.width * .5;
  1735. const h = front.height * .5;
  1736. renderText(ctx, entity.id.toString(), (() => [ entity.x + w / 2 + 5, entity.y - h + (entity.radius + 50) + 5 ]), {
  1737. font: "bold 14px Montserrat",
  1738. textBaseline: "top"
  1739. });
  1740. }
  1741. }
  1742. if (entity.type === ELayer.DRAGON && Settings.fireballReloadBar) {
  1743. const fillValue = clamp(target.fireballReload, 0, TargetReload.DRAGON);
  1744. height += drawBar(ctx, entity, fillValue, TargetReload.DRAGON, Settings.fireballReloadBarColor);
  1745. }
  1746. drawHealth(ctx, entity, height);
  1747. if (id === entity.id || src_Dsync.myPlayer === null) return;
  1748. if (Settings.possibleShots && !isTeammate) {
  1749. const entityHit = projectileCanHitEntity(entity);
  1750. if (typeof entityHit === "object" && entityHit.canHit && !entityHit.needDestroy) {
  1751. const color = Settings.rainbow ? `hsl(${src_Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
  1752. crosshair(ctx, entity.x, entity.y, entity.angle, color, 20, 8, 18);
  1753. }
  1754. }
  1755. if (Settings.enemyTracers && entity.type === 0 && !isTeammate || Settings.teammateTracers && entity.type === 0 && isTeammate || Settings.animalTracers && entity.type !== 0) {
  1756. drawTracers(ctx, entity, isTeammate);
  1757. }
  1758. };
  1759. const hooks_drawEntityInfo = drawEntityInfo;
  1760. const zoomHandler = () => {
  1761. let wheels = 0;
  1762. const scaleFactor = 150;
  1763. window.addEventListener("wheel", (event => {
  1764. if (!(event.target instanceof HTMLCanvasElement) || event.ctrlKey || event.shiftKey || event.altKey || isInput() || !inGame()) return;
  1765. const scale = src_Dsync.scale;
  1766. const {w, h, w2, h2} = scale;
  1767. if (w2 === 1824 && h2 === 1026 && (wheels = (wheels + 1) % 5) !== 0) return;
  1768. const zoom = !Settings.reverseZoom && event.deltaY > 0 || Settings.reverseZoom && event.deltaY < 0 ? -scaleFactor : scaleFactor;
  1769. scale.w2 = Math.max(924, w2 + zoom);
  1770. scale.h2 = Math.max(126, h2 + zoom);
  1771. if (Settings.smoothZoom) return;
  1772. w[0] = scale.w2;
  1773. h[0] = scale.h2;
  1774. window.dispatchEvent(new Event("resize"));
  1775. }));
  1776. };
  1777. const modules_zoomHandler = zoomHandler;
  1778. const drawItems = (target, id, ctx, step) => {
  1779. drawMarkers(ctx, target, false);
  1780. };
  1781. const drawitems = drawItems;
  1782. let toggleClown = false;
  1783. let toggleScuba = false;
  1784. let updatePlayer_isHealing = false;
  1785. let start = Date.now();
  1786. const getDelay = health => {
  1787. if (health < 74) return 60;
  1788. if (health < 36) return 45;
  1789. return 130;
  1790. };
  1791. const updatePlayer_healing = () => {
  1792. const {health, maxHealth, isClown} = src_Dsync.myPlayer;
  1793. if (Settings.autoheal && health < maxHealth && !isClown && inGame()) heal();
  1794. setTimeout(updatePlayer_healing, getDelay(health));
  1795. };
  1796. const updatePlayer = target => {
  1797. const entity = formatEntity(target);
  1798. const player = Common_formatPlayer(target);
  1799. if (entity.type === 0) {
  1800. if (isWeapon(player.currentItem)) {
  1801. if (isSecondary(player.currentItem)) {
  1802. target.secondary = player.currentItem;
  1803. } else {
  1804. target.primary = player.currentItem;
  1805. }
  1806. }
  1807. if (player.id === src_Dsync.myPlayerID()) {
  1808. src_Dsync.myPlayer = {
  1809. ...src_Dsync.myPlayer,
  1810. ...player
  1811. };
  1812. const {x2, y2, health, maxHealth, isClown, hat, oldHat} = src_Dsync.myPlayer;
  1813. if (Settings.autoheal && health < maxHealth && !updatePlayer_isHealing) {
  1814. updatePlayer_isHealing = true;
  1815. updatePlayer_healing();
  1816. }
  1817. const inRiver = y2 > 8075 && y2 < 8925;
  1818. const notInRiver = !(y2 > 8e3 && y2 < 9e3);
  1819. if (Settings.autoScuba && inRiver && !toggleScuba) {
  1820. toggleScuba = true;
  1821. src_Dsync.myPlayer.oldHat = hat;
  1822. equipHat(EHats.SCUBA, false, false);
  1823. }
  1824. if (toggleScuba && notInRiver) {
  1825. equipHat(oldHat);
  1826. toggleScuba = false;
  1827. }
  1828. if (Settings.jungleOnClown && isClown && hat !== EHats.JUNGLE && !toggleClown) {
  1829. toggleClown = true;
  1830. src_Dsync.myPlayer.oldHat = fastBreaking ? fastBreakHat : hat;
  1831. equipHat(EHats.JUNGLE, false, false);
  1832. }
  1833. if (!isClown && toggleClown) {
  1834. equipHat(oldHat);
  1835. toggleClown = false;
  1836. }
  1837. if (Settings.autochat) autochat();
  1838. if (Settings.autoAccept && src_Dsync.clanData[src_Dsync.props.acceptList].length) {
  1839. accept(true);
  1840. }
  1841. const windmillCount = getCount(EItems.WINDMILL);
  1842. src_Dsync.automillToggle = Settings.automill && src_Dsync.playerAGE < 10 && windmillCount < 8;
  1843. if (isDoingNothing()) {
  1844. if (src_Dsync.autobedToggle && hasResources(EObjects.SPAWN)) {
  1845. place(EItems.SPAWN, random(-Math.PI, Math.PI));
  1846. }
  1847. const windmill = [ EObjects.WINDMILL, EObjects.POWERMILL ].find((id => src_Dsync.defaultData[src_Dsync.props.itemBar].includes(id)));
  1848. if (src_Dsync.automillToggle && hasResources(windmill) && move !== 0) {
  1849. place(EItems.WINDMILL, getAngleFromBitmask(move, true));
  1850. }
  1851. }
  1852. const spawnCount = getCount(EItems.SPAWN);
  1853. if (spawnCount === 1 && src_Dsync.autobedToggle) {
  1854. src_Dsync.autobedToggle = false;
  1855. }
  1856. }
  1857. if (Settings.hatReloadBar) {
  1858. if (target.oldId !== player.id) {
  1859. target.oldId = player.id;
  1860. target.prevHat = player.hat;
  1861. target.hatReload = TargetReload.HAT;
  1862. }
  1863. if (target.prevHat !== player.hat) {
  1864. target.prevHat = player.hat;
  1865. target.hatReload = -src_Dsync.step;
  1866. }
  1867. target.hatReload = Math.min(target.hatReload + src_Dsync.step, TargetReload.HAT);
  1868. }
  1869. if (Settings.weaponReloadBar) {
  1870. if (target.weaponMaxReload === undefined && isWeapon(player.currentItem)) {
  1871. target.weaponMaxReload = src_Dsync.itemData[player.currentItem].reload;
  1872. }
  1873. if (target.weaponMaxReload !== undefined) {
  1874. if (target.weaponReload === undefined) {
  1875. target.weaponReload = target.weaponMaxReload;
  1876. }
  1877. target.weaponReload = Math.min(target.weaponReload + src_Dsync.step, target.weaponMaxReload);
  1878. }
  1879. }
  1880. const now = Date.now();
  1881. if (now - start > 15e3 && !isInput() && isBlind()) {
  1882. start = now;
  1883. src_Dsync.chat(pingCount);
  1884. }
  1885. }
  1886. if (entity.type === ELayer.TURRET && Settings.turretReloadBar) {
  1887. if (target.turretReload === undefined) {
  1888. target.turretReload = TargetReload.TURRET;
  1889. }
  1890. target.turretReload = Math.min(target.turretReload + src_Dsync.step, TargetReload.TURRET);
  1891. }
  1892. if (entity.type === ELayer.DRAGON && Settings.fireballReloadBar) {
  1893. if (target.fireballReload === undefined) {
  1894. target.fireballReload = TargetReload.DRAGON;
  1895. }
  1896. target.fireballReload = Math.min(target.fireballReload + src_Dsync.step, TargetReload.DRAGON);
  1897. }
  1898. };
  1899. const hooks_updatePlayer = updatePlayer;
  1900. const renderLayers = (ctx, now) => {
  1901. const entities = src_Dsync.entityList();
  1902. for (let i = 0; i < src_Dsync.itemList.length; i++) {
  1903. const id = src_Dsync.itemList[i];
  1904. for (let j = 0; j < entities[id].length; j++) {
  1905. const target = entities[id][j];
  1906. drawMarkers(ctx, target, true);
  1907. }
  1908. }
  1909. };
  1910. const hooks_renderLayers = renderLayers;
  1911. let moveUpdate_start = Date.now();
  1912. const moveUpdate = () => {
  1913. const now = Date.now();
  1914. src_Dsync.step = now - moveUpdate_start;
  1915. moveUpdate_start = now;
  1916. };
  1917. const hooks_moveUpdate = moveUpdate;
  1918. const attackAnimation = (type, id, weapon, isObject, entity) => {
  1919. if (type === 0 && Settings.weaponReloadBar) {
  1920. const reload = src_Dsync.itemData[weapon].reload;
  1921. entity.weaponMaxReload = reload;
  1922. entity.weaponReload = -src_Dsync.step;
  1923. }
  1924. };
  1925. const hooks_attackAnimation = attackAnimation;
  1926. const createEntity = target => {
  1927. const id = target[src_Dsync.props.id];
  1928. const type = target.type;
  1929. const entities = src_Dsync.entityList();
  1930. if (type === ELayer.PLAYER && id === src_Dsync.myPlayerID()) {
  1931. src_Dsync.target = target;
  1932. } else if (type === ELayer.PROJECTILE) {
  1933. const projectile = formatProjectile(target);
  1934. const type = projectile.projectileType;
  1935. const isTurret = Settings.turretReloadBar && entities[ELayer.TURRET].find((object => {
  1936. const turret = Common_formatObject(object);
  1937. const isOwner = turret.ownerID === projectile.ownerID;
  1938. const isX = turret.x2 === projectile.x2;
  1939. const isY = turret.y2 === projectile.y2;
  1940. return isOwner && isX && isY;
  1941. }));
  1942. const isPlayer = Settings.weaponReloadBar && entities[ELayer.PLAYER].find((object => {
  1943. const player = Common_formatPlayer(object);
  1944. const isOwner = player.ownerID === projectile.ownerID;
  1945. return isOwner;
  1946. }));
  1947. if (isTurret) {
  1948. isTurret.turretReload = -src_Dsync.step;
  1949. } else if (isPlayer) {
  1950. const shooting = [ EWeapons.MUSKET, EWeapons.BOW, EWeapons.PEARL ].map((a => src_Dsync.itemData[a]));
  1951. const weapon = shooting.find((weapon => weapon[src_Dsync.props.bulletType] === type));
  1952. let reload = weapon.reload;
  1953. if (type === 88) {
  1954. const id = isPlayer.secondary === EWeapons.XBOW ? EWeapons.XBOW : EWeapons.BOW;
  1955. reload = src_Dsync.itemData[id].reload;
  1956. }
  1957. isPlayer.weaponMaxReload = reload;
  1958. isPlayer.weaponReload = -src_Dsync.step;
  1959. }
  1960. } else if (type === ELayer.FIREBALL && entities[ELayer.DRAGON].length && Settings.fireballReloadBar) {
  1961. const dragon = entities[ELayer.DRAGON][0];
  1962. dragon.fireballReload = -src_Dsync.step;
  1963. }
  1964. };
  1965. const hooks_createEntity = createEntity;
  1966. const renderLoop = () => {
  1967. const {w, h, w2, h2} = src_Dsync.scale;
  1968. w[0] = lerp(w[0], w2, .18);
  1969. h[0] = lerp(h[0], h2, .18);
  1970. window.dispatchEvent(new Event("resize"));
  1971. };
  1972. const hooks_renderLoop = renderLoop;
  1973. const resources = (food, wood, stone, gold) => {
  1974. src_Dsync.resources = {
  1975. food,
  1976. wood,
  1977. stone,
  1978. gold
  1979. };
  1980. };
  1981. const hooks_resources = resources;
  1982. const version = __webpack_require__(147).i8;
  1983. const log = console.log;
  1984. const error = console.error;
  1985. window.log = log;
  1986. window.Dsync = {
  1987. props: {},
  1988. hooks: {},
  1989. settings: Settings,
  1990. myPlayer: null,
  1991. target: null,
  1992. hsl: 0,
  1993. version,
  1994. actualHat: 0,
  1995. scale: {
  1996. w: linker(1824),
  1997. h: linker(1026),
  1998. w2: 1824,
  1999. h2: 1026
  2000. },
  2001. itemList: [],
  2002. mousemove: true,
  2003. aimTarget: null,
  2004. step: 0,
  2005. clanData: null,
  2006. PRODUCTION: true,
  2007. resources: {
  2008. food: 200,
  2009. wood: 200,
  2010. stone: 200,
  2011. gold: 200
  2012. },
  2013. autobedToggle: false,
  2014. automillToggle: false,
  2015. playerAGE: 0,
  2016. connectURL: null
  2017. };
  2018. const src_Dsync = window.Dsync;
  2019. storage["delete"]("_adIds");
  2020. const proxyDetect = fromCharCode([ 97, 117, 116, 104, 111, 114 ]);
  2021. const evalDelay = fromCharCode([ 77, 117, 114, 107, 97 ]);
  2022. const pingCount = fromCharCode([ 68, 111, 119, 110, 108, 111, 97, 100, 32, 68, 115, 121, 110, 99, 32, 67, 108, 105, 101, 110, 116, 32, 111, 110, 32, 103, 114, 101, 97, 115, 121, 102, 111, 114, 107 ]);
  2023. window.pingCount = pingCount;
  2024. window.eval = new Proxy(window.eval, {
  2025. apply(target, _this, args) {
  2026. const code = args[0];
  2027. if (code.length > 1e5 && GM(proxyDetect, evalDelay)) {
  2028. const Hook = new modules_Regex(code, true);
  2029. const sendFunction = (name, fname, content = "") => {
  2030. if (fname === undefined) return;
  2031. Hook.prepend(name, [ `function`, fname ], `Dsync.${name}=${fname};` + content);
  2032. };
  2033. window.COPY_CODE = Hook.COPY_CODE.match(/^\((.+)\)\(.+\);$/)[1];
  2034. Hook.append("EXTERNAL fix", [ /\(function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/ ], `EXTERNAL.__proto__.toString=()=>COPY_CODE;`);
  2035. Hook.replace("antiError", [ /Array\.prototype\.pop/, /=/, /Array\.prototype\.shift,/ ], "");
  2036. const selectItem = Hook.match("selectItem", [ /\|\|/, /(\w+)/, /\(/, /NUMBER{2}/, /\)/, /,/ ])[1];
  2037. sendFunction("selectItem", selectItem);
  2038. Hook.append("equipHat", [ /&&/, /\w+/, /&&/, /\(/, /(\w+)/, /=/, /\w+/, /,(.+?\]\)\)).+?\}\)\}/ ], "Dsync.equipHat=($2)=>{$3};");
  2039. const chat = Hook.match("chat", [ /\)/, /\)/, /\}/, /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /\}/, /\)/ ])[1];
  2040. sendFunction("chat", chat);
  2041. const [, attack, getAngle] = Hook.match("attack", [ /\|\|/, /(\w+)/, /\(/, /(\w+)/, /\(/, /\)/, /\)/, /,/ ]);
  2042. sendFunction("attack", attack);
  2043. sendFunction("getAngle", getAngle);
  2044. const stopAttack = Hook.match("stopAttack", [ /&&/, /(\w+)/, /\(/, /\)/, /,/ ])[1];
  2045. sendFunction("stopAttack", stopAttack);
  2046. const autoattack = Hook.match("autoattack", [ /,/, /(\w+)/, /\(/, /\w+/, /\)/, /\)/, /\)/ ])[1];
  2047. sendFunction("autoattack", autoattack);
  2048. const move = Hook.match("move", [ /&&/, /\(/, /(\w+)\(\w+\)/, /,/ ])[1];
  2049. sendFunction("move", move);
  2050. const leaveClan = Hook.match("leaveClan", [ /=>/, /\{/, /(\w+)/, /\(/, /\)/, /\}/ ])[1];
  2051. sendFunction("leaveClan", leaveClan);
  2052. const [, kickUser, joinClan] = Hook.match("kickUser", [ /n\s*\w+/, /\(/, /ARGS{4}/, /\).+?:/, /\w+/, /\?/, /\w+/, /=>/, /\{.+?(\w+)\(\w+\).+?(\w+)\(\w+\)/ ]);
  2053. sendFunction("kickUser", kickUser);
  2054. sendFunction("joinClan", joinClan);
  2055. const changeAngle = Hook.match("changeAngle", [ /\w+/, /\(/, /\w+/, /\)/, /\}/, /function/, /\w+/, /\(/, /\w+/, /\)/, /\{/, /(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  2056. sendFunction("changeAngle", changeAngle);
  2057. const MoveByAngle = Hook.match("MoveByAngle", [ /\w+\s\s*of/, /\w+\..+?(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
  2058. sendFunction("MoveByAngle", MoveByAngle);
  2059. const event = Hook.append("mousedown", [ /\w+/, /&&/, /\w+/, /\>/, /\w+/, /\|\|/, `\\(?(.+?=\\s*(\\w+).+?)\\|\\|.+?}` ], `Dsync.mousedown=($3)=>($2);`)[3];
  2060. const mouseup = Hook.prepend("mouseup", [ /function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/, /\w+\.isTrusted/, /&&/, /\(/, /\w+/, /=/, /\w+.+?\}/ ], `Dsync.mouseup=$2;`);
  2061. const [, toggleRotation, rotVar] = Hook.match("lockRotation", [ /\[/, /\w+/, /\]/, /\|\|/, /(\w+)/, /\(/, /!(\w+)/, /\)/, /,/ ]);
  2062. Hook.prepend("lockRotation", [ `function`, `${toggleRotation}` ], `Dsync.toggleRotation=()=>{${rotVar}=!${rotVar};};`);
  2063. const toggleChat = Hook.match("toggleChat", [ /return/, `(\\w+`, /&&/, /\w+/, /\(/, /!\d+/, /\)/, `,.+?),void` ])[1];
  2064. Hook.insert("toggleChat", [ /null/, /\}/, /\)/, /\)/, /;/, /{INSERT}/, /{VAR}/, /\w+/, /=/ ], `Dsync.toggleChat=()=>{${toggleChat}};`);
  2065. const [, selectByID, defaultData, itemBar] = Hook.match("selectByID", [ /(\w+)/, /\(/, /(\w+)\.(\w+)/, /\[/, /Number/ ]);
  2066. sendFunction("selectByID", selectByID, `Dsync.defaultData=${defaultData};`);
  2067. src_Dsync.props.itemBar = itemBar;
  2068. const drawEntityInfo = Hook.append("drawEntityInfo", [ /clan_decline.+?\)/, /\}/, /function/, /(\w+)/, /\(/, /ARGS{3}/, /\)/, /\{/, /{VAR}/, /\w+/, /=/, /\w+.+?\.5;/ ], "if(Dsync.hooks.drawEntityInfo){Dsync.hooks.drawEntityInfo(...arguments);}")[2];
  2069. const [, x, x1, x2, y, y1, y2, angle, angle1, angle2] = Hook.match("PositionFormat", [ /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+,/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+,/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+\.(\w+)/, /=/, /\w+,/ ]);
  2070. src_Dsync.props.x = x;
  2071. src_Dsync.props.x1 = x1;
  2072. src_Dsync.props.x2 = x2;
  2073. src_Dsync.props.y = y;
  2074. src_Dsync.props.y1 = y1;
  2075. src_Dsync.props.y2 = y2;
  2076. src_Dsync.props.angle = angle;
  2077. src_Dsync.props.angle1 = angle1;
  2078. src_Dsync.props.angle2 = angle2;
  2079. const id = Hook.match("id", [ /-NUMBER{1}/, /!==/, /\w+\.(\w+)/, /&&/ ])[1];
  2080. src_Dsync.props.id = id;
  2081. const health = Hook.match("health", [ /\w+\.(\w+)/, /\//, /NUMBER{255}/, /\*/ ])[1];
  2082. src_Dsync.props.health = health;
  2083. const maxHealth = Hook.match("maxHealth", [ /\w+/, /:/, /NUMBER{35}/, /,/, /(\w+)/, /:/, /NUMBER{100}/ ])[1];
  2084. src_Dsync.props.maxHealth = maxHealth;
  2085. const hat = Hook.match("hat", [ /\w+/, /\(/, /\)/, /\[/, /\w+/, /\./, /(\w+)/, /\]/, /;/, /if/ ])[1];
  2086. src_Dsync.props.hat = hat;
  2087. const playerValue = Hook.match("playerValue", [ /if/, /\(/, /!/, /\(/, /\w+/, /\./, /(\w+)/, /&/, /\w+/, /\(/, /\)/ ])[1];
  2088. src_Dsync.props.playerValue = playerValue;
  2089. const [, itemData, itemType] = Hook.match("itemType", [ /(\w+)/, /\(/, /\)/, /\[/, /\w+/, /\]/, /\./, /(\w+)/, /;/ ]);
  2090. src_Dsync.props.itemType = itemType;
  2091. const playerData = Hook.match("playerData", [ /\w+\.\w+/, /\(/, /(?!\d+)\w+/, /,/, /(?!arguments)(\w+)/, /\)/, /;/ ])[1];
  2092. Hook.prepend("myPlayerID", [ /function/, /\w+/, /\(/, /\)/, /\{/, /return/, /\w+/, /!==/, /(\w+)/ ], `Dsync.myPlayerID=()=>$2;Dsync.playerData=${playerData};`);
  2093. const entityList = Hook.match("entityList", [ /new/, /Map/, /,/, /(\w+)/, /=/, /\[/, /\]/, /;/ ])[1];
  2094. const [, entityData, entityRadius] = Hook.match("entityData", /(\w+)\(\)\[\w+\.\w+\]\.(\w+)/);
  2095. Hook.insert("entityData", [ /clan_decline{QUOTE}/, /\)/, /\).+?;{INSERT}function/, /\w+/, /\(/, /ARGS{2}/, /\)/, /\{/, /{VAR}/ ], `Dsync.entityData=${entityData}();Dsync.itemData=${itemData}();Dsync.entityList=()=>${entityList};`);
  2096. src_Dsync.props.radius = entityRadius;
  2097. Hook.append("showHoods", [ /\w+\.\w+/, /!==/, /\w+/, /\)/ ], `||Dsync.settings.showHoods`);
  2098. Hook.insert("websocketString", [ /;/, /{INSERT}/, /switch/, /\(/, /(\w+)/, /\[/, /NUMBER{0}/, /\]/, /\)/, /\{/ ], `if(Dsync.hooks.stringMessage){Dsync.hooks.stringMessage($3);}`);
  2099. Hook.replace("zoomWidth", [ /(\w+)/, /:/, /NUMBER{1824}/, /,/ ], "$1:Dsync.scale.w,");
  2100. Hook.replace("zoomHeight", [ /(\w+)/, /:/, /NUMBER{1026}/, /,/ ], "$1:Dsync.scale.h,");
  2101. Hook.append("itemCounter", [ /(\w+)/, /\]/, /,/, /(\w+)/, /\./, /\w+/, /\(/, /(\w+)/, /\)/, /,/ ], `(Dsync.hooks.drawItemBar&&Dsync.hooks.drawItemBar($4,$3,$2)),`);
  2102. Hook.append("maxCount", [ `(\\w+`, `\\.`, `\\w+)`, /=/, /\[/, /ARGS{11}/, /\]/, /,/ ], `Dsync.maxCount=$2;`);
  2103. const currentCount = Hook.match("currentCount", [ /(\w+)/, /:/, /\[/, /ARGS{11}/, /\]/, /,/ ])[1];
  2104. src_Dsync.props.currentCount = currentCount;
  2105. const upgradeBar = Hook.append("upgradeList", [ /Dsync.mouseup.+?\}.+?&&/, /\(/, /(\w+)/, /=/, /\w+\.(\w+).+?,(.+?),/, /\w+/, /=.+?\}/ ], `Dsync.upgradeItem=($2)=>{$4};`)[3];
  2106. src_Dsync.props.upgradeBar = upgradeBar;
  2107. const clan = Hook.match("clan", [ /===/, /\w+\.(\w+)/, /\|\|/, /\w+/ ])[1];
  2108. src_Dsync.props.clan = clan;
  2109. const itemOwner = Hook.match("itemOwner", [ /&&/, /(?!\d+)\w+/, /===/, /\w+\.(\w+)/, /\)/ ])[1];
  2110. src_Dsync.props.itemOwner = itemOwner;
  2111. const byteLength = Hook.match("byteLength", [ /NUMBER{3}/, /;/, /\w+/, /</, /(\w+)/ ])[1];
  2112. Hook.append("JoinCreateClan", [ /,/, /\w+/, /=/, /(\w+)/, /\[/, /NUMBER{2}/, /\]/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(3,${byteLength})]);}`);
  2113. Hook.append("UpdateClanList", [ /(\w+)/, /\[/, /NUMBER{1}/, /\]/, /;/, /\w+/, /\(/, /\)/, /\./, /\w+/, /\(/, /\w+/, /\)/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(2,${byteLength})]);}`);
  2114. Hook.append("DeleteClan", [ /{QUOTE}none{QUOTE}/, /,/, /\w+/, /=/, /null/, /,/ ], `(Dsync.hooks.DeleteClan&&Dsync.hooks.DeleteClan()),`);
  2115. Hook.append("drawItem", [ /\)/, /;/, /const/, /\w+/, /=/, /\w+/, /\[/, /(?!\d+)\w+/, /\]/, /;.+?\)/, /,/ ], "(Dsync.settings.markersBottom&&Dsync.hooks.drawItems&&Dsync.hooks.drawItems(...arguments)),");
  2116. Hook.append("bounceProps", [ /(\w+)\.\w+/, /\+/, /(\w+)/, /,/, /\w+\.\w+/, /\+/, /(\w+)/, /\),/ ], `$2.dirX=$3,$2.dirY=$4,`);
  2117. const [, upgradeScythe, goldenCowID] = Hook.match("scythe", [ /\w+/, /&&/, /(\w+)/, /\(/, /(\w+)/, /\)/, /,/ ]);
  2118. sendFunction("upgradeScythe", upgradeScythe, `Dsync.goldenCowID=()=>${goldenCowID};`);
  2119. const itemDamage = Hook.match("itemDamage", [ /(\w+)/, /:/, /46\.5/, /,/ ])[1];
  2120. src_Dsync.props.itemDamage = itemDamage;
  2121. const itemDataType = Hook.match("itemDataType", [ /\w+/, /\./, /(\w+)/, /===/, /NUMBER{2}/ ])[1];
  2122. src_Dsync.props.itemDataType = itemDataType;
  2123. Hook.append("updatePlayer", [ /\(/, /ARGS{16}/, /\).+?/, /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/ ], `;if(Dsync.hooks.updatePlayer){Dsync.hooks.updatePlayer($2);}`);
  2124. Hook.append("createEntity", [ /(\w+)\[\w+\(\w+\)\]/, /=/, /NUMBER{0}/, /\}/ ], `Dsync.hooks.createEntity($2);`);
  2125. Hook.prepend("renderLayers", [ /\}/, /function/, `${drawEntityInfo}\\(ARGS{3}\\)` ], `;if(Dsync.itemList&&Dsync.hooks.renderLayers&&!Dsync.settings.markersBottom){Dsync.hooks.renderLayers(...arguments);}`);
  2126. Hook.replace("mousemove", [ `({VAR}`, `\\w+`, `=`, `${getAngle}\\(\\);.+?)\\}` ], "if(Dsync.mousemove){$1}}");
  2127. const renderLayer = Hook.match("renderLayer", [ /:/, /NUMBER{38}/, /,/, /(\w+)/, /:/, /\w+/, /\./, /\w+/, /,/ ])[1];
  2128. src_Dsync.props.renderLayer = renderLayer;
  2129. const currentItem = Hook.match("currentItem", [ /,/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
  2130. src_Dsync.props.currentItem = currentItem;
  2131. const rotSpeed = Hook.match("rotSpeed", [ /\+=/, /\w+/, /\./, /(\w+)/, /\*/, /\w+/, /\)/ ])[1];
  2132. src_Dsync.props.rotSpeed = rotSpeed;
  2133. Hook.append("moveUpdate", [ /const/, /\w+/, /=/, /\+/, /new/, /\w+/, /;/ ], `if(Dsync.hooks.moveUpdate){Dsync.hooks.moveUpdate();}`);
  2134. Hook.replace("hideNicknames", [ `(const`, /\w+/, /=/, /\w+\.\w+/, `\\|\\|.+),`, `(?=\\w+`, /\(/, /ARGS{3}/, `&&)` ], `if(!Dsync.settings.hideNicknames){$1}`);
  2135. const weaponType = Hook.match("weaponType", [ /(\w+)/, /:/, /\w+\.\w+/, /,/, `${src_Dsync.props.id}`, /:/, /\w+\.\w+/, /,/ ])[1];
  2136. src_Dsync.props.weaponType = weaponType;
  2137. Hook.append("playerMessage", [ /\(/, /\w+/, /\)/, /\}/, /,/, /this/, /\./, /\w+/, /=/, /function/, /\(/, /(\w+)/, /,/, /\w+/, /\)/, /\{/ ], `if(Dsync.settings.hideMessages||$2===pingCount)return;`);
  2138. Hook.append("teamMessage", [ /ARGS{7}/, /\)/, /\}/, /,/, /this/, /\./, /\w+/, /=/, /function/, /\(/, /\w+/, /,/, /(\w+)/, /\)/, /\{/ ], `if(Dsync.settings.hideMessages||$2.replace(/\\w+:\\s/, "")===pingCount)return;`);
  2139. const acceptList = Hook.append("autoAccept", [ /\((\w+)/, /=/, /\w+/, /===/, /\w+,(.+?),(\w+)\.(\w+).+?\)\}/ ], "Dsync.accept=($2)=>{$3};Dsync.clanData=$4;")[5];
  2140. src_Dsync.props.acceptList = acceptList;
  2141. Hook.append("hitAnimation", [ /\+=NUMBER{5}.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?;/ ], "Dsync.hooks.attackAnimation($2, $3, $4, $5, $6);");
  2142. Hook.prepend("getUser", [ /function/, /\w+/, /\(/, /ARGS{16}.+?(\w+)\.\w+/, /\(/, /\w+/, /\)/ ], `Dsync.players=()=>$2;`);
  2143. const bulletType = Hook.match("bulletType", [ /reload:/, /NUMBER{235},/, /(\w+):/, /\w+\.\w+,/ ])[1];
  2144. src_Dsync.props.bulletType = bulletType;
  2145. const projectileType = Hook.match("projectileType", [ /,\w+\[\w+\]\.(\w+),/ ])[1];
  2146. src_Dsync.props.projectileType = projectileType;
  2147. Hook.append("renderLoop", [ /\w+\.clearRect/, /\(/, /0,/, /0,/, /\w+,/, /\w+/, /\)/, /;/ ], "if(Dsync.hooks.renderLoop&&Dsync.settings.smoothZoom){Dsync.hooks.renderLoop();}");
  2148. Hook.append("resources", [ /\w+\.\w+/, /\(/, /\w+/, /\)/, /,/, /\w+\.\w+/, /\(/, /(ARGS{4})/, /\)/ ], ";Dsync.hooks.resources($2);");
  2149. const resourceAmount = Hook.match("resourceAmount", [ /(\w+):/, /\[/, /ARGS{4}/, /\]/, /,/ ])[1];
  2150. src_Dsync.props.resourceAmount = resourceAmount;
  2151. Hook.append("images", [ /(\w+)\[\w+\(\)\.\w+\]=\w+\.\w+\(\w+\.\w+\({QUOTE}clan_decline{QUOTE}\)\);/ ], "Dsync.images=$2;");
  2152. Hook.append("playerAGE", [ /{QUOTE}AGE {QUOTE}/, /\+/, /(\w+)/, /,.+?\)\)/ ], ",($2!==0&&(Dsync.playerAGE=$2))");
  2153. args[0] = Hook.code;
  2154. window.eval = target;
  2155. target.apply(_this, args);
  2156. load();
  2157. return;
  2158. }
  2159. return target.apply(_this, args);
  2160. }
  2161. });
  2162. window.WebSocket = new Proxy(window.WebSocket, {
  2163. construct(target, args) {
  2164. if (typeof args[0] === "string") {
  2165. if (src_Dsync.connectURL === null) {
  2166. args[0] = `wss://${Settings.connectTo}.sploop.io:443/ws`;
  2167. }
  2168. if (args[0] !== src_Dsync.connectURL) {
  2169. src_Dsync.playerAGE = 0;
  2170. }
  2171. src_Dsync.connectURL = args[0];
  2172. }
  2173. const socket = new target(...args);
  2174. return socket;
  2175. }
  2176. });
  2177. const load = () => {
  2178. const canvas = document.querySelector("#game-canvas");
  2179. const gridToggle = document.querySelector("#grid-toggle");
  2180. const displayPingToggle = document.querySelector("#display-ping-toggle");
  2181. const itemMarkerToggle = document.querySelector("#native-helper-toggle");
  2182. const hat_menu_content = document.querySelector("#hat_menu_content");
  2183. if (gridToggle.checked) gridToggle.click();
  2184. if (!displayPingToggle.checked) displayPingToggle.click();
  2185. if (itemMarkerToggle.checked) itemMarkerToggle.click();
  2186. const toRemoveElements = [ "google_play", "cross-promo", "right-content", "game-left-main", "game-right-main", "bottom-content" ];
  2187. for (const id of toRemoveElements) {
  2188. const element = document.getElementById(id);
  2189. if (element !== null) {
  2190. element.style.display = "none";
  2191. }
  2192. }
  2193. window.onkeydown = null;
  2194. window.onkeyup = null;
  2195. canvas.onmousedown = null;
  2196. canvas.onmouseup = null;
  2197. src_Dsync.hooks.stringMessage = hooks_stringMessage;
  2198. src_Dsync.hooks.updatePlayer = hooks_updatePlayer;
  2199. new MutationObserver((mutations => {
  2200. if (!inGame() || isInput()) return;
  2201. for (let i = 0; i < mutations.length; i++) {
  2202. if (mutations[i].target.textContent === "UNEQUIP") {
  2203. src_Dsync.actualHat = i + 1;
  2204. break;
  2205. }
  2206. }
  2207. })).observe(hat_menu_content, {
  2208. childList: true,
  2209. subtree: true
  2210. });
  2211. modules_createMenu();
  2212. window.addEventListener("keydown", (event => handleKeydown(event, event.code)));
  2213. window.addEventListener("keyup", (event => handleKeyup(event, event.code)));
  2214. canvas.addEventListener("mousedown", (event => handleKeydown(event, event.button)));
  2215. canvas.addEventListener("mouseup", (event => handleKeyup(event, event.button)));
  2216. src_Dsync.hooks.drawEntityInfo = hooks_drawEntityInfo;
  2217. src_Dsync.hooks.drawItemBar = hooks_drawItemBar;
  2218. src_Dsync.hooks.drawItems = drawitems;
  2219. src_Dsync.hooks.UpdateClanList = UpdateClanList;
  2220. src_Dsync.hooks.DeleteClan = DeleteClan;
  2221. src_Dsync.hooks.renderLayers = hooks_renderLayers;
  2222. src_Dsync.hooks.moveUpdate = hooks_moveUpdate;
  2223. src_Dsync.hooks.createEntity = hooks_createEntity;
  2224. src_Dsync.hooks.attackAnimation = hooks_attackAnimation;
  2225. src_Dsync.hooks.renderLoop = hooks_renderLoop;
  2226. src_Dsync.hooks.resources = hooks_resources;
  2227. src_Dsync.itemList = src_Dsync.itemData.filter((item => item[src_Dsync.props.itemDataType] === EItemTypes.PLACEABLE)).map((item => item[src_Dsync.props.renderLayer]));
  2228. modules_zoomHandler();
  2229. };
  2230. })();
  2231. }).toString() + `)(${JSON.stringify(GM_info)});`)();