Greasy Fork is available in English.

IdlePixel Pinger

Adds a chat command that pings other players

  1. // ==UserScript==
  2. // @name IdlePixel Pinger
  3. // @namespace lbtechnology.info
  4. // @version 1.0.0
  5. // @description Adds a chat command that pings other players
  6. // @author Lux-Ferre
  7. // @license MIT
  8. // @match *://idle-pixel.com/login/play*
  9. // @grant none
  10. // @require https://greatest.deepsurf.us/scripts/441206-idlepixel/code/IdlePixel+.js?anticache=20220905
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. class PingerPlugin extends IdlePixelPlusPlugin {
  17. constructor() {
  18. super("pinger", {
  19. about: {
  20. name: GM_info.script.name,
  21. version: GM_info.script.version,
  22. author: GM_info.script.author,
  23. description: GM_info.script.description
  24. },
  25. });
  26. this.previous = "";
  27. }
  28. onLogin(){
  29. IdlePixelPlus.registerCustomChatCommand("ping", (command, message) => {
  30. IdlePixelPlus.sendCustomMessage(message, {
  31. content: `PINGER:PING`
  32. });
  33. }, "Sends a ping to the player. /ping <player>");
  34. }
  35. onCustomMessageReceived(player, content, callbackId) {
  36. if (content.startsWith("PINGER:")){
  37. Modals.open_image_modal("PING!", "images/birdhouse.png", `Ping from: ${player}!`, "Okay!", null, "Cancel", false)
  38. }
  39. }
  40.  
  41. }
  42.  
  43. const plugin = new PingerPlugin();
  44. IdlePixelPlus.registerPlugin(plugin);
  45.  
  46. })();