您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Watching others resources made easier!
当前为
// ==UserScript== // @name Better player info. // @namespace http://tampermonkey.net/ // @version 0.2 // @description Watching others resources made easier! // @author Diamondkingx // @match http://zombs.io/ // @icon https://www.google.com/s2/favicons?domain=zombs.io // @grant none // ==/UserScript== var activePlayerUid = undefined, displayDivMenu = false, displayCustomDiv = "expired", tooltipPlayerHealthP = document.createElement("p"), allowMouseMove = false, delay = "selectAble"; tooltipPlayerHealthP.className = "tphp"; function mouseMoveFunc(e) { if (game.world.inWorld == true) { window.mousePositionToWorld = game.ui.mousePosition; let mpx = mousePositionToWorld.x; let mpy = mousePositionToWorld.y; window.MPX = game.renderer.screenToWorld(mpx, mpy).x; window.MPY = game.renderer.screenToWorld(mpx, mpy).y; Object.entries(game.world.entities).forEach((player => { if (player[1].entityClass == "PlayerEntity") { window.x = player[1].targetTick.position.x - MPX window.y = player[1].targetTick.position.y - MPY window.distance = Math.sqrt(x * x + y * y); window.mouseDistFromPlayer = distance + player[1].currentModel.base.node.width; if (mouseDistFromPlayer < 100) { displayCustomDiv = "valid"; activePlayerUid = player[1].targetTick.uid; var expiredTimeout = setTimeout(() => { displayCustomDiv = "expired"; }, 10000); clearInterval(expiredTimeout); expiredTimeout = setTimeout(() => { displayCustomDiv = "expired"; }, 10000); window.ActivePlayerUid = activePlayerUid; window.DisplayDivMenu = displayDivMenu; } } })) if (game.world.entities[activePlayerUid] !== undefined || activePlayerUid !== game.ui.playerTick.uid) { if (game.world.entities[activePlayerUid] !== undefined) { window.mousePositionToWorld2 = game.ui.mousePosition; let mpx2 = mousePositionToWorld2.x; let mpy2 = mousePositionToWorld2.y; window.MPX2 = game.renderer.screenToWorld(mpx2, mpy2).x; window.MPY2 = game.renderer.screenToWorld(mpx2, mpy2).y; window.x2 = game.world.entities[activePlayerUid].targetTick.position.x - MPX2 window.y2 = game.world.entities[activePlayerUid].targetTick.position.y - MPY2 window.distance2 = Math.sqrt(x2 * x2 + y2 * y2); window.mouseDistFromPlayer2 = distance2 + 80; }; if (game.world.entities[activePlayerUid] !== undefined && mouseDistFromPlayer2 !== undefined) { displayDivMenu = true; if (game.world.entities[activePlayerUid] !== undefined) { window.customLeft = game.renderer.worldToScreen(game.world.entities[activePlayerUid].targetTick.position.x, game.world.entities[activePlayerUid].targetTick.position.y).x - ((360 / 2) + 17) + "px"; window.customTop = game.renderer.worldToScreen(game.world.entities[activePlayerUid].targetTick.position.x, game.world.entities[activePlayerUid].targetTick.position.y).y - 300 + "px"; }; if (parseInt(customTop) < 0) { customDiv.style.top = "-33px"; } else { if(parseInt(customTop) > window.innerHeight - 230){ customDiv.style.top = window.innerHeight - 230 + "px" } else{ customDiv.style.top = customTop; }} if (parseInt(customLeft) < 0) { customDiv.style.left = "-10px"; } else { if (parseInt(customLeft) > window.innerWidth - 360) { customDiv.style.left = window.innerWidth - 360 + "px"; } else { customDiv.style.left = customLeft; } } } if (displayDivMenu == true && displayCustomDiv == "valid") { document.getElementsByClassName("hud-building-overlay hud-tooltip hud-tooltip-top")[0].style.display = "none"; customDiv.style.transform = "scale(1)"; } else if (displayDivMenu == false && displayCustomDiv == "expired") { customDiv.style.transform = "scale(0)"; } } } } window.customDiv = document.createElement("div"); customDiv.innerHTML = ` <style> .hud-building-overlay .hud-building-stats .hud-stats-values:first-child::after{ display: none; } .hud-tooltip-top::after{ display: none; } .hud-building-overlay .hud-tooltip-health::after{} .tphp{ position: absolute; top: 18%; left: 41%; line-height: 27px; font-size: 12px; font-family: 'Hammersmith One', sans-serif; color: #eee; text-shadow: 0 0 1px rgb(0 0 0 / 80%); transform: translate(-50%, -50%); display: none; } </style> <div id="hud-building-overlay" class="hud-building-overlay hud-tooltip hud-tooltip-top info-container" style="display: block; left: 10px; top: 10px;"><div class="hud-tooltip-building"> <h2 class="player-Name">undefined</h2> <h3 style="position: relative; left: 0px;">Uid: <span class="hud-building-tier player-Uid">1</span></h3> <div class="hud-tooltip-health"> <span class="hud-tooltip-health-bar" style="width:100%; transition: all 0.4s;"></span> </div> <div class="hud-tooltip-body"> <div class="hud-building-stats"> <div class="hud-stats-current hud-stats-values"> <p >Wood: <strong class="hud-stats-current player-Wood">undefined</strong></p><p>Stone: <strong class="hud-stats-current player-Stone">undefined</strong></p><p>Gold: <strong class="hud-stats-current player-Gold">undefined</strong></p> </div> <div class="hud-stats-next hud-stats-values"> <p>Tokens: <strong class="hud-stats-next player-Tokens">undefined</strong></p><p>Score: <strong class="hud-stats-next player-Score">undefined</strong></p><p style="display: block;">Health: <strong class="hud-stats-next player-Health">undefined</strong></p> </div> </div> <p class="hud-building-actions" style="display: block;"> <span class="hud-building-dual-btn" style="display: none;" </span> </p> </div> </div></div> `; customDiv.className = "customDiv tooltip-info-div"; customDiv.style.transition = "left 0.5s, transform 0.3s, top 0.5s"; customDiv.style.position = "relative"; customDiv.style.transform = "scale(0)"; customDiv.style.zIndex = "14"; customDiv.style.width = "360px"; customDiv.style.height = "180px"; customDiv.style.pointerEvents = "none"; document.getElementsByClassName("hud")[0].append(customDiv) customDiv.getElementsByClassName("hud-tooltip-health")[0].append(tooltipPlayerHealthP); function setTrue(e) { var key = e.keyCode || e.whichKey; if (key == 18 && allowMouseMove == false) { e.preventDefault(); allowMouseMove = true; document.addEventListener("mousemove", mouseMoveFunc); } else if (key == 16) { customDiv.style.transform = "scale(0)"; } } var liveUpdating = setInterval(() => { if (game.world.inWorld == true) { Object.entries(game.world.entities).forEach(player => { if (activePlayerUid !== undefined && displayDivMenu == true) { if (player[1].targetTick.uid == activePlayerUid) { let customDivScale = customDiv.style.transform.match(/scale()/)["input"].match(/[0-9]/)[0] if (customDivScale > 0) { var playerName = customDiv.getElementsByClassName("player-Name")[0]; let maxLength = 16; playerName.innerText = player[1].targetTick.name; playerName.innerText.length > maxLength ? playerName.innerText = playerName.innerText.substr(0, maxLength) + "..." : playerName.innerText = player[1].targetTick.name; customDiv.getElementsByClassName("player-Uid")[0].innerText = player[1].targetTick.uid; customDiv.getElementsByClassName("player-Wood")[0].innerText = player[1].targetTick.wood; customDiv.getElementsByClassName("player-Stone")[0].innerText = player[1].targetTick.stone; customDiv.getElementsByClassName("player-Gold")[0].innerText = player[1].targetTick.gold; customDiv.getElementsByClassName("player-Score")[0].innerText = player[1].targetTick.score; customDiv.getElementsByClassName("player-Tokens")[0].innerText = player[1].targetTick.token; customDiv.getElementsByClassName("player-Health")[0].innerText = player[1].targetTick.health; customDiv.getElementsByClassName("hud-tooltip-health-bar")[0].style.width = 100 - ((player[1].targetTick.maxHealth - player[1].targetTick.health) / player[1].targetTick.maxHealth * 100) + "%"; //tooltipPlayerHealthP.innerText = player[1].targetTick.health; } } } }) } }, 100) window.addEventListener("mousedown", (e) => { customDiv.style.transform = "scale(0)"; }) function setFalse(e) { var key = e.keyCode || e.whichKey; if (key == 18 && allowMouseMove == true) { e.preventDefault(); allowMouseMove = false; document.removeEventListener("mousemove", mouseMoveFunc) } else if (key == 16) { customDiv.style.transform = "scale(0)"; } } document.addEventListener("keydown", setTrue); document.addEventListener("keyup", setFalse); // content: ' '; // display: block; // position: absolute; // top: -2.6%; // left: 50%; // margin-left: -6px; // border-left: 6px solid transparent; // border-right: 6px solid transparent; // border-top: 6px solid rgba(0, 0, 0, 0.4); // transform: rotateX( // 180deg); // document.getElementsByClassName("hud-building-overlay hud-tooltip hud-tooltip-top")[0]
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址