MPP tools

Room filter/sorting

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         MPP tools
// @description  Room filter/sorting
// @version      0.2.2
// @author       Jakob
// @include      *mppclone.com/*
// @include      *multiplayerpiano.com/*
// @include      *multiplayerpiano.net/*
// @namespace    https://greasyfork.org/users/779512
// @license      MIT
// ==/UserScript==

/* globals MPP, $ */

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;

MPP.client._events.ls.unshift((packet) => {
  packet.u = packet.u.filter(({ _id }) => !filter.test(_id));
  packet.u.sort((a, b) => {
    if (a.banned) return 1;
    if (b.banned) return -1;
    return b.count - a.count;
  });
});