IdlePixel Shut Up, Alt

Never accidentally send a message on an alt again. Add alt names in the plugin settings to disable sending messages.

  1. // ==UserScript==
  2. // @name IdlePixel Shut Up, Alt
  3. // @namespace com.zlef.idlepixel
  4. // @version 1.0.6
  5. // @description Never accidentally send a message on an alt again. Add alt names in the plugin settings to disable sending messages.
  6. // @author Zlef
  7. // @license MIT
  8. // @match *://idle-pixel.com/login/play*
  9. // @grant none
  10. // @require https://greasyfork.org/scripts/441206-idlepixel/code/IdlePixel+.js?anticache=20220905
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. class ShutUpAlt extends IdlePixelPlusPlugin {
  17. constructor() {
  18. super("shutupalt", {
  19. about: {
  20. name: GM_info.script.name + " (ver: " + GM_info.script.version + ")",
  21. version: GM_info.script.version,
  22. author: GM_info.script.author,
  23. description: GM_info.script.description
  24. },
  25. config: [
  26. {
  27. id: "confused",
  28. label: "Example list: name,name2,name3,amyjane1991,name4",
  29. type: "boolean",
  30. default: true
  31. },
  32. {
  33. id: "altIDList",
  34. label: "List the names of alts you want the chat disabled for.",
  35. type: "string",
  36. max: 200000,
  37. default: "PlaceIDsHere"
  38. }
  39. ]
  40. });
  41.  
  42.  
  43. }
  44.  
  45. onConfigsChanged() {
  46. this.chatDisabledList = IdlePixelPlus.plugins.shutupalt.getConfig("altIDList").replace(";",",").replace(" ,", ",").replace(" , ",",").replace(", ",",").toLowerCase().split(',');
  47. this.disableChat();
  48. }
  49.  
  50. onLogin() {
  51. this.username = document.querySelector('item-display[data-key="username"]').innerText;
  52. this.chatDisabledList = IdlePixelPlus.plugins.shutupalt.getConfig("altIDList").replace(";",",").replace(" ,", ",").replace(" , ",",").replace(", ",",").toLowerCase().split(',');
  53.  
  54. setTimeout(() => {
  55. this.disableChat();
  56. }, 1000);
  57. }
  58.  
  59. disableChat() {
  60. const chatInput = document.querySelector('.chat-area-input');
  61. if (this.chatDisabledList.includes(this.username)) {
  62. chatInput.setAttribute('disabled', 'disabled');
  63. chatInput.setAttribute('placeholder', `${this.username} (Chat disabled)`);
  64. } else {
  65. chatInput.removeAttribute('disabled');
  66. chatInput.setAttribute('placeholder', this.username);
  67. }
  68. }
  69.  
  70. }
  71.  
  72. const plugin = new ShutUpAlt();
  73. IdlePixelPlus.registerPlugin(plugin);
  74.  
  75. })();