您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Never accidentally send a message on an alt again
当前为
- // ==UserScript==
- // @name IdlePixel Shut Up, Alt
- // @namespace com.zlef.idlepixel
- // @version 1.0.0
- // @description Never accidentally send a message on an alt again
- // @author Zlef
- // @license MIT
- // @match *://idle-pixel.com/login/play*
- // @grant none
- // @require https://greasyfork.org/scripts/441206-idlepixel/code/IdlePixel+.js?anticache=20220905
- // ==/UserScript==
- (function() {
- 'use strict';
- class ShutUpAlt extends IdlePixelPlusPlugin {
- constructor() {
- super("shutupalt", {
- about: {
- name: GM_info.script.name + " (ver: " + GM_info.script.version + ")",
- version: GM_info.script.version,
- author: GM_info.script.author,
- description: GM_info.script.description
- },
- config: [
- {
- id: "confused",
- label: "I have no idea how to only have one config so here's a checkbox to play with",
- type: "boolean",
- default: true
- },
- {
- id: "altIDList",
- label: "List the player ID of alts you dont want to see in the player market.",
- type: "string",
- max: 200000,
- default: "PlaceIDsHere"
- }
- ]
- });
- }
- onConfigsChanged() {
- this.getConfig("altNames");
- // Pinched from MarketOverhaul:
- this.chatDisabledList = IdlePixelPlus.plugins.shutupalt.getConfig("altIDList").replace(";",",").replace(" ,", ",").replace(" , ",",").replace(", ",",").toLowerCase();
- this.disableChat();
- }
- onLogin() {
- this.username = document.querySelector('item-display[data-key="username"]').innerText;
- // Pinched from MarketOverhaul:
- this.chatDisabledList = IdlePixelPlus.plugins.shutupalt.getConfig("altIDList").replace(";",",").replace(" ,", ",").replace(" , ",",").replace(", ",",").toLowerCase();
- this.disableChat();
- }
- disableChat(){
- const chatInput = document.querySelector('.chat-area-input');
- if (this.chatDisabledList.includes(this.username.toLowerCase())) {
- chatInput.setAttribute('disabled', 'disabled');
- chatInput.setAttribute('placeholder', `${this.username} (Chat disabled)`);
- } else {
- chatInput.removeAttribute('disabled');
- chatInput.setAttribute('placeholder', this.username);
- }
- }
- }
- const plugin = new ShutUpAlt();
- IdlePixelPlus.registerPlugin(plugin);
- })();