MPP tools

Room filter/sorting

  1. // ==UserScript==
  2. // @name MPP tools
  3. // @description Room filter/sorting
  4. // @version 0.2.2
  5. // @author Jakob
  6. // @include *mppclone.com/*
  7. // @include *multiplayerpiano.com/*
  8. // @include *multiplayerpiano.net/*
  9. // @namespace https://greasyfork.org/users/779512
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. /* globals MPP, $ */
  14.  
  15. const filter = /wolf|\brp\b|blm|bts|fna?f|anime|role|autoplay|sans|furry|afton|[üğş]|[一-龯]|[\u3131-\uD79D]|[а-я]|[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/iu;
  16.  
  17. MPP.client._events.ls.unshift((packet) => {
  18. packet.u = packet.u.filter(({ _id }) => !filter.test(_id));
  19. packet.u.sort((a, b) => {
  20. if (a.banned) return 1;
  21. if (b.banned) return -1;
  22. return b.count - a.count;
  23. });
  24. });