您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
display, how many items you have placed
- // ==UserScript==
- // @name MooMoo.io Item counter
- // @version 1.21
- // @description display, how many items you have placed
- // @author Nuro
- // @match *://*.moomoo.io/*
- // @require https://gf.qytechs.cn/scripts/456235-moomoo-js/code/MooMoojs.js?version=1159501
- // @run-at document-start
- // @namespace -
- // ==/UserScript==
- const MooMoo = (function MooMooJS_beta() {})[69]
- const styles = {
- position: "absolute",
- top: "0",
- paddingLeft: "5px",
- fontSize: "2em",
- color: "#fff"
- };
- MooMoo.onGameLoad = () => {
- initializeActionBar()
- }
- function initializeActionBar() {
- 'use strict';
- const actionBarItems = document.getElementsByClassName("actionBarItem");
- for (let i = 0; i < actionBarItems.length; i++) {
- if (i >= 19 && i <= 38) {
- const divElement = createActionBarItem(i);
- appendActionBarItem(divElement, i);
- }
- }
- function createActionBarItem(index) {
- const divElement = document.createElement("div");
- divElement.setAttribute("id", `actionBarItemnum${index}`);
- applyStyles(divElement, styles);
- divElement.innerHTML = "0";
- return divElement;
- }
- function applyStyles(element, styles) {
- for (const style in styles) {
- element.style[style] = styles[style];
- }
- }
- function appendActionBarItem(divElement, index) {
- const parentElement = document.getElementById(`actionBarItem${index}`);
- parentElement.appendChild(divElement);
- }
- function getElementById(id) {
- return document.getElementById(id);
- }
- MooMoo.addEventListener("14", function (event) {
- const value = event[1];
- const indicesByEventType = {
- 1: [19, 20, 21],
- 2: [22, 23, 24, 25],
- 3: [26, 27, 28],
- 4: [29],
- 5: [31],
- 6: [32],
- 7: [33],
- 8: [34],
- 9: [35],
- 10: [36],
- 11: [30],
- 12: [37],
- 13: [38]
- };
- const updateActionBarItem = index => {
- document.getElementById(`actionBarItemnum${index}`).innerHTML = value;
- };
- const indices = indicesByEventType[event[0]];
- indices.forEach(updateActionBarItem);
- });
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址