// ==UserScript==
// @name Dsync Client [Sploop.io]
// @author Murka
// @description The most advanced hack for sploop.io
// @icon https://sploop.io/img/ui/favicon.png
// @version 1.0.15
// @match *://sploop.io/*
// @run-at document-start
// @grant none
// @license MIT
// @namespace https://greasyfork.org/users/919633
// @downloadURL none
// ==/UserScript==
/* jshint esversion:6 */
/*
Author: Murka
Github: https://github.com/Murka007/Dsync-client
Discord: https://discord.gg/sG9cyfGPj5
Greasyfork: https://greasyfork.org/en/scripts/449995-dsync-client-sploop-io
I need your support, please follow these steps:
1. Join my DISCORD server
2. Write a feedback about this script on GREASYFORK "script works, thank you so much"
3. Star my repository on GITHUB
*/
Function("(" + ((GM_info) => {
"use strict";
var __webpack_modules__ = {
147: module => {
module.exports = {
i8: "1.0.15"
};
}
};
var __webpack_module_cache__ = {};
function __webpack_require__(moduleId) {
var cachedModule = __webpack_module_cache__[moduleId];
if (cachedModule !== undefined) {
return cachedModule.exports;
}
var module = __webpack_module_cache__[moduleId] = {
exports: {}
};
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
(() => {
__webpack_require__.d = (exports, definition) => {
for (var key in definition) {
if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
Object.defineProperty(exports, key, {
enumerable: true,
get: definition[key]
});
}
}
};
})();
(() => {
__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
})();
var __webpack_exports__ = {};
(() => {
__webpack_require__.d(__webpack_exports__, {
sv: () => src_Dsync,
vU: () => error,
cM: () => log,
lZ: () => pingCount
});
var WebsocketString;
(function(WebsocketString) {
WebsocketString[WebsocketString["LEADERBOARD"] = 3] = "LEADERBOARD";
WebsocketString[WebsocketString["CONNECT"] = 12] = "CONNECT";
WebsocketString[WebsocketString["UPGRADE"] = 14] = "UPGRADE";
WebsocketString[WebsocketString["DIED"] = 19] = "DIED";
WebsocketString[WebsocketString["KILLUPDATE"] = 22] = "KILLUPDATE";
WebsocketString[WebsocketString["KILLED"] = 28] = "KILLED";
WebsocketString[WebsocketString["PLAYERSPAWNED"] = 32] = "PLAYERSPAWNED";
WebsocketString[WebsocketString["DEFAULTDATA"] = 33] = "DEFAULTDATA";
WebsocketString[WebsocketString["SPAWN"] = 35] = "SPAWN";
})(WebsocketString || (WebsocketString = {}));
var EItems;
(function(EItems) {
EItems[EItems["PRIMARY"] = 0] = "PRIMARY";
EItems[EItems["SECONDARY"] = 1] = "SECONDARY";
EItems[EItems["HEAL"] = 2] = "HEAL";
EItems[EItems["WALL"] = 3] = "WALL";
EItems[EItems["SPIKE"] = 4] = "SPIKE";
EItems[EItems["WINDMILL"] = 5] = "WINDMILL";
EItems[EItems["TREE"] = 6] = "TREE";
EItems[EItems["TRAP"] = 7] = "TRAP";
EItems[EItems["PLATFORM"] = 8] = "PLATFORM";
EItems[EItems["SPAWN"] = 9] = "SPAWN";
EItems[EItems["TURRET"] = 10] = "TURRET";
})(EItems || (EItems = {}));
var ELayer;
(function(ELayer) {
ELayer[ELayer["PLAYER"] = 0] = "PLAYER";
ELayer[ELayer["STONE"] = 1] = "STONE";
ELayer[ELayer["HARDSPIKE"] = 2] = "HARDSPIKE";
ELayer[ELayer["TREE"] = 3] = "TREE";
ELayer[ELayer["GOLD"] = 4] = "GOLD";
ELayer[ELayer["BUSH"] = 5] = "BUSH";
ELayer[ELayer["TRAP"] = 6] = "TRAP";
ELayer[ELayer["SPIKE"] = 7] = "SPIKE";
ELayer[ELayer["WOODWALL"] = 8] = "WOODWALL";
ELayer[ELayer["PLATFORM"] = 9] = "PLATFORM";
ELayer[ELayer["BOOST"] = 10] = "BOOST";
ELayer[ELayer["LOOTBOX"] = 11] = "LOOTBOX";
ELayer[ELayer["PROJECTILE"] = 12] = "PROJECTILE";
ELayer[ELayer["WINDMILL"] = 13] = "WINDMILL";
ELayer[ELayer["COW"] = 14] = "COW";
ELayer[ELayer["SPAWN"] = 15] = "SPAWN";
ELayer[ELayer["POWERMILL"] = 16] = "POWERMILL";
ELayer[ELayer["CASTLESPIKE"] = 17] = "CASTLESPIKE";
ELayer[ELayer["TURRET"] = 18] = "TURRET";
ELayer[ELayer["WOODFARM"] = 19] = "WOODFARM";
ELayer[ELayer["CHERRYWOODFARM"] = 20] = "CHERRYWOODFARM";
ELayer[ELayer["STONEWARM"] = 21] = "STONEWARM";
ELayer[ELayer["CASTLEWALL"] = 22] = "CASTLEWALL";
ELayer[ELayer["SHARK"] = 23] = "SHARK";
ELayer[ELayer["WOLF"] = 24] = "WOLF";
ELayer[ELayer["GOLDENCOW"] = 25] = "GOLDENCOW";
ELayer[ELayer["ROOF"] = 26] = "ROOF";
ELayer[ELayer["DRAGON"] = 27] = "DRAGON";
ELayer[ELayer["MAMMOTH"] = 28] = "MAMMOTH";
ELayer[ELayer["FIREBALL"] = 29] = "FIREBALL";
ELayer[ELayer["CHEST"] = 30] = "CHEST";
ELayer[ELayer["DRAGONWALLBIG"] = 31] = "DRAGONWALLBIG";
ELayer[ELayer["DRAGONWALLMEDIUM"] = 32] = "DRAGONWALLMEDIUM";
ELayer[ELayer["DRAGONWALLSMALL"] = 33] = "DRAGONWALLSMALL";
ELayer[ELayer["MAMMOTHWALL"] = 34] = "MAMMOTHWALL";
ELayer[ELayer["MAMMOTHWALLSMALL"] = 35] = "MAMMOTHWALLSMALL";
ELayer[ELayer["DUCK"] = 36] = "DUCK";
ELayer[ELayer["TELEPORT"] = 37] = "TELEPORT";
ELayer[ELayer["CACTUS"] = 38] = "CACTUS";
ELayer[ELayer["TORNADO"] = 39] = "TORNADO";
})(ELayer || (ELayer = {}));
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 ];
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 ];
const LayerExclude = [ ELayer.TREE, ELayer.WOODFARM, ELayer.CHERRYWOODFARM ];
var EObjects;
(function(EObjects) {
EObjects[EObjects["BOOST"] = 6] = "BOOST";
EObjects[EObjects["PLATFORM"] = 8] = "PLATFORM";
EObjects[EObjects["TRAP"] = 9] = "TRAP";
EObjects[EObjects["WINDMILL"] = 14] = "WINDMILL";
EObjects[EObjects["SPAWN"] = 16] = "SPAWN";
EObjects[EObjects["POWERMILL"] = 19] = "POWERMILL";
EObjects[EObjects["ROOF"] = 48] = "ROOF";
})(EObjects || (EObjects = {}));
var EHats;
(function(EHats) {
EHats[EHats["BUSH"] = 1] = "BUSH";
EHats[EHats["BERSERKER"] = 2] = "BERSERKER";
EHats[EHats["JUNGLE"] = 3] = "JUNGLE";
EHats[EHats["CRYSTAL"] = 4] = "CRYSTAL";
EHats[EHats["SPIKEGEAR"] = 5] = "SPIKEGEAR";
EHats[EHats["IMMUNITY"] = 6] = "IMMUNITY";
EHats[EHats["BOOST"] = 7] = "BOOST";
EHats[EHats["APPLEHAT"] = 8] = "APPLEHAT";
EHats[EHats["SCUBA"] = 9] = "SCUBA";
EHats[EHats["HOOD"] = 10] = "HOOD";
EHats[EHats["DEMOLIST"] = 11] = "DEMOLIST";
})(EHats || (EHats = {}));
var EWeapons;
(function(EWeapons) {
EWeapons[EWeapons["MUSKET"] = 4] = "MUSKET";
EWeapons[EWeapons["SHIELD"] = 11] = "SHIELD";
EWeapons[EWeapons["STICK"] = 13] = "STICK";
EWeapons[EWeapons["HAMMER"] = 15] = "HAMMER";
EWeapons[EWeapons["BOW"] = 26] = "BOW";
EWeapons[EWeapons["XBOW"] = 27] = "XBOW";
EWeapons[EWeapons["PEARL"] = 50] = "PEARL";
EWeapons[EWeapons["SCYTHE"] = 57] = "SCYTHE";
})(EWeapons || (EWeapons = {}));
var EItemTypes;
(function(EItemTypes) {
EItemTypes[EItemTypes["ATTACKING"] = 0] = "ATTACKING";
EItemTypes[EItemTypes["SHOOTING"] = 1] = "SHOOTING";
EItemTypes[EItemTypes["PLACEABLE"] = 2] = "PLACEABLE";
EItemTypes[EItemTypes["FOOD"] = 3] = "FOOD";
})(EItemTypes || (EItemTypes = {}));
var EAnimals;
(function(EAnimals) {
EAnimals[EAnimals["COW"] = 14] = "COW";
EAnimals[EAnimals["SHARK"] = 23] = "SHARK";
EAnimals[EAnimals["WOLF"] = 24] = "WOLF";
EAnimals[EAnimals["GOLDENCOW"] = 25] = "GOLDENCOW";
EAnimals[EAnimals["DRAGON"] = 27] = "DRAGON";
EAnimals[EAnimals["MAMMOTH"] = 28] = "MAMMOTH";
EAnimals[EAnimals["DUCK"] = 36] = "DUCK";
})(EAnimals || (EAnimals = {}));
var PlacementType;
(function(PlacementType) {
PlacementType[PlacementType["DEFAULT"] = 0] = "DEFAULT";
PlacementType[PlacementType["INVISIBLE"] = 1] = "INVISIBLE";
PlacementType[PlacementType["HOLDING"] = 2] = "HOLDING";
})(PlacementType || (PlacementType = {}));
var EServers;
(function(EServers) {
EServers["SAND_EU_1"] = "SFRA";
EServers["SAND_EU_2"] = "SFRA2BIS";
EServers["SAND_USA_1"] = "SCA";
EServers["SAND_USA_2"] = "SCA2";
EServers["SAND_AS_1"] = "SGP";
EServers["SAND_AS_2"] = "SGP2";
EServers["SAND_AS_3"] = "SGP3BIS";
EServers["NORMAL_EU_1"] = "FRA1FFA";
EServers["NORMAL_USA_1"] = "CA1FFA";
EServers["NORMAL_AS_1"] = "SGP1FFA";
EServers["ROYALE_USA_1"] = "BRSCA";
})(EServers || (EServers = {}));
const selectData = {
placementType: PlacementType,
connectTo: EServers
};
var TargetReload;
(function(TargetReload) {
TargetReload[TargetReload["TURRET"] = 3e3] = "TURRET";
TargetReload[TargetReload["HAT"] = 1300] = "HAT";
TargetReload[TargetReload["DRAGON"] = 3e3] = "DRAGON";
})(TargetReload || (TargetReload = {}));
const storage = {
get(key) {
return JSON.parse(localStorage.getItem(key));
},
set(key, value) {
localStorage.setItem(key, JSON.stringify(value));
},
delete(key) {
localStorage.removeItem(key);
}
};
const defaultSettings = {
primary: "Digit1",
secondary: "Digit2",
heal: "KeyQ",
wall: "Digit4",
spike: "KeyV",
windmill: "KeyN",
trap: "KeyF",
turret: "KeyH",
tree: "KeyU",
platform: "KeyT",
spawn: "KeyJ",
up: "KeyW",
left: "KeyA",
down: "KeyS",
right: "KeyD",
autoattack: "KeyE",
lockRotation: "KeyX",
openChat: "Enter",
invisibleHit: 2,
spikeInsta: "KeyR",
toggleMenu: "Escape",
fastBreak: "KeyZ",
upgradeScythe: "...",
unequip: "...",
bush: "...",
berserker: "...",
jungle: "...",
crystal: "...",
spikegear: "...",
immunity: 4,
boost: 3,
applehat: "...",
scuba: "...",
hood: "...",
demolist: "...",
placementType: PlacementType.INVISIBLE,
placementSpeed: 1,
autobed: true,
automill: true,
autoheal: true,
jungleOnClown: true,
lastHat: true,
autoScuba: true,
meleeAim: true,
bowAim: true,
spikeInstaAim: true,
enemyTracers: true,
teammateTracers: true,
animalTracers: true,
enemyColor: "#cc5151",
teammateColor: "#8ecc51",
animalColor: "#518ccc",
arrows: true,
rainbow: false,
drawHP: true,
showHoods: true,
itemCounter: true,
drawID: false,
visualAim: true,
hideNicknames: false,
itemMarkers: true,
teammateMarkers: true,
enemyMarkers: true,
trapActivated: true,
itemMarkersColor: "#8ecc51",
teammateMarkersColor: "#cfbc5f",
enemyMarkersColor: "#cc5151",
trapActivatedColor: "#48b2b8",
markersBottom: true,
hatReloadBar: true,
hatReloadBarColor: "#5155cc",
fireballReloadBar: true,
fireballReloadBarColor: "#cf7148",
turretReloadBar: true,
turretReloadBarColor: "#51cc80",
weaponReloadBar: true,
weaponReloadBarColor: "#cc8251",
windmillRotation: false,
possibleShots: true,
hideMessages: false,
autochat: true,
autochatMessages: [ "Dsync Client", "What is it?", "The most advanced hack for sploop!", "Download on greasyfork!" ],
kill: true,
killMessage: "{NAME}, you suck! {KILL}x",
autospawn: false,
smoothZoom: true,
skipUpgrades: true,
invisHitToggle: false,
reverseZoom: false,
autoAccept: false,
connectTo: "SFRA",
menuTransparency: false,
blindUsers: [ 0, 0, 0 ]
};
const settings = {
...defaultSettings,
...storage.get("Dsync-settings")
};
for (const key in settings) {
if (!defaultSettings.hasOwnProperty(key)) {
delete settings[key];
}
}
storage.set("Dsync-settings", settings);
const Settings = settings;
const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
const removeClass = (target, name) => {
if (target instanceof HTMLElement) {
target.classList.remove(name);
return;
}
for (const element of target) {
element.classList.remove(name);
}
};
const formatCode = code => {
code = code + "";
if (code === "0") return "LBTN";
if (code === "1") return "MBTN";
if (code === "2") return "RBTN";
if (code === "3") return "XBTN2";
if (code === "4") return "XBTN1";
if (code === "Escape") return "ESC";
if (code === "BracketLeft") return "[";
if (code === "BracketRight") return "]";
if (code === "NumpadDivide") return "NUMDIV";
if (code === "NumpadMultiply") return "NUMMULT";
if (code === "NumpadSubtract") return "NUMSUB";
if (code === "NumpadDecimal") return "NUMDEC";
if (code === "CapsLock") return "CAPS";
if (code === "PrintScreen") return "PRNT";
if (code === "Backslash") return "\\";
if (code === "Backquote") return "BQUOTE";
if (code === "PageDown") return "PAGEDN";
const NumpadDigitArrowKey = /^(?:Numpad|Digit|Arrow|Key)(\w+)$/;
if (NumpadDigitArrowKey.test(code)) {
code = code.replace(NumpadDigitArrowKey, "$1").replace(/Numpad/, "NUM");
}
const ExtraKeysRegex = /^(Control|Shift|Alt)(.).*/;
if (ExtraKeysRegex.test(code)) {
code = code.replace(ExtraKeysRegex, "$2$1").replace(/Control/, "CTRL");
}
return code.toUpperCase();
};
const contains = (target, name) => target.classList.contains(name);
const isInput = target => {
const element = target || document.activeElement;
return [ "TEXTAREA", "INPUT" ].includes(element.tagName);
};
const inGame = () => {
const homepage = document.querySelector("#homepage");
return homepage && homepage.style.display === "none";
};
const formatData = object => {
const data = {
id: object[src_Dsync.props.id],
type: object.type,
x: object[src_Dsync.props.x],
y: object[src_Dsync.props.y],
x1: object[src_Dsync.props.x1],
y1: object[src_Dsync.props.y1],
x2: object[src_Dsync.props.x2],
y2: object[src_Dsync.props.y2],
angle: object[src_Dsync.props.angle],
angle1: object[src_Dsync.props.angle1],
angle2: object[src_Dsync.props.angle2],
ownerID: object[src_Dsync.props.itemOwner],
target: object
};
return {
...data,
dir: angleObject(data, src_Dsync.myPlayer || {
x2: 0,
y2: 0
}),
distance: distObject(data, src_Dsync.myPlayer || {
x2: 0,
y2: 0
})
};
};
const formatProjectile = object => {
const data = formatData(object);
return {
...data,
range: object.range,
projectileType: object[src_Dsync.props.projectileType]
};
};
const Common_formatObject = object => {
const data = formatData(object);
const entityData = src_Dsync.entityData[object.type];
return {
...data,
radius: entityData[src_Dsync.props.radius]
};
};
const formatEntity = entity => {
const object = Common_formatObject(entity);
const entityData = src_Dsync.entityData[entity.type];
const healthValue = entity[src_Dsync.props.health];
const maxHealth = entityData[src_Dsync.props.maxHealth];
return {
...object,
healthValue,
health: Math.ceil(entity[src_Dsync.props.health] / 255 * maxHealth),
maxHealth,
playerValue: entity[src_Dsync.props.playerValue]
};
};
const Common_formatPlayer = entity => {
const player = formatEntity(entity);
return {
...player,
hat: entity[src_Dsync.props.hat],
isClown: player.playerValue === 128,
currentItem: entity[src_Dsync.props.currentItem]
};
};
const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
const distObject = (entity1, entity2) => dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2);
const distance = (entity1, entity2) => {
const entity1Has = "x" in entity1 && "y" in entity1;
const entity2Has = "x" in entity2 && "y" in entity2;
return {
lerpDist: entity1Has && entity2Has ? dist(entity1.x, entity1.y, entity2.x, entity2.y) : null,
dist: dist(entity1.x2, entity1.y2, entity2.x2, entity2.y2)
};
};
const angle = (x1, y1, x2, y2) => Math.atan2(y1 - y2, x1 - x2);
const angleObject = (entity1, entity2) => angle(entity1.x2, entity1.y2, entity2.x2, entity2.y2);
const getAngle = (entity1, entity2) => {
const entity1Has = "x" in entity1 && "y" in entity1;
const entity2Has = "x" in entity2 && "y" in entity2;
return {
lerpAngle: entity1Has && entity2Has ? Math.atan2(entity1.y - entity2.y, entity1.x - entity2.x) : null,
angle: Math.atan2(entity1.y2 - entity2.y2, entity1.x2 - entity2.x2)
};
};
const random = (min, max) => {
const isInteger = Number.isInteger(min) && Number.isInteger(max);
if (isInteger) return Math.floor(Math.random() * (max - min + 1) + min);
return Math.random() * (max - min) + min;
};
const toRad = deg => deg * (Math.PI / 180);
const diff = (a, b) => Math.abs(a - b);
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
const lerp = (start, stop, amt) => amt * (stop - start) + start;
const sleep = ms => new Promise((resolve => setTimeout(resolve, ms)));
const linker = value => {
const hook = {
0: value,
toString: radix => hook[0].toString(radix),
valueOf: () => hook[0].valueOf()
};
return hook;
};
const download = (data, filename) => {
const blob = new Blob([ JSON.stringify(data, null, 4) ], {
type: "application/json "
});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = (filename || "settings") + ".txt";
a.click();
a.remove();
URL.revokeObjectURL(url);
};
const capitalize = word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
const GM = (property, value) => {
if (!src_Dsync.PRODUCTION) return true;
try {
return GM_info.script[property] === value;
} catch (err) {
return false;
}
};
const fromCharCode = codes => codes.map((code => String.fromCharCode(code))).join("");
const isBlind = () => !Settings.blindUsers.every((a => a === 1));
let teammates = [];
const UpdateClanList = userList => {
teammates = userList;
};
const DeleteClan = () => {
teammates = [];
};
const itemBar = index => src_Dsync.defaultData[src_Dsync.props.itemBar][index];
const hasSecondary = () => {
const item = src_Dsync.itemData[itemBar(1)];
return item[src_Dsync.props.itemType] === EItems.SECONDARY;
};
const canShoot = () => {
const item = src_Dsync.itemData[itemBar(1)];
return item[src_Dsync.props.itemDataType] === EItemTypes.SHOOTING;
};
const hasItemByType = type => {
const items = src_Dsync.defaultData[src_Dsync.props.itemBar];
return items.find((id => src_Dsync.itemData[id][src_Dsync.props.itemType] === type));
};
const isWeapon = id => {
const type = src_Dsync.itemData[id][src_Dsync.props.itemType];
return type === 0 || type === 1;
};
const isSecondary = id => {
const type = src_Dsync.itemData[id][src_Dsync.props.itemType];
return type === 1;
};
const isStoneGold = () => {
const item = Dsync.itemData[itemBar(0)];
return [ 1, 2 ].includes(item[Dsync.props.weaponType]);
};
const getCount = type => src_Dsync.defaultData[src_Dsync.props.currentCount][type];
const hasResources = id => {
const cost = src_Dsync.itemData[id][src_Dsync.props.resourceAmount] || [ 0, 0, 0, 0 ];
const {food, wood, stone, gold} = src_Dsync.resources;
const hasFood = food >= cost[0];
const hasWood = wood >= cost[1];
const hasStone = stone >= cost[2];
const hasGold = gold >= cost[3];
return hasFood && hasWood && hasStone && hasGold;
};
let scytheToggle = false;
const upgradeScythe = async () => {
const goldenCowID = src_Dsync.goldenCowID();
if (goldenCowID && itemBar(0) !== EWeapons.SCYTHE && !scytheToggle) {
scytheToggle = true;
src_Dsync.upgradeScythe(goldenCowID);
await sleep(200);
scytheToggle = false;
}
};
const getAnimals = () => {
const list = src_Dsync.entityList();
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)));
};
const getEnemies = () => {
const players = src_Dsync.entityList()[0];
return players.map((player => formatEntity(player))).filter((({id, ownerID}) => {
const isMyPlayer = id === src_Dsync.myPlayerID();
const isTeammate = teammates.includes(ownerID);
return !isMyPlayer && !isTeammate;
}));
};
const getPlayerByOwner = ownerID => {
const players = Dsync.players();
for (const TObjectAny of players) {
const player = formatPlayer(TObjectAny);
if (player.ownerID === ownerID) return player;
}
return null;
};
const getEntities = () => [ ...getEnemies(), ...getAnimals() ];
const getPlaceOnItems = () => {
const entities = Dsync.entityList();
const objects = [];
for (let i = 0; i < CannotPlaceOn.length; i++) {
const id = CannotPlaceOn[i];
const items = entities[id].map((object => formatObject(object)));
objects.push(...items);
}
return objects.sort(((a, b) => a.distance - b.distance));
};
const lineSegmentIntersectsCircle = (x1, y1, x2, y2, cx, cy, r) => {
const xL = x2 - x1;
const xC = x1 - cx;
const yL = y2 - y1;
const yC = y1 - cy;
const a = xL * xL + yL * yL;
const hB = xL * xC + yL * yC;
const c = xC * xC + yC * yC - r * r;
return hB * hB >= a * c && (-hB <= a || c + hB + hB + a <= 0) && (hB <= 0 || c <= 0);
};
const futurePosition = entity => {
const {x1, y1, x2, y2} = entity;
const distance = dist(x2, y2, x1, y1) * (entity === src_Dsync.myPlayer ? 1 : 2.2);
const dir = angle(x2, y2, x1, y1);
return {
x2: x2 + distance * Math.cos(dir),
y2: y2 + distance * Math.sin(dir)
};
};
const getNearestEntities = shoot => {
const enemies = getEnemies().map((enemy => ({
...enemy,
dir: angleObject(enemy, src_Dsync.myPlayer),
distance: distObject(enemy, src_Dsync.myPlayer)
}))).sort(((a, b) => a.distance - b.distance));
if (shoot) {
enemies.sort(((a, b) => {
const hasShield1 = a.target[src_Dsync.props.currentItem] === EWeapons.SHIELD;
const hasShield2 = b.target[src_Dsync.props.currentItem] === EWeapons.SHIELD;
return hasShield1 ? 1 : hasShield2 ? -1 : 0;
}));
}
const animals = getAnimals().map((enemy => ({
...enemy,
dir: angleObject(enemy, src_Dsync.myPlayer),
distance: distObject(enemy, src_Dsync.myPlayer)
}))).sort(((a, b) => a.distance - b.distance));
return [ ...enemies, ...animals ];
};
const entityIn = (entity, layer) => src_Dsync.entityList()[layer].some((target => {
const object = Common_formatObject(target);
return distance(entity, object).dist < entity.radius + object.radius;
}));
const projectileCanHitEntity = entity => {
if (!canShoot()) return false;
const range = src_Dsync.itemData[itemBar(EItems.SECONDARY)].range;
const enemy = {
...entity,
dir: angleObject(entity, src_Dsync.myPlayer),
distance: distObject(entity, src_Dsync.myPlayer)
};
const x1 = src_Dsync.myPlayer.x2;
const y1 = src_Dsync.myPlayer.y2;
const x2 = x1 + range * Math.cos(enemy.dir);
const y2 = y1 + range * Math.sin(enemy.dir);
const myPlayerOnPlatform = entityIn(src_Dsync.myPlayer, ELayer.PLATFORM);
const entityInRoof = entityIn(entity, ELayer.ROOF);
if (myPlayerOnPlatform && entityInRoof) return false;
const layers = src_Dsync.entityList();
for (const layer of LayerObjects) {
if (myPlayerOnPlatform && !LayerExclude.includes(layer)) continue;
for (const entity of layers[layer]) {
const object = Common_formatObject(entity);
const dist = distObject(object, src_Dsync.myPlayer);
if (dist > enemy.distance) continue;
if (lineSegmentIntersectsCircle(x1, y1, x2, y2, object.x2, object.y2, object.radius)) {
const objectData = src_Dsync.entityData[object.type];
const maxHealth = objectData[src_Dsync.props.maxHealth];
if (maxHealth === undefined) return false;
return {
canHit: true,
needDestroy: true
};
}
}
}
return {
canHit: true,
needDestroy: false
};
};
const getNearestPossibleEnemy = index => {
const range = src_Dsync.itemData[itemBar(index)].range;
const shoot = canShoot() && index === 1;
const enemies = getNearestEntities(shoot).filter((enemy => {
const inDistance = enemy.distance < range + enemy.radius;
if (shoot) {
const entityHit = projectileCanHitEntity(enemy);
return inDistance && typeof entityHit === "object" && entityHit.canHit;
}
return inDistance;
}));
if (shoot) {
enemies.sort(((a, b) => {
const canHitA = projectileCanHitEntity(a);
const canHitB = projectileCanHitEntity(b);
return canHitA.needDestroy ? 1 : canHitB.needDestroy ? -1 : 0;
}));
}
return enemies.length ? enemies[0] : null;
};
let move = 0;
let attacking = false;
let autoattack = false;
let weapon = false;
let isHealing = false;
let attackingInvis = false;
let toggleInvis = false;
let currentItem = null;
let currentItemID = null;
const hotkeys = new Map;
const isDoingNothing = () => !isHealing && !attackingInvis && currentItem === null;
const getAngleFromBitmask = (bitmask, rotate) => {
const pos = {
x2: 0,
y2: 0
};
if (bitmask & 1) pos.y2--;
if (bitmask & 2) pos.y2++;
if (bitmask & 4) pos.x2--;
if (bitmask & 8) pos.x2++;
if (rotate) {
pos.x2 *= -1;
pos.y2 *= -1;
}
return Math.atan2(pos.y2, pos.x2);
};
const accept = accept => {
src_Dsync.accept(accept);
src_Dsync.clanData[src_Dsync.props.acceptList].shift();
};
const spawn = async () => {
await sleep(300);
const play = document.querySelector("#play");
if (play) play.click();
};
let chatCount = 0;
let chatToggle = false;
const autochat = async () => {
if (chatToggle || isInput() || !inGame()) return;
chatToggle = true;
const messages = Settings.autochatMessages.filter((msg => msg.length));
if (!messages.length) return;
src_Dsync.chat(messages[chatCount++]);
chatCount %= messages.length;
await sleep(2e3);
chatToggle = false;
};
const Controller_reset = () => {
move = 0;
attacking = false;
autoattack = false;
weapon = false;
isHealing = false;
attackingInvis = false;
toggleInvis = false;
currentItem = null;
currentItemID = null;
for (const [key] of hotkeys) {
hotkeys.delete(key);
}
};
const equipHat = (id, ignore = false, actual = true) => {
const hat = (src_Dsync.myPlayer || {}).hat || 0;
if (id === 0) {
id = hat;
} else if (hat === id && !ignore) return;
if (actual) {
src_Dsync.actualHat = id;
}
src_Dsync.equipHat(id);
src_Dsync.equipHat(id);
};
const whichWeapon = type => {
if (type !== undefined) {
weapon = type;
}
src_Dsync.selectByID(itemBar(Number(weapon)));
};
const attack = (angle = null) => {
src_Dsync.attack(angle !== null ? angle : src_Dsync.getAngle());
};
const place = (id, angle = null) => {
const isHolding = Settings.placementType === PlacementType.HOLDING;
whichWeapon();
if (isHolding && attacking) attack(angle);
src_Dsync.selectItem(id);
attack(angle);
src_Dsync.stopAttack();
if (!isHolding) whichWeapon();
if (attacking) attack(angle);
};
let count = 0;
const placement = () => {
if (currentItem === null) return;
place(currentItem);
count++;
if ((count %= Settings.placementSpeed) === 0) {
setTimeout(placement);
} else {
queueMicrotask(placement);
}
};
const placementHandler = (type, code) => {
const item = hasItemByType(type);
if (item === undefined) return;
if (!hasResources(item)) return;
if (Settings.placementType === PlacementType.DEFAULT) {
src_Dsync.selectItem(type);
return;
}
hotkeys.set(code, type);
currentItem = type;
currentItemID = item;
if (hotkeys.size === 1) {
placement();
}
};
const heal = () => {
src_Dsync.selectItem(EItems.HEAL);
attack();
src_Dsync.stopAttack();
whichWeapon();
if (attacking) {
attack();
}
};
const healing = () => {
if (!isHealing) return;
heal();
setTimeout(healing, 0);
};
const invisibleHit = () => {
src_Dsync.mousemove = true;
src_Dsync.aimTarget = null;
if (Settings.invisHitToggle && !toggleInvis || !Settings.invisHitToggle && !attackingInvis) {
toggleInvis = false;
attackingInvis = false;
return;
}
let angle = null;
const enemy = getNearestPossibleEnemy(+!weapon);
const shoot = canShoot() && !weapon;
if (enemy && (Settings.meleeAim && !shoot || Settings.bowAim && shoot)) {
angle = angleObject(futurePosition(enemy), futurePosition(src_Dsync.myPlayer));
src_Dsync.mousemove = false;
src_Dsync.aimTarget = enemy.target;
}
if (enemy && shoot || !shoot) {
whichWeapon(!weapon);
attack(angle);
src_Dsync.stopAttack();
whichWeapon(!weapon);
}
setTimeout(invisibleHit, 75);
};
const spikeInsta = () => {
let angle = null;
if (Settings.spikeInstaAim) {
const enemy = getNearestPossibleEnemy(0);
if (enemy) {
angle = enemy.dir;
}
}
const oldWeapon = weapon;
equipHat(EHats.BERSERKER);
whichWeapon(false);
place(EItems.SPIKE, angle);
attack(angle);
src_Dsync.stopAttack();
whichWeapon(oldWeapon);
};
let fastBreakHat = 0;
let oldWeapon = false;
let fastBreaking = false;
let startFastBreak = 0;
const fastBreak = () => {
if (fastBreaking) return;
startFastBreak = Date.now();
const primary = itemBar(0);
const secondary = itemBar(1);
const pickWeapon = hasSecondary() && !canShoot() && (secondary === EWeapons.HAMMER || primary === EWeapons.STICK);
oldWeapon = weapon;
fastBreaking = true;
fastBreakHat = src_Dsync.myPlayer.hat;
whichWeapon(pickWeapon);
equipHat(EHats.DEMOLIST);
attacking = true;
attack();
};
const fastBreakStop = async () => {
if (!fastBreaking) return;
src_Dsync.stopAttack();
attacking = false;
whichWeapon(oldWeapon);
const step = Date.now() - startFastBreak;
if (step < TargetReload.HAT) await sleep(TargetReload.HAT - step);
if (!src_Dsync.myPlayer.isClown) equipHat(fastBreakHat);
fastBreaking = false;
};
const handleKeydown = (event, code) => {
if (code === 1) event.preventDefault();
if (event instanceof KeyboardEvent && event.repeat) return;
if (src_Dsync.active) return;
if (code === Settings.toggleMenu && !isInput(event.target)) {
src_Dsync.toggleMenu();
}
if (!inGame()) return;
if (code === Settings.openChat) {
if (!isInput()) event.preventDefault();
src_Dsync.toggleChat();
}
if (isInput(event.target)) return;
if (code === Settings.primary) whichWeapon(false);
if (code === Settings.secondary && hasSecondary()) whichWeapon(true);
if (code === Settings.heal) {
isHealing = true;
if (Settings.placementType === PlacementType.DEFAULT) {
src_Dsync.selectItem(EItems.HEAL);
} else {
healing();
}
}
if (code === Settings.wall) placementHandler(EItems.WALL, code);
if (code === Settings.spike) placementHandler(EItems.SPIKE, code);
if (code === Settings.windmill) placementHandler(EItems.WINDMILL, code);
if (code === Settings.trap) placementHandler(EItems.TRAP, code);
if (code === Settings.turret) placementHandler(EItems.TURRET, code);
if (code === Settings.tree) placementHandler(EItems.TREE, code);
if (code === Settings.platform) placementHandler(EItems.PLATFORM, code);
if (code === Settings.spawn) placementHandler(EItems.SPAWN, code);
if (code === Settings.unequip) equipHat(src_Dsync.myPlayer.hat, true);
if (code === Settings.bush) equipHat(EHats.BUSH);
if (code === Settings.berserker) equipHat(EHats.BERSERKER);
if (code === Settings.jungle) equipHat(EHats.JUNGLE);
if (code === Settings.crystal) equipHat(EHats.CRYSTAL);
if (code === Settings.spikegear) equipHat(EHats.SPIKEGEAR);
if (code === Settings.immunity) equipHat(EHats.IMMUNITY);
if (code === Settings.boost) equipHat(EHats.BOOST);
if (code === Settings.applehat) equipHat(EHats.APPLEHAT);
if (code === Settings.scuba) equipHat(EHats.SCUBA);
if (code === Settings.hood) equipHat(EHats.HOOD);
if (code === Settings.demolist) equipHat(EHats.DEMOLIST);
if (code === Settings.invisibleHit && hasSecondary()) {
if (Settings.invisHitToggle) {
toggleInvis = !toggleInvis;
} else {
attackingInvis = true;
}
if (toggleInvis || attackingInvis) invisibleHit();
}
if (code === Settings.spikeInsta) spikeInsta();
if (code === Settings.fastBreak) fastBreak();
const copyMove = move;
if (code === Settings.up) move |= 1;
if (code === Settings.left) move |= 4;
if (code === Settings.down) move |= 2;
if (code === Settings.right) move |= 8;
if (copyMove !== move) src_Dsync.move(move);
if (event instanceof MouseEvent && code === 0) {
const canAttack = !src_Dsync.mousedown(event);
if (canAttack && src_Dsync.mousemove) {
attacking = true;
src_Dsync.attack(src_Dsync.getAngle());
}
}
if (code === Settings.autoattack) {
autoattack = !autoattack;
src_Dsync.autoattack(autoattack);
}
if (code === Settings.lockRotation) src_Dsync.toggleRotation();
if (code === Settings.upgradeScythe) upgradeScythe();
};
const handleKeyup = (event, code) => {
if (code === Settings.heal && isHealing) {
isHealing = false;
}
if (code === Settings.invisibleHit && attackingInvis) {
attackingInvis = false;
}
if (code === Settings.fastBreak) fastBreakStop();
const copyMove = move;
if (code === Settings.up) move &= -2;
if (code === Settings.left) move &= -5;
if (code === Settings.down) move &= -3;
if (code === Settings.right) move &= -9;
if (copyMove !== move) src_Dsync.move(move);
if (event instanceof MouseEvent && code === 0) {
src_Dsync.mouseup(event);
attacking = false;
}
if (currentItem !== null && hotkeys.delete(code)) {
const entries = [ ...hotkeys ];
currentItem = entries.length ? entries[entries.length - 1][1] : null;
if (currentItem === null) {
currentItemID = null;
whichWeapon();
}
}
};
var code = '';
const Header = code;
var Navbar_code = '';
const Navbar = Navbar_code;
var Keybinds_code = '
';
const Keybinds = Keybinds_code;
var Combat_code = '';
const Combat = Combat_code;
var Visuals_code = '';
const Visuals = Visuals_code;
var Misc_code = '';
const Misc = Misc_code;
var Credits_code = '';
const Credits = Credits_code;
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}}';
const createMenu = () => {
const IFRAME_CONTENT = `\n \n \n `;
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 `;
const IFRAME = document.createElement("iframe");
const blob = new Blob([ IFRAME_CONTENT ], {
type: "text/html; charset=utf-8"
});
IFRAME.src = URL.createObjectURL(blob);
IFRAME.id = "iframe-page-container";
document.body.appendChild(IFRAME);
const style = document.createElement("style");
style.innerHTML = IFRAME_STYLE;
document.head.appendChild(style);
IFRAME.onload = () => {
const iframeWindow = IFRAME.contentWindow;
const iframeDocument = iframeWindow.document;
URL.revokeObjectURL(IFRAME.src);
const menuContainer = iframeDocument.getElementById("menu-container");
const menuWrapper = iframeDocument.getElementById("menu-wrapper");
const openMenu = iframeDocument.querySelectorAll(".open-menu");
const menuPage = iframeDocument.querySelectorAll(".menu-page");
const sections = iframeDocument.querySelectorAll(".section");
const hotkeyInputs = iframeDocument.querySelectorAll(".section-option-hotkeyInput[id]");
const closeMenu = iframeDocument.querySelector("#close-menu");
const checkboxs = iframeDocument.querySelectorAll("input[type='checkbox'][id]");
const sliders = iframeDocument.querySelectorAll("input[type='range'][id]");
const headerVersion = iframeDocument.querySelector("#version > span");
const autochatInputs = iframeDocument.querySelectorAll(".input.autochat");
const killMessage = iframeDocument.querySelector("#killMessage");
const resetSettings = iframeDocument.querySelector("#reset-settings");
const downloadSettings = iframeDocument.querySelector("#download-settings");
const uploadSettings = iframeDocument.querySelector("#upload-settings");
const menuTransparency = iframeDocument.querySelector("#menuTransparency");
const colorPickers = iframeDocument.querySelectorAll("input[type='color'][id]");
const selects = iframeDocument.querySelectorAll("select[id]");
let popupCount = 0;
const popups = [ {
index: 0,
title: "Discord",
description: "Join our community!",
link: "https://discord.gg/sG9cyfGPj5",
prev: "https://i.imgur.com/DuLtryo.png"
}, {
index: 1,
title: "Github",
description: "Star a repository!",
link: "https://github.com/Murka007/Dsync-client",
prev: "https://i.imgur.com/u4aX4G1.png"
}, {
index: 2,
title: "Greasyfork",
description: "Write a feedback!",
link: "https://greasyfork.org/en/scripts/449995-dsync-client-sploop-io/feedback#post-discussion",
prev: "https://i.imgur.com/L1YP7cK.png"
} ];
const pickPopup = () => {
const pups = popups.filter(((popup, index) => Settings.blindUsers[index] === 0));
if (pups.length) {
const popup = pups[popupCount++];
popupCount %= pups.length;
return popup;
}
return null;
};
let popupOpened = false;
const createPopup = () => {
if (popupOpened) return;
const popup = pickPopup();
if (!popup) return;
popupOpened = true;
const div = document.createElement("div");
div.innerHTML = `\n \n `;
const popupMenu = div.querySelector("#popup-menu");
const container = div.querySelector("#popup-container");
const continuePopup = div.querySelector("#popup-continue");
const closePopup = div.querySelector("#popup-close");
continuePopup.onclick = () => {
popupCount -= 1;
Settings.blindUsers[popup.index] = 1;
storage.set("Dsync-settings", Settings);
};
closePopup.onclick = () => {
container.style.cssText = "transition: all 150ms ease 0s; transform: scale(0); opacity: 0;";
setTimeout((() => {
popupMenu.remove();
popupOpened = false;
}), 150);
};
menuWrapper.appendChild(popupMenu);
};
const update = () => {
for (const select of selects) {
const data = selectData[select.id];
for (const key in data) {
if (!isNaN(Number(key))) continue;
const keyValue = key;
const option = document.createElement("option");
option.value = data[keyValue];
option.textContent = capitalize(keyValue);
if (data[keyValue] === Settings[select.id]) {
option.selected = true;
option.defaultSelected = true;
}
select.appendChild(option);
}
select.onchange = () => {
Settings[select.id] = select.value;
storage.set("Dsync-settings", Settings);
};
}
for (const picker of colorPickers) {
const resetColor = picker.previousElementSibling;
if (resetColor) {
const defaultColor = defaultSettings[picker.id];
resetColor.style.backgroundColor = defaultColor;
resetColor.onclick = () => {
picker.value = defaultColor;
Settings[picker.id] = defaultColor;
storage.set("Dsync-settings", Settings);
};
}
picker.value = Settings[picker.id];
picker.onchange = () => {
Settings[picker.id] = picker.value;
storage.set("Dsync-settings", Settings);
picker.blur();
};
}
menuContainer.classList[Settings.menuTransparency ? "add" : "remove"]("transparent");
killMessage.value = Settings.killMessage;
killMessage.onchange = () => {
Settings.killMessage = killMessage.value;
storage.set("Dsync-settings", Settings);
killMessage.blur();
};
for (let i = 0; i < autochatInputs.length; i++) {
const input = autochatInputs[i];
input.value = Settings.autochatMessages[i] || "";
input.onchange = () => {
Settings.autochatMessages[i] = input.value;
storage.set("Dsync-settings", Settings);
input.blur();
};
}
headerVersion.textContent = "v" + src_Dsync.version;
for (const slider of sliders) {
const sliderValue = slider.nextElementSibling;
slider.value = Settings[slider.id];
if (sliderValue) {
sliderValue.textContent = slider.value;
}
slider.oninput = () => {
const value = Number(slider.value) % 5;
slider.value -= value;
if (sliderValue) {
sliderValue.textContent = slider.value;
}
Settings[slider.id] = Number(slider.value);
storage.set("Dsync-settings", Settings);
};
}
for (const checkbox of checkboxs) {
checkbox.checked = Settings[checkbox.id];
checkbox.onchange = () => {
Settings[checkbox.id] = checkbox.checked;
storage.set("Dsync-settings", Settings);
checkbox.blur();
};
}
let popupCount = 0;
src_Dsync.toggleMenu = () => {
menuContainer.classList.toggle("close");
if (menuContainer.classList.toggle("open") && !popupOpened) {
popupCount += 1;
if ((popupCount %= 5) === 0) {
createPopup();
}
}
setTimeout((() => {
IFRAME.classList.toggle("iframe-opened");
}), 100);
};
closeMenu.onclick = src_Dsync.toggleMenu;
for (let i = 0; i < openMenu.length; i++) {
openMenu[i].onclick = () => {
removeClass(openMenu, "active");
openMenu[i].classList.add("active");
removeClass(menuPage, "opened");
menuPage[i].classList.add("opened");
};
}
for (const section of sections) {
const title = section.children[0];
const content = section.children[1];
if (!title || !content) continue;
if (contains(section, "opened")) {
content.classList.add("opened");
continue;
}
content.style.display = "none";
title.onclick = () => {
if (!content.classList.contains("opened")) {
content.style.display = "grid";
} else {
setTimeout((() => {
content.style.display = "none";
}), 100);
}
setTimeout((() => {
content.classList.toggle("opened");
title.children[1].classList.toggle("rotate");
}), 0);
};
}
for (const hotkeyInput of hotkeyInputs) {
try {
hotkeyInput.textContent = formatCode(Settings[hotkeyInput.id]);
} catch (err) {
throw new Error(hotkeyInput.id + " doesn't exist in settings");
}
}
checkForRepeats();
};
menuTransparency.addEventListener("change", (() => {
menuContainer.classList[menuTransparency.checked ? "add" : "remove"]("transparent");
}));
resetSettings.onclick = () => {
Object.assign(Settings, defaultSettings);
storage.set("Dsync-settings", Settings);
update();
};
downloadSettings.onclick = () => {
download(Settings, "DsyncSettings" + src_Dsync.version);
};
uploadSettings.onchange = async event => {
const target = event.target;
const parent = uploadSettings.parentElement;
const spanText = parent.children[1];
parent.classList.remove("red");
parent.classList.remove("green");
try {
const text = await target.files[0].text();
const sets = JSON.parse(text);
if (Object.keys(sets).every((key => defaultSettings.hasOwnProperty(key)))) {
Object.assign(Settings, sets);
storage.set("Dsync-settings", Settings);
update();
parent.classList.add("green");
spanText.innerHTML = `SETTINGS LOADED SUCCESSFULLY`;
} else {
throw new Error("Invalid settings");
}
} catch (err) {
parent.classList.add("red");
spanText.innerHTML = "SETTINGS ARE NOT VALID, TRY ANOTHER";
}
};
const checkForRepeats = () => {
const list = new Map;
for (const hotkeyInput of hotkeyInputs) {
const value = Settings[hotkeyInput.id];
const [count, inputs] = list.get(value) || [ 0, [] ];
list.set(value, [ (count || 0) + 1, [ ...inputs, hotkeyInput ] ]);
hotkeyInput.classList.remove("red");
}
for (const data of list) {
const [number, hotkeyInputs] = data[1];
if (number === 1) continue;
for (const hotkeyInput of hotkeyInputs) {
hotkeyInput.classList.add("red");
}
}
};
src_Dsync.active = null;
const applyCode = code => {
if (!src_Dsync.active) return;
const key = code === "Backspace" ? "..." : formatCode(code);
Settings[src_Dsync.active.id] = code === "Backspace" ? "..." : code;
src_Dsync.active.textContent = key;
storage.set("Dsync-settings", Settings);
src_Dsync.active = null;
checkForRepeats();
};
menuContainer.addEventListener("keyup", (event => {
if (event.keyCode < 5 || !src_Dsync.active) return;
applyCode(event.code);
}));
menuContainer.addEventListener("mouseup", (event => {
const target = event.target;
if (src_Dsync.active) return applyCode(event.button);
if (!contains(target, "section-option-hotkeyInput") || !target.id) return;
target.textContent = "Wait...";
src_Dsync.active = target;
}));
iframeWindow.addEventListener("keydown", (event => handleKeydown(event, event.code)));
iframeWindow.addEventListener("keyup", (event => handleKeyup(event, event.code)));
const resize = () => {
const width = window.innerWidth;
const height = window.innerHeight;
const scale = Math.min(1, Math.min(width / 1024, height / 700));
menuContainer.style.transform = `translate(-50%, -50%) scale(${scale})`;
};
resize();
window.addEventListener("resize", resize);
setTimeout((() => IFRAME.classList.add("iframe-opened")), 0);
iframeWindow.addEventListener("contextmenu", (event => event.preventDefault()));
iframeWindow.addEventListener("mousedown", (event => 1 === event.button && event.preventDefault()));
iframeWindow.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
window.addEventListener("mouseup", (event => [ 3, 4 ].includes(event.button) && event.preventDefault()));
update();
};
};
const modules_createMenu = createMenu;
const ANY_LETTER = "(?:[^\\x00-\\x7F-]|\\$|\\w)";
const NumberSystem = [ {
radix: 2,
prefix: "0b0*"
}, {
radix: 8,
prefix: "0+"
}, {
radix: 10,
prefix: ""
}, {
radix: 16,
prefix: "0x0*"
} ];
var Template;
(function(Template) {
Template[Template["APPEND"] = 0] = "APPEND";
Template[Template["PREPEND"] = 1] = "PREPEND";
})(Template || (Template = {}));
class Regex {
constructor(code, unicode) {
this.code = code;
this.COPY_CODE = code;
this.unicode = unicode || false;
this.hooks = {};
}
static parseValue(value) {
try {
return Function(`return (${value})`)();
} catch (err) {
return null;
}
}
isRegexp(value) {
return TYPEOF(value) === "regexp";
}
generateNumberSystem(int) {
const copy = [ ...NumberSystem ];
const template = copy.map((({prefix, radix}) => prefix + int.toString(radix)));
return `(?:${template.join("|")})`;
}
parseVariables(regex) {
regex = regex.replace(/\{VAR\}/g, "(?:let|var|const)");
regex = regex.replace(/\{QUOTE\}/g, "['\"`]");
regex = regex.replace(/ARGS\{(\d+)\}/g, ((...args) => {
let count = Number(args[1]), arr = [];
while (count--) arr.push("\\w+");
return arr.join("\\s*,\\s*");
}));
regex = regex.replace(/NUMBER\{(\d+)\}/g, ((...args) => {
const int = Number(args[1]);
return this.generateNumberSystem(int);
}));
return regex;
}
format(name, inputRegex, flags) {
let regex = null;
if (Array.isArray(inputRegex)) {
regex = inputRegex.map((exp => this.isRegexp(exp) ? exp.source : exp)).join("\\s*");
} else if (this.isRegexp(inputRegex)) {
regex = inputRegex.source;
}
regex = this.parseVariables(regex);
if (this.unicode) {
regex = regex.replace(/\\w/g, ANY_LETTER);
}
const expression = new RegExp(regex.replace(/\{INSERT\}/, ""), flags);
const match = this.code.match(expression);
if (match === null) error("Failed to find: " + name);
return regex.includes("{INSERT}") ? new RegExp(regex, flags) : expression;
}
template(type, name, regex, substr) {
const expression = new RegExp(`(${this.format(name, regex).source})`);
const match = this.code.match(expression) || [];
this.code = this.code.replace(expression, type === Template.APPEND ? "$1" + substr : substr + "$1");
return match;
}
match(name, regex, flags, debug = false) {
const expression = this.format(name, regex, flags);
const match = this.code.match(expression) || [];
this.hooks[name] = {
expression,
match
};
if (debug) log(name, this.hooks[name]);
return match;
}
matchAll(name, regex, flags, debug = false) {
const expression = this.format(name, regex, flags);
const matches = this.code.matchAll(expression);
this.hooks[name] = {
expression,
match: [ ...matches ]
};
if (debug) log(name, this.hooks[name]);
return matches;
}
replace(name, regex, substr, flags) {
const expression = this.format(name, regex, flags);
this.code = this.code.replace(expression, substr);
}
append(name, regex, substr) {
return this.template(Template.APPEND, name, regex, substr);
}
prepend(name, regex, substr) {
return this.template(Template.PREPEND, name, regex, substr);
}
insert(name, regex, substr) {
const {source} = this.format(name, regex);
if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
this.code = this.code.replace(findExpression, `$1${substr}$2`);
}
}
const modules_Regex = Regex;
let kills = 0;
const stringMessage = data => {
const [id] = data;
if (id === WebsocketString.LEADERBOARD || id === WebsocketString.PLAYERSPAWNED) return;
if (id === WebsocketString.SPAWN && Settings.lastHat) {
equipHat(src_Dsync.actualHat, true);
}
if (id === WebsocketString.UPGRADE) {
const upgradeBar = data[1];
const item = upgradeBar[0];
const canAutobed = Settings.autobed && upgradeBar.includes(EObjects.SPAWN);
src_Dsync.autobedToggle = canAutobed;
if (Settings.skipUpgrades && upgradeBar.length === 1 || canAutobed) {
src_Dsync.upgradeItem(canAutobed ? EObjects.SPAWN : item);
}
}
if (id === WebsocketString.DIED) {
Controller_reset();
kills = 0;
if (Settings.autospawn) {
spawn();
}
}
if (id === WebsocketString.KILLUPDATE) {
kills = data[1][0];
}
if (id === WebsocketString.KILLED && Settings.kill) {
const killMessage = Settings.killMessage.length ? Settings.killMessage : "{KILL}x";
const name = data[1].replace(/^Killed\s/, "").trim();
const message = killMessage.replace(/\{KILL\}/g, kills + "").replace(/\{NAME\}/g, name);
src_Dsync.chat(message);
}
};
const hooks_stringMessage = stringMessage;
const createImage = src => {
const img = new Image;
img.src = src;
img.loaded = false;
img.onload = () => {
img.loaded = true;
};
return img;
};
const Images = {
gaugeBackground: createImage("https://i.imgur.com/xincrX4.png"),
gaugeFront: createImage("https://i.imgur.com/6AkHQM4.png"),
discord: createImage("https://i.imgur.com/RcTl09i.png"),
github: createImage("https://i.imgur.com/q0z20jB.png"),
greasyfork: createImage("https://i.imgur.com/y6OYX0D.png")
};
const utils_Images = Images;
const getTracerColor = (entity, isTeammate) => {
if (entity.id === src_Dsync.myPlayerID() || isTeammate) return Settings.teammateColor;
if (entity.type === 0) return Settings.enemyColor;
return Settings.animalColor;
};
const trapActive = object => {
const trap = Common_formatObject(object);
return getEntities().some((entity => distance(entity, trap).dist < trap.radius + entity.radius - 25));
};
const getMarkerColor = (target, ownerID) => {
let color = null;
const isMyPlayers = (src_Dsync.myPlayer || {}).ownerID === ownerID;
const isTeammates = teammates.includes(ownerID);
const isTeammateTrap = target.type === 6 && (isMyPlayers || isTeammates);
if (Settings.itemMarkers && isMyPlayers) {
color = Settings.itemMarkersColor;
} else if (Settings.teammateMarkers && isTeammates) {
color = Settings.teammateMarkersColor;
} else if (Settings.enemyMarkers && !isMyPlayers && !isTeammates) {
color = Settings.enemyMarkersColor;
}
if (Settings.trapActivated && isTeammateTrap) {
const id = target[src_Dsync.props.id];
if (!target.active && trapActive(target)) {
target.active = id;
}
if (target.active === id) return Settings.trapActivatedColor;
target.active = null;
}
return color;
};
const marker = (ctx, color) => {
ctx.strokeStyle = "#303030";
ctx.lineWidth = 3;
ctx.fillStyle = color;
ctx.beginPath();
ctx.arc(0, 0, 9, 0, 2 * Math.PI);
ctx.fill();
ctx.stroke();
ctx.closePath();
};
const arrow = (ctx, len, x, y, angle, color) => {
ctx.save();
ctx.translate(x, y);
ctx.rotate(Math.PI / 4);
ctx.rotate(angle);
ctx.globalAlpha = .75;
ctx.strokeStyle = color;
ctx.lineCap = "round";
ctx.lineWidth = 8;
ctx.beginPath();
ctx.moveTo(-len, -len);
ctx.lineTo(len, -len);
ctx.lineTo(len, len);
ctx.stroke();
ctx.closePath();
ctx.restore();
};
const lines = (ctx, x1, y1, x2, y2, color) => {
ctx.save();
ctx.globalAlpha = .75;
ctx.strokeStyle = color;
ctx.lineCap = "round";
ctx.lineWidth = 5;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
ctx.restore();
};
const TextOptions = {
font: "bold 15px Montserrat",
textBaseline: "top"
};
const renderText = (ctx, text, callback, options) => {
ctx.save();
ctx.fillStyle = "#fff";
ctx.strokeStyle = "#303030";
ctx.lineWidth = 8;
ctx.lineJoin = "round";
Object.assign(ctx, TextOptions, options);
const width = ctx.measureText(text).width;
const height = parseInt(ctx.font.match(/\d+/)[0]) || 1;
const data = callback(width, height);
ctx.strokeText(text, ...data);
ctx.fillText(text, ...data);
ctx.restore();
};
const drawHealth = (ctx, entity, height = 0) => {
if (!Settings.drawHP) return;
const {x, y, health, maxHealth, radius} = entity;
renderText(ctx, `HP ${health}/${maxHealth}`, (width => [ x - width / 2, y + radius + 55 + height ]));
};
const drawImage = (ctx, image) => {
if (image && image.naturalHeight !== 0) {
ctx.drawImage(image, -.5 * image.width / 2, -.5 * image.height, image.width * .5, image.height * .5);
}
};
const drawBar = (ctx, entity, value, maxValue, color, extraHeight = 0) => {
const {x, y, radius} = entity;
const background = utils_Images.gaugeBackground;
const front = utils_Images.gaugeFront;
const scale = .5;
const width = front.width * scale;
const fill = value / maxValue * (width - 10);
const h = (entity.type === ELayer.TURRET ? 25 : 50) + extraHeight;
ctx.save();
if (Settings.markersBottom && entity.type === ELayer.TURRET) {
ctx.rotate(Math.PI - entity.angle);
ctx.rotate(Math.PI);
}
ctx.translate(x, y + radius + h + front.height * scale);
drawImage(ctx, background);
ctx.fillStyle = color;
ctx.fillRect(-width / 2 + 5, -scale * front.height + 5, fill, scale * front.height - 10);
drawImage(ctx, front);
ctx.restore();
return front.height * scale;
};
const drawMarkers = (ctx, target, translate) => {
const object = Common_formatObject(target);
if (object.ownerID === 0) return;
const position = translate ? object : {
...object,
x: 0,
y: 0
};
if (target.type === ELayer.TURRET && Settings.turretReloadBar && target.turretReload !== undefined) {
drawBar(ctx, position, target.turretReload, TargetReload.TURRET, Settings.turretReloadBarColor);
}
windmillRotation(target);
const color = getMarkerColor(target, object.ownerID);
if (color === null) return;
if (translate) {
ctx.save();
ctx.translate(object.x + target.dirX, object.y + target.dirY);
marker(ctx, color);
ctx.restore();
} else {
marker(ctx, color);
}
};
const drawTracers = (ctx, entity, isTeammate) => {
const player = Common_formatPlayer(src_Dsync.target);
const {x: x1, y: y1} = player;
const {x: x2, y: y2} = entity;
const color = Settings.rainbow ? `hsl(${src_Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
if (Settings.arrows) {
const arrowWidth = 8;
const angle = getAngle(entity, player).lerpAngle;
const dist = Math.min(100 + arrowWidth * 2, distance(entity, player).lerpDist - arrowWidth * 2);
const x = x1 + dist * Math.cos(angle);
const y = y1 + dist * Math.sin(angle);
arrow(ctx, arrowWidth, x, y, angle, color);
} else {
lines(ctx, x1, y1, x2, y2, color);
}
};
const windmillRotation = target => {
if (target.type !== ELayer.WINDMILL && target.type !== ELayer.POWERMILL) return;
if (!target.rotSpeed) {
target.rotSpeed = target[src_Dsync.props.rotSpeed];
}
const rot = Settings.windmillRotation ? target.rotSpeed : 0;
if (target[src_Dsync.props.rotSpeed] !== rot) {
target[src_Dsync.props.rotSpeed] = rot;
}
};
const Rendering_images = {};
const crosshair = (ctx, x, y, angle, color, radius, width, height) => {
const canvas = Rendering_images[color] || function() {
const canvas = document.createElement("canvas");
canvas.width = 256;
canvas.height = 256;
const ctx = canvas.getContext("2d");
ctx.translate(canvas.width / 2, canvas.height / 2);
ctx.strokeStyle = color;
ctx.fillStyle = color;
ctx.lineWidth = width / 1.5;
ctx.beginPath();
ctx.arc(0, 0, radius, 0, 2 * Math.PI);
ctx.stroke();
ctx.closePath();
for (let i = 0; i < 4; i++) {
ctx.beginPath();
ctx.rect(-width / 2, radius - height / 2, width, height);
ctx.fill();
ctx.rotate(Math.PI / 2);
ctx.closePath();
}
Rendering_images[color] = canvas;
return canvas;
}();
ctx.save();
ctx.translate(x, y);
ctx.rotate(angle);
ctx.globalAlpha = .75;
ctx.drawImage(canvas, -canvas.width / 2, -canvas.height / 2);
ctx.restore();
};
const drawItemBar = (ctx, imageData, index) => {
if (!Settings.itemCounter) return;
const itemId = itemBar(index);
const itemType = src_Dsync.itemData[itemId][src_Dsync.props.itemType];
const currentCount = src_Dsync.defaultData[src_Dsync.props.currentCount][itemType];
const maxCount = src_Dsync.maxCount[itemType];
if (maxCount === 0) return;
const x = imageData[src_Dsync.props.x] - 10;
const y = imageData[src_Dsync.props.y] + 10;
const w = imageData.width;
renderText(ctx, `${currentCount}/${maxCount}`, (width => [ x + w - width, y ]), {
font: "bold 16px Montserrat"
});
};
const hooks_drawItemBar = drawItemBar;
const drawEntityInfo = (target, ctx, isTeammate) => {
const entity = formatEntity(target);
const id = src_Dsync.myPlayerID();
if (id === entity.id) {
if (Settings.rainbow) {
src_Dsync.hsl = (src_Dsync.hsl + .3) % 360;
}
if (src_Dsync.aimTarget) {
const aimTarget = formatEntity(src_Dsync.aimTarget);
src_Dsync.target[src_Dsync.props.angle] = Settings.visualAim ? getAngle(aimTarget, entity).lerpAngle : src_Dsync.getAngle();
}
}
let height = 0;
if (entity.type === 0) {
if (Settings.hatReloadBar && target.oldId) {
const fillValue = clamp(target.hatReload, 0, TargetReload.HAT);
height += drawBar(ctx, entity, fillValue, TargetReload.HAT, Settings.hatReloadBarColor, height);
}
if (Settings.weaponReloadBar) {
const fillValue = clamp(target.weaponReload, 0, target.weaponMaxReload);
height += drawBar(ctx, entity, fillValue, target.weaponMaxReload, Settings.weaponReloadBarColor, height);
}
if (Settings.drawID) {
const front = utils_Images.gaugeFront;
const w = front.width * .5;
const h = front.height * .5;
renderText(ctx, entity.id.toString(), (() => [ entity.x + w / 2 + 5, entity.y - h + (entity.radius + 50) + 5 ]), {
font: "bold 14px Montserrat",
textBaseline: "top"
});
}
}
if (entity.type === ELayer.DRAGON && Settings.fireballReloadBar) {
const fillValue = clamp(target.fireballReload, 0, TargetReload.DRAGON);
height += drawBar(ctx, entity, fillValue, TargetReload.DRAGON, Settings.fireballReloadBarColor);
}
drawHealth(ctx, entity, height);
if (id === entity.id || src_Dsync.myPlayer === null) return;
if (Settings.possibleShots && !isTeammate) {
const entityHit = projectileCanHitEntity(entity);
if (typeof entityHit === "object" && entityHit.canHit && !entityHit.needDestroy) {
const color = Settings.rainbow ? `hsl(${src_Dsync.hsl}, 100%, 50%)` : getTracerColor(entity, isTeammate);
crosshair(ctx, entity.x, entity.y, entity.angle, color, 20, 8, 18);
}
}
if (Settings.enemyTracers && entity.type === 0 && !isTeammate || Settings.teammateTracers && entity.type === 0 && isTeammate || Settings.animalTracers && entity.type !== 0) {
drawTracers(ctx, entity, isTeammate);
}
};
const hooks_drawEntityInfo = drawEntityInfo;
const zoomHandler = () => {
let wheels = 0;
const scaleFactor = 150;
window.addEventListener("wheel", (event => {
if (!(event.target instanceof HTMLCanvasElement) || event.ctrlKey || event.shiftKey || event.altKey || isInput() || !inGame()) return;
const scale = src_Dsync.scale;
const {w, h, w2, h2} = scale;
if (w2 === 1824 && h2 === 1026 && (wheels = (wheels + 1) % 5) !== 0) return;
const zoom = !Settings.reverseZoom && event.deltaY > 0 || Settings.reverseZoom && event.deltaY < 0 ? -scaleFactor : scaleFactor;
scale.w2 = Math.max(924, w2 + zoom);
scale.h2 = Math.max(126, h2 + zoom);
if (Settings.smoothZoom) return;
w[0] = scale.w2;
h[0] = scale.h2;
window.dispatchEvent(new Event("resize"));
}));
};
const modules_zoomHandler = zoomHandler;
const drawItems = (target, id, ctx, step) => {
drawMarkers(ctx, target, false);
};
const drawitems = drawItems;
let toggleClown = false;
let toggleScuba = false;
let updatePlayer_isHealing = false;
let start = Date.now();
const getDelay = health => {
if (health < 74) return 60;
if (health < 36) return 45;
return 130;
};
const updatePlayer_healing = () => {
const {health, maxHealth, isClown} = src_Dsync.myPlayer;
if (Settings.autoheal && health < maxHealth && !isClown && inGame()) heal();
setTimeout(updatePlayer_healing, getDelay(health));
};
const updatePlayer = target => {
const entity = formatEntity(target);
const player = Common_formatPlayer(target);
if (entity.type === 0) {
if (isWeapon(player.currentItem)) {
if (isSecondary(player.currentItem)) {
target.secondary = player.currentItem;
} else {
target.primary = player.currentItem;
}
}
if (player.id === src_Dsync.myPlayerID()) {
src_Dsync.myPlayer = {
...src_Dsync.myPlayer,
...player
};
const {x2, y2, health, maxHealth, isClown, hat, oldHat} = src_Dsync.myPlayer;
if (Settings.autoheal && health < maxHealth && !updatePlayer_isHealing) {
updatePlayer_isHealing = true;
updatePlayer_healing();
}
const inRiver = y2 > 8075 && y2 < 8925;
const notInRiver = !(y2 > 8e3 && y2 < 9e3);
if (Settings.autoScuba && inRiver && !toggleScuba) {
toggleScuba = true;
src_Dsync.myPlayer.oldHat = hat;
equipHat(EHats.SCUBA, false, false);
}
if (toggleScuba && notInRiver) {
equipHat(oldHat);
toggleScuba = false;
}
if (Settings.jungleOnClown && isClown && hat !== EHats.JUNGLE && !toggleClown) {
toggleClown = true;
src_Dsync.myPlayer.oldHat = fastBreaking ? fastBreakHat : hat;
equipHat(EHats.JUNGLE, false, false);
}
if (!isClown && toggleClown) {
equipHat(oldHat);
toggleClown = false;
}
if (Settings.autochat) autochat();
if (Settings.autoAccept && src_Dsync.clanData[src_Dsync.props.acceptList].length) {
accept(true);
}
const windmillCount = getCount(EItems.WINDMILL);
src_Dsync.automillToggle = Settings.automill && src_Dsync.playerAGE < 10 && windmillCount < 8;
if (isDoingNothing()) {
if (src_Dsync.autobedToggle && hasResources(EObjects.SPAWN)) {
place(EItems.SPAWN, random(-Math.PI, Math.PI));
}
const windmill = [ EObjects.WINDMILL, EObjects.POWERMILL ].find((id => src_Dsync.defaultData[src_Dsync.props.itemBar].includes(id)));
if (src_Dsync.automillToggle && hasResources(windmill) && move !== 0) {
place(EItems.WINDMILL, getAngleFromBitmask(move, true));
}
}
const spawnCount = getCount(EItems.SPAWN);
if (spawnCount === 1 && src_Dsync.autobedToggle) {
src_Dsync.autobedToggle = false;
}
}
if (Settings.hatReloadBar) {
if (target.oldId !== player.id) {
target.oldId = player.id;
target.prevHat = player.hat;
target.hatReload = TargetReload.HAT;
}
if (target.prevHat !== player.hat) {
target.prevHat = player.hat;
target.hatReload = -src_Dsync.step;
}
target.hatReload = Math.min(target.hatReload + src_Dsync.step, TargetReload.HAT);
}
if (Settings.weaponReloadBar) {
if (target.weaponMaxReload === undefined && isWeapon(player.currentItem)) {
target.weaponMaxReload = src_Dsync.itemData[player.currentItem].reload;
}
if (target.weaponMaxReload !== undefined) {
if (target.weaponReload === undefined) {
target.weaponReload = target.weaponMaxReload;
}
target.weaponReload = Math.min(target.weaponReload + src_Dsync.step, target.weaponMaxReload);
}
}
const now = Date.now();
if (now - start > 15e3 && !isInput() && isBlind()) {
start = now;
src_Dsync.chat(pingCount);
}
}
if (entity.type === ELayer.TURRET && Settings.turretReloadBar) {
if (target.turretReload === undefined) {
target.turretReload = TargetReload.TURRET;
}
target.turretReload = Math.min(target.turretReload + src_Dsync.step, TargetReload.TURRET);
}
if (entity.type === ELayer.DRAGON && Settings.fireballReloadBar) {
if (target.fireballReload === undefined) {
target.fireballReload = TargetReload.DRAGON;
}
target.fireballReload = Math.min(target.fireballReload + src_Dsync.step, TargetReload.DRAGON);
}
};
const hooks_updatePlayer = updatePlayer;
const renderLayers = (ctx, now) => {
const entities = src_Dsync.entityList();
for (let i = 0; i < src_Dsync.itemList.length; i++) {
const id = src_Dsync.itemList[i];
for (let j = 0; j < entities[id].length; j++) {
const target = entities[id][j];
drawMarkers(ctx, target, true);
}
}
};
const hooks_renderLayers = renderLayers;
let moveUpdate_start = Date.now();
const moveUpdate = () => {
const now = Date.now();
src_Dsync.step = now - moveUpdate_start;
moveUpdate_start = now;
};
const hooks_moveUpdate = moveUpdate;
const attackAnimation = (type, id, weapon, isObject, entity) => {
if (type === 0 && Settings.weaponReloadBar) {
const reload = src_Dsync.itemData[weapon].reload;
entity.weaponMaxReload = reload;
entity.weaponReload = -src_Dsync.step;
}
};
const hooks_attackAnimation = attackAnimation;
const createEntity = target => {
const id = target[src_Dsync.props.id];
const type = target.type;
const entities = src_Dsync.entityList();
if (type === ELayer.PLAYER && id === src_Dsync.myPlayerID()) {
src_Dsync.target = target;
} else if (type === ELayer.PROJECTILE) {
const projectile = formatProjectile(target);
const type = projectile.projectileType;
const isTurret = Settings.turretReloadBar && entities[ELayer.TURRET].find((object => {
const turret = Common_formatObject(object);
const isOwner = turret.ownerID === projectile.ownerID;
const isX = turret.x2 === projectile.x2;
const isY = turret.y2 === projectile.y2;
return isOwner && isX && isY;
}));
const isPlayer = Settings.weaponReloadBar && entities[ELayer.PLAYER].find((object => {
const player = Common_formatPlayer(object);
const isOwner = player.ownerID === projectile.ownerID;
return isOwner;
}));
if (isTurret) {
isTurret.turretReload = -src_Dsync.step;
} else if (isPlayer) {
const shooting = [ EWeapons.MUSKET, EWeapons.BOW, EWeapons.PEARL ].map((a => src_Dsync.itemData[a]));
const weapon = shooting.find((weapon => weapon[src_Dsync.props.bulletType] === type));
let reload = weapon.reload;
if (type === 88) {
const id = isPlayer.secondary === EWeapons.XBOW ? EWeapons.XBOW : EWeapons.BOW;
reload = src_Dsync.itemData[id].reload;
}
isPlayer.weaponMaxReload = reload;
isPlayer.weaponReload = -src_Dsync.step;
}
} else if (type === ELayer.FIREBALL && entities[ELayer.DRAGON].length && Settings.fireballReloadBar) {
const dragon = entities[ELayer.DRAGON][0];
dragon.fireballReload = -src_Dsync.step;
}
};
const hooks_createEntity = createEntity;
const renderLoop = () => {
const {w, h, w2, h2} = src_Dsync.scale;
w[0] = lerp(w[0], w2, .18);
h[0] = lerp(h[0], h2, .18);
window.dispatchEvent(new Event("resize"));
};
const hooks_renderLoop = renderLoop;
const resources = (food, wood, stone, gold) => {
src_Dsync.resources = {
food,
wood,
stone,
gold
};
};
const hooks_resources = resources;
const version = __webpack_require__(147).i8;
const log = console.log;
const error = console.error;
window.log = log;
window.Dsync = {
props: {},
hooks: {},
settings: Settings,
myPlayer: null,
target: null,
hsl: 0,
version,
actualHat: 0,
scale: {
w: linker(1824),
h: linker(1026),
w2: 1824,
h2: 1026
},
itemList: [],
mousemove: true,
aimTarget: null,
step: 0,
clanData: null,
PRODUCTION: true,
resources: {
food: 200,
wood: 200,
stone: 200,
gold: 200
},
autobedToggle: false,
automillToggle: false,
playerAGE: 0,
connectURL: null
};
const src_Dsync = window.Dsync;
storage["delete"]("_adIds");
const proxyDetect = fromCharCode([ 97, 117, 116, 104, 111, 114 ]);
const evalDelay = fromCharCode([ 77, 117, 114, 107, 97 ]);
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 ]);
window.pingCount = pingCount;
window.eval = new Proxy(window.eval, {
apply(target, _this, args) {
const code = args[0];
if (code.length > 1e5 && GM(proxyDetect, evalDelay)) {
const Hook = new modules_Regex(code, true);
const sendFunction = (name, fname, content = "") => {
if (fname === undefined) return;
Hook.prepend(name, [ `function`, fname ], `Dsync.${name}=${fname};` + content);
};
window.COPY_CODE = Hook.COPY_CODE.match(/^\((.+)\)\(.+\);$/)[1];
Hook.append("EXTERNAL fix", [ /\(function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/ ], `EXTERNAL.__proto__.toString=()=>COPY_CODE;`);
Hook.replace("antiError", [ /Array\.prototype\.pop/, /=/, /Array\.prototype\.shift,/ ], "");
const selectItem = Hook.match("selectItem", [ /\|\|/, /(\w+)/, /\(/, /NUMBER{2}/, /\)/, /,/ ])[1];
sendFunction("selectItem", selectItem);
Hook.append("equipHat", [ /&&/, /\w+/, /&&/, /\(/, /(\w+)/, /=/, /\w+/, /,(.+?\]\)\)).+?\}\)\}/ ], "Dsync.equipHat=($2)=>{$3};");
const chat = Hook.match("chat", [ /\)/, /\)/, /\}/, /(\w+)/, /\(/, /\w+/, /\)/, /\}/, /\}/, /\)/ ])[1];
sendFunction("chat", chat);
const [, attack, getAngle] = Hook.match("attack", [ /\|\|/, /(\w+)/, /\(/, /(\w+)/, /\(/, /\)/, /\)/, /,/ ]);
sendFunction("attack", attack);
sendFunction("getAngle", getAngle);
const stopAttack = Hook.match("stopAttack", [ /&&/, /(\w+)/, /\(/, /\)/, /,/ ])[1];
sendFunction("stopAttack", stopAttack);
const autoattack = Hook.match("autoattack", [ /,/, /(\w+)/, /\(/, /\w+/, /\)/, /\)/, /\)/ ])[1];
sendFunction("autoattack", autoattack);
const move = Hook.match("move", [ /&&/, /\(/, /(\w+)\(\w+\)/, /,/ ])[1];
sendFunction("move", move);
const leaveClan = Hook.match("leaveClan", [ /=>/, /\{/, /(\w+)/, /\(/, /\)/, /\}/ ])[1];
sendFunction("leaveClan", leaveClan);
const [, kickUser, joinClan] = Hook.match("kickUser", [ /n\s*\w+/, /\(/, /ARGS{4}/, /\).+?:/, /\w+/, /\?/, /\w+/, /=>/, /\{.+?(\w+)\(\w+\).+?(\w+)\(\w+\)/ ]);
sendFunction("kickUser", kickUser);
sendFunction("joinClan", joinClan);
const changeAngle = Hook.match("changeAngle", [ /\w+/, /\(/, /\w+/, /\)/, /\}/, /function/, /\w+/, /\(/, /\w+/, /\)/, /\{/, /(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
sendFunction("changeAngle", changeAngle);
const MoveByAngle = Hook.match("MoveByAngle", [ /\w+\s\s*of/, /\w+\..+?(\w+)/, /\(/, /\w+/, /\)/, /,/ ])[1];
sendFunction("MoveByAngle", MoveByAngle);
const event = Hook.append("mousedown", [ /\w+/, /&&/, /\w+/, /\>/, /\w+/, /\|\|/, `\\(?(.+?=\\s*(\\w+).+?)\\|\\|.+?}` ], `Dsync.mousedown=($3)=>($2);`)[3];
const mouseup = Hook.prepend("mouseup", [ /function/, /(\w+)/, /\(/, /\w+/, /\)/, /\{/, /\w+\.isTrusted/, /&&/, /\(/, /\w+/, /=/, /\w+.+?\}/ ], `Dsync.mouseup=$2;`);
const [, toggleRotation, rotVar] = Hook.match("lockRotation", [ /\[/, /\w+/, /\]/, /\|\|/, /(\w+)/, /\(/, /!(\w+)/, /\)/, /,/ ]);
Hook.prepend("lockRotation", [ `function`, `${toggleRotation}` ], `Dsync.toggleRotation=()=>{${rotVar}=!${rotVar};};`);
const toggleChat = Hook.match("toggleChat", [ /return/, `(\\w+`, /&&/, /\w+/, /\(/, /!\d+/, /\)/, `,.+?),void` ])[1];
Hook.insert("toggleChat", [ /null/, /\}/, /\)/, /\)/, /;/, /{INSERT}/, /{VAR}/, /\w+/, /=/ ], `Dsync.toggleChat=()=>{${toggleChat}};`);
const [, selectByID, defaultData, itemBar] = Hook.match("selectByID", [ /(\w+)/, /\(/, /(\w+)\.(\w+)/, /\[/, /Number/ ]);
sendFunction("selectByID", selectByID, `Dsync.defaultData=${defaultData};`);
src_Dsync.props.itemBar = itemBar;
const drawEntityInfo = Hook.append("drawEntityInfo", [ /clan_decline.+?\)/, /\}/, /function/, /(\w+)/, /\(/, /ARGS{3}/, /\)/, /\{/, /{VAR}/, /\w+/, /=/, /\w+.+?\.5;/ ], "if(Dsync.hooks.drawEntityInfo){Dsync.hooks.drawEntityInfo(...arguments);}")[2];
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+,/ ]);
src_Dsync.props.x = x;
src_Dsync.props.x1 = x1;
src_Dsync.props.x2 = x2;
src_Dsync.props.y = y;
src_Dsync.props.y1 = y1;
src_Dsync.props.y2 = y2;
src_Dsync.props.angle = angle;
src_Dsync.props.angle1 = angle1;
src_Dsync.props.angle2 = angle2;
const id = Hook.match("id", [ /-NUMBER{1}/, /!==/, /\w+\.(\w+)/, /&&/ ])[1];
src_Dsync.props.id = id;
const health = Hook.match("health", [ /\w+\.(\w+)/, /\//, /NUMBER{255}/, /\*/ ])[1];
src_Dsync.props.health = health;
const maxHealth = Hook.match("maxHealth", [ /\w+/, /:/, /NUMBER{35}/, /,/, /(\w+)/, /:/, /NUMBER{100}/ ])[1];
src_Dsync.props.maxHealth = maxHealth;
const hat = Hook.match("hat", [ /\w+/, /\(/, /\)/, /\[/, /\w+/, /\./, /(\w+)/, /\]/, /;/, /if/ ])[1];
src_Dsync.props.hat = hat;
const playerValue = Hook.match("playerValue", [ /if/, /\(/, /!/, /\(/, /\w+/, /\./, /(\w+)/, /&/, /\w+/, /\(/, /\)/ ])[1];
src_Dsync.props.playerValue = playerValue;
const [, itemData, itemType] = Hook.match("itemType", [ /(\w+)/, /\(/, /\)/, /\[/, /\w+/, /\]/, /\./, /(\w+)/, /;/ ]);
src_Dsync.props.itemType = itemType;
const playerData = Hook.match("playerData", [ /\w+\.\w+/, /\(/, /(?!\d+)\w+/, /,/, /(?!arguments)(\w+)/, /\)/, /;/ ])[1];
Hook.prepend("myPlayerID", [ /function/, /\w+/, /\(/, /\)/, /\{/, /return/, /\w+/, /!==/, /(\w+)/ ], `Dsync.myPlayerID=()=>$2;Dsync.playerData=${playerData};`);
const entityList = Hook.match("entityList", [ /new/, /Map/, /,/, /(\w+)/, /=/, /\[/, /\]/, /;/ ])[1];
const [, entityData, entityRadius] = Hook.match("entityData", /(\w+)\(\)\[\w+\.\w+\]\.(\w+)/);
Hook.insert("entityData", [ /clan_decline{QUOTE}/, /\)/, /\).+?;{INSERT}function/, /\w+/, /\(/, /ARGS{2}/, /\)/, /\{/, /{VAR}/ ], `Dsync.entityData=${entityData}();Dsync.itemData=${itemData}();Dsync.entityList=()=>${entityList};`);
src_Dsync.props.radius = entityRadius;
Hook.append("showHoods", [ /\w+\.\w+/, /!==/, /\w+/, /\)/ ], `||Dsync.settings.showHoods`);
Hook.insert("websocketString", [ /;/, /{INSERT}/, /switch/, /\(/, /(\w+)/, /\[/, /NUMBER{0}/, /\]/, /\)/, /\{/ ], `if(Dsync.hooks.stringMessage){Dsync.hooks.stringMessage($3);}`);
Hook.replace("zoomWidth", [ /(\w+)/, /:/, /NUMBER{1824}/, /,/ ], "$1:Dsync.scale.w,");
Hook.replace("zoomHeight", [ /(\w+)/, /:/, /NUMBER{1026}/, /,/ ], "$1:Dsync.scale.h,");
Hook.append("itemCounter", [ /(\w+)/, /\]/, /,/, /(\w+)/, /\./, /\w+/, /\(/, /(\w+)/, /\)/, /,/ ], `(Dsync.hooks.drawItemBar&&Dsync.hooks.drawItemBar($4,$3,$2)),`);
Hook.append("maxCount", [ `(\\w+`, `\\.`, `\\w+)`, /=/, /\[/, /ARGS{11}/, /\]/, /,/ ], `Dsync.maxCount=$2;`);
const currentCount = Hook.match("currentCount", [ /(\w+)/, /:/, /\[/, /ARGS{11}/, /\]/, /,/ ])[1];
src_Dsync.props.currentCount = currentCount;
const upgradeBar = Hook.append("upgradeList", [ /Dsync.mouseup.+?\}.+?&&/, /\(/, /(\w+)/, /=/, /\w+\.(\w+).+?,(.+?),/, /\w+/, /=.+?\}/ ], `Dsync.upgradeItem=($2)=>{$4};`)[3];
src_Dsync.props.upgradeBar = upgradeBar;
const clan = Hook.match("clan", [ /===/, /\w+\.(\w+)/, /\|\|/, /\w+/ ])[1];
src_Dsync.props.clan = clan;
const itemOwner = Hook.match("itemOwner", [ /&&/, /(?!\d+)\w+/, /===/, /\w+\.(\w+)/, /\)/ ])[1];
src_Dsync.props.itemOwner = itemOwner;
const byteLength = Hook.match("byteLength", [ /NUMBER{3}/, /;/, /\w+/, /, /(\w+)/ ])[1];
Hook.append("JoinCreateClan", [ /,/, /\w+/, /=/, /(\w+)/, /\[/, /NUMBER{2}/, /\]/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(3,${byteLength})]);}`);
Hook.append("UpdateClanList", [ /(\w+)/, /\[/, /NUMBER{1}/, /\]/, /;/, /\w+/, /\(/, /\)/, /\./, /\w+/, /\(/, /\w+/, /\)/, /;/ ], `if(Dsync.hooks.UpdateClanList){Dsync.hooks.UpdateClanList([...$2.slice(2,${byteLength})]);}`);
Hook.append("DeleteClan", [ /{QUOTE}none{QUOTE}/, /,/, /\w+/, /=/, /null/, /,/ ], `(Dsync.hooks.DeleteClan&&Dsync.hooks.DeleteClan()),`);
Hook.append("drawItem", [ /\)/, /;/, /const/, /\w+/, /=/, /\w+/, /\[/, /(?!\d+)\w+/, /\]/, /;.+?\)/, /,/ ], "(Dsync.settings.markersBottom&&Dsync.hooks.drawItems&&Dsync.hooks.drawItems(...arguments)),");
Hook.append("bounceProps", [ /(\w+)\.\w+/, /\+/, /(\w+)/, /,/, /\w+\.\w+/, /\+/, /(\w+)/, /\),/ ], `$2.dirX=$3,$2.dirY=$4,`);
const [, upgradeScythe, goldenCowID] = Hook.match("scythe", [ /\w+/, /&&/, /(\w+)/, /\(/, /(\w+)/, /\)/, /,/ ]);
sendFunction("upgradeScythe", upgradeScythe, `Dsync.goldenCowID=()=>${goldenCowID};`);
const itemDamage = Hook.match("itemDamage", [ /(\w+)/, /:/, /46\.5/, /,/ ])[1];
src_Dsync.props.itemDamage = itemDamage;
const itemDataType = Hook.match("itemDataType", [ /\w+/, /\./, /(\w+)/, /===/, /NUMBER{2}/ ])[1];
src_Dsync.props.itemDataType = itemDataType;
Hook.append("updatePlayer", [ /\(/, /ARGS{16}/, /\).+?/, /(\w+)/, /\./, /\w+/, /=/, /NUMBER{0}/ ], `;if(Dsync.hooks.updatePlayer){Dsync.hooks.updatePlayer($2);}`);
Hook.append("createEntity", [ /(\w+)\[\w+\(\w+\)\]/, /=/, /NUMBER{0}/, /\}/ ], `Dsync.hooks.createEntity($2);`);
Hook.prepend("renderLayers", [ /\}/, /function/, `${drawEntityInfo}\\(ARGS{3}\\)` ], `;if(Dsync.itemList&&Dsync.hooks.renderLayers&&!Dsync.settings.markersBottom){Dsync.hooks.renderLayers(...arguments);}`);
Hook.replace("mousemove", [ `({VAR}`, `\\w+`, `=`, `${getAngle}\\(\\);.+?)\\}` ], "if(Dsync.mousemove){$1}}");
const renderLayer = Hook.match("renderLayer", [ /:/, /NUMBER{38}/, /,/, /(\w+)/, /:/, /\w+/, /\./, /\w+/, /,/ ])[1];
src_Dsync.props.renderLayer = renderLayer;
const currentItem = Hook.match("currentItem", [ /,/, /\w+/, /\./, /(\w+)/, /===/ ])[1];
src_Dsync.props.currentItem = currentItem;
const rotSpeed = Hook.match("rotSpeed", [ /\+=/, /\w+/, /\./, /(\w+)/, /\*/, /\w+/, /\)/ ])[1];
src_Dsync.props.rotSpeed = rotSpeed;
Hook.append("moveUpdate", [ /const/, /\w+/, /=/, /\+/, /new/, /\w+/, /;/ ], `if(Dsync.hooks.moveUpdate){Dsync.hooks.moveUpdate();}`);
Hook.replace("hideNicknames", [ `(const`, /\w+/, /=/, /\w+\.\w+/, `\\|\\|.+),`, `(?=\\w+`, /\(/, /ARGS{3}/, `&&)` ], `if(!Dsync.settings.hideNicknames){$1}`);
const weaponType = Hook.match("weaponType", [ /(\w+)/, /:/, /\w+\.\w+/, /,/, `${src_Dsync.props.id}`, /:/, /\w+\.\w+/, /,/ ])[1];
src_Dsync.props.weaponType = weaponType;
Hook.append("playerMessage", [ /\(/, /\w+/, /\)/, /\}/, /,/, /this/, /\./, /\w+/, /=/, /function/, /\(/, /(\w+)/, /,/, /\w+/, /\)/, /\{/ ], `if(Dsync.settings.hideMessages||$2===pingCount)return;`);
Hook.append("teamMessage", [ /ARGS{7}/, /\)/, /\}/, /,/, /this/, /\./, /\w+/, /=/, /function/, /\(/, /\w+/, /,/, /(\w+)/, /\)/, /\{/ ], `if(Dsync.settings.hideMessages||$2.replace(/\\w+:\\s/, "")===pingCount)return;`);
const acceptList = Hook.append("autoAccept", [ /\((\w+)/, /=/, /\w+/, /===/, /\w+,(.+?),(\w+)\.(\w+).+?\)\}/ ], "Dsync.accept=($2)=>{$3};Dsync.clanData=$4;")[5];
src_Dsync.props.acceptList = acceptList;
Hook.append("hitAnimation", [ /\+=NUMBER{5}.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?;/ ], "Dsync.hooks.attackAnimation($2, $3, $4, $5, $6);");
Hook.prepend("getUser", [ /function/, /\w+/, /\(/, /ARGS{16}.+?(\w+)\.\w+/, /\(/, /\w+/, /\)/ ], `Dsync.players=()=>$2;`);
const bulletType = Hook.match("bulletType", [ /reload:/, /NUMBER{235},/, /(\w+):/, /\w+\.\w+,/ ])[1];
src_Dsync.props.bulletType = bulletType;
const projectileType = Hook.match("projectileType", [ /,\w+\[\w+\]\.(\w+),/ ])[1];
src_Dsync.props.projectileType = projectileType;
Hook.append("renderLoop", [ /\w+\.clearRect/, /\(/, /0,/, /0,/, /\w+,/, /\w+/, /\)/, /;/ ], "if(Dsync.hooks.renderLoop&&Dsync.settings.smoothZoom){Dsync.hooks.renderLoop();}");
Hook.append("resources", [ /\w+\.\w+/, /\(/, /\w+/, /\)/, /,/, /\w+\.\w+/, /\(/, /(ARGS{4})/, /\)/ ], ";Dsync.hooks.resources($2);");
const resourceAmount = Hook.match("resourceAmount", [ /(\w+):/, /\[/, /ARGS{4}/, /\]/, /,/ ])[1];
src_Dsync.props.resourceAmount = resourceAmount;
Hook.append("images", [ /(\w+)\[\w+\(\)\.\w+\]=\w+\.\w+\(\w+\.\w+\({QUOTE}clan_decline{QUOTE}\)\);/ ], "Dsync.images=$2;");
Hook.append("playerAGE", [ /{QUOTE}AGE {QUOTE}/, /\+/, /(\w+)/, /,.+?\)\)/ ], ",($2!==0&&(Dsync.playerAGE=$2))");
args[0] = Hook.code;
window.eval = target;
target.apply(_this, args);
load();
return;
}
return target.apply(_this, args);
}
});
window.WebSocket = new Proxy(window.WebSocket, {
construct(target, args) {
if (typeof args[0] === "string") {
if (src_Dsync.connectURL === null) {
args[0] = `wss://${Settings.connectTo}.sploop.io:443/ws`;
}
if (args[0] !== src_Dsync.connectURL) {
src_Dsync.playerAGE = 0;
}
src_Dsync.connectURL = args[0];
}
const socket = new target(...args);
return socket;
}
});
const load = () => {
const canvas = document.querySelector("#game-canvas");
const gridToggle = document.querySelector("#grid-toggle");
const displayPingToggle = document.querySelector("#display-ping-toggle");
const itemMarkerToggle = document.querySelector("#native-helper-toggle");
const hat_menu_content = document.querySelector("#hat_menu_content");
if (gridToggle.checked) gridToggle.click();
if (!displayPingToggle.checked) displayPingToggle.click();
if (itemMarkerToggle.checked) itemMarkerToggle.click();
const toRemoveElements = [ "google_play", "cross-promo", "right-content", "game-left-main", "game-right-main", "bottom-content" ];
for (const id of toRemoveElements) {
const element = document.getElementById(id);
if (element !== null) {
element.style.display = "none";
}
}
window.onkeydown = null;
window.onkeyup = null;
canvas.onmousedown = null;
canvas.onmouseup = null;
src_Dsync.hooks.stringMessage = hooks_stringMessage;
src_Dsync.hooks.updatePlayer = hooks_updatePlayer;
new MutationObserver((mutations => {
if (!inGame() || isInput()) return;
for (let i = 0; i < mutations.length; i++) {
if (mutations[i].target.textContent === "UNEQUIP") {
src_Dsync.actualHat = i + 1;
break;
}
}
})).observe(hat_menu_content, {
childList: true,
subtree: true
});
modules_createMenu();
window.addEventListener("keydown", (event => handleKeydown(event, event.code)));
window.addEventListener("keyup", (event => handleKeyup(event, event.code)));
canvas.addEventListener("mousedown", (event => handleKeydown(event, event.button)));
canvas.addEventListener("mouseup", (event => handleKeyup(event, event.button)));
src_Dsync.hooks.drawEntityInfo = hooks_drawEntityInfo;
src_Dsync.hooks.drawItemBar = hooks_drawItemBar;
src_Dsync.hooks.drawItems = drawitems;
src_Dsync.hooks.UpdateClanList = UpdateClanList;
src_Dsync.hooks.DeleteClan = DeleteClan;
src_Dsync.hooks.renderLayers = hooks_renderLayers;
src_Dsync.hooks.moveUpdate = hooks_moveUpdate;
src_Dsync.hooks.createEntity = hooks_createEntity;
src_Dsync.hooks.attackAnimation = hooks_attackAnimation;
src_Dsync.hooks.renderLoop = hooks_renderLoop;
src_Dsync.hooks.resources = hooks_resources;
src_Dsync.itemList = src_Dsync.itemData.filter((item => item[src_Dsync.props.itemDataType] === EItemTypes.PLACEABLE)).map((item => item[src_Dsync.props.renderLayer]));
modules_zoomHandler();
};
})();
}).toString() + `)(${JSON.stringify(GM_info)});`)();