// ==UserScript== // @name moomoo.io esp // @description gives you magical powers // @version 1 // @author Wealthy // @match *://*.moomoo.io/* // @grant none // @icon https://moomoo.io/img/animals/cow_1.png // @namespace https://greasyfork.org/users/1347888 // @downloadURL https://update.greasyfork.icu/scripts/507166/moomooio%20esp.user.js // @updateURL https://update.greasyfork.icu/scripts/507166/moomooio%20esp.meta.js // ==/UserScript== localStorage.setItem("moofoll", true); const players = [], animals = []; const property = "team"; Object.defineProperty(Object.prototype, property, { get: function() { if(this.isPlayer) { const player = players.find(player => player.id === this.id); !player && players.push(this); } else { const animal = animals.find(animal => animal.sid === this.sid && animal.src === this.src); !animal && animals.push(this); } return this[`_${property}`]; }, set: function(value) { this[`_${property}`] = value; }, configurable: true }); const check = { tribe: (owner, { team, sid }) => (owner.sid !== sid && owner.team && owner.team === team), owner: ({ wood, stone, food, points }) => (wood || stone || food || points) } let ctx, camX, camY, xOffset, yOffset; const showHealth = (x, y, health, maxHealth) => { const text = `HP:${Math.round(health)}/${maxHealth}`; ctx.fillStyle = "#fff"; ctx.lineJoin = "round"; ctx.font = "20px Hammersmith One"; ctx.lineWidth = 6; ctx.strokeText(text, x - xOffset, y - yOffset); ctx.fillText(text, x - xOffset, y - yOffset); } const showLine = (x1, y1, x2,y2, stroke = "black", width = 3) => { ctx.lineCap = "round"; ctx.strokeStyle = stroke; ctx.lineWidth = width; ctx.beginPath(); ctx.moveTo(x1 - xOffset, y1 - yOffset); ctx.lineTo(x2 - xOffset, y2 - yOffset); ctx.stroke(); } const getDistance = (x1, y1, x2, y2) => Math.hypot(x2 - x1, y2 - y1); const getDirection = (x1, y1, x2, y2) => Math.atan2(y1 - y2, x1 - x2); const checked = (name) => document.getElementById(`${name}Box`)?.checked; let owner, tribe, enemies; const esp = (delta) => { if(!players.length) return; if(!ctx) { const gameCanvas = document.getElementById("gameCanvas"); ctx = gameCanvas.getContext("2d"); } if(!ctx) return; owner = null; tribe = []; enemies = []; for(let player of players) { if(player.visible) { if(check.owner(player)) { owner = player; } else if(owner && check.tribe(owner, player)) { tribe.push(player); } else enemies.push(player); } } if(!owner) return; let tmpDist = getDistance(camX, camY, owner.x, owner.y); let tmpDir = getDirection(owner.x, owner.y, camX, camY); let camSpd = Math.min(tmpDist * 0.01 * delta, tmpDist); if (tmpDist > 0.05) { camX += camSpd * Math.cos(tmpDir); camY += camSpd * Math.sin(tmpDir); } else { camX = owner.x; camY = owner.y; } xOffset = camX - (1920 / 2); yOffset = camY - (1080 / 2); if(checked("health")) { showHealth(owner.x, owner.y + owner.scale + 66.5, owner.health, owner.maxHealth); for(let animal of animals) animal.visible && showHealth(animal.x, animal.y + animal.scale + 66.5, animal.health, animal.maxHealth); for(let enemy of enemies) showHealth(enemy.x, enemy.y + enemy.scale + 66.5, enemy.health, enemy.maxHealth); } if(checked("animal")) for(let animal of animals) animal.visible && showLine(owner.x, owner.y, animal.x, animal.y, "#221abf"); if(checked("enemy")) for(let enemy of enemies) showLine(owner.x, owner.y, enemy.x, enemy.y, "#000000"); } let lastUpdate; const frame = () => { requestAnimationFrame(frame); let delta = Date.now() - lastUpdate; lastUpdate = Date.now(); esp(delta); } frame() let html = document.createElement("div"); html.innerHTML = `