twitchPlaysDarkFilterChat

A script to filter out the chat commands in Twitch Plays Dark Souls

Version vom 17.08.2015. Aktuellste Version

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name       twitchPlaysDarkFilterChat
// @namespace   twitchPlaysDarkFilterChat
// @include     *.twitch.tv/twitchplaysdark
// @include     *.twitch.tv/twitchplaysdark/chat?popout=
// @version     0.9
// @description A script to filter out the chat commands in Twitch Plays Dark Souls
// ==/UserScript==
//
var filterActive = false;
var toBeFiltered= [
    "arl",
	"ar",
	"al",
	"d"
    "ard",
    "aru",
    "arr",
    "m",
    "f",
    "b",
    "l",
    "r",
    "e",
    "rf",
    "rb",
    "rl",
    "rr",
    "u",
    "g",
    "a",
    "du",
    "dd",
    "dl",
    "dr",
    "r1",
    "r2",
    "l1",
    "l2",
    "fl",
    "bs",
	"lr",
	"democracy",
	"anarchy",
	"autowalk",
	"babysteps",
	"nomenu",
	"menubutton",
	"banmenu",
	"banm",
	"chaos",
	"unbanm",
	"auto-walk",
	"auto"
];
var chatParent = document.getElementsByClassName("chat-lines")[0];
var interval;

function filterChat(event){
    if(event.target.children == undefined)
    {
        return;
    }
    var message = event.target.children[0].children[5].innerHTML;

    for(x=0;x<toBeFiltered.length;x++)
    {
        if(message.toUpperCase().replace(/\s+/g, '') === toBeFiltered[x].toUpperCase().replace(/\s+/g, '')){
            chatParent.removeChild(event.target);
            break;
        }
    }
}

function checkIfLoaded()
{	
	chatParent = document.getElementsByClassName("chat-lines")[0];
	try{chatParent.children}
	catch(err)
	{
	return;
	}
chatParent.addEventListener("DOMNodeInserted",filterChat);
window.clearInterval(interval);
}

interval = window.setInterval(checkIfLoaded,20);