Twitch Plays Pokemon Chat Filter

Chat commands from the Twitch Plays Pokemon stream are filtered.

As of 2016-02-15. See the latest version.

// ==UserScript==
// @name        Twitch Plays Pokemon Chat Filter
// @description Chat commands from the Twitch Plays Pokemon stream are filtered.
// @namespace   http://userscripts.org/users/magmarfire
// @include     *twitch.tv/twitchplayspokemon
// @version     1.9
// @grant       none
// ==/UserScript==

// Changelog:
// v1.9: Commands for Pokemon Mystery Dungeon sidegame (Anniversary Crystal update) added.
// v1.8: Betting commands updated for Smash 4 matches.
// v1.7: TPP Arena Anniversary commands added.
// v1.6: ZL/ZR buttons added for the Wii U.
// v1.5: TPP Arena move commands added.
// v1.4: 3DS Control Stick and D-pad added.
// v1.3: Betting commands now filtered.
// v1.2: Nintendo DS support added.
// v1.1: Added support for comma syntax (in Democracy mode).
// v1.0: Original script.

$(document).ready(function() {
    var regex = /^((((c?d?(left|right|up|down)|start|select|wait|anarchy|democracy|move|run|a|b|l|r|x|y|z|\d|[ ])(\d|\+|,\s?)?)*)|(!bet \d* .*)|(!(move )?(a|b|c|d|-))|!(balance|tokens)|!(match \d*,\d*,\d*\/\d*,\d*,\d* \d*)|!(slots? \d+))$/i;

    $("head").append("<style type='text/css'>.chat-line { display: none; }</style>");

    var myUsername = $("#you .username").text().toLowerCase();

    setInterval(function() {
        var messages = $(".chat-line");
        messages.each(function() {
            var message = $(".message", this).text();
            var from = $(".from", this).text().toLowerCase();

            if (!regex.test(message.trim()) && (from !== "tppbankbot" || message.toLowerCase().indexOf(myUsername) > -1)) {
                $(this).show();
            }
        });
    }, 200);
});
长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元