AntiSpam ForumWar

Regler les conneries des stagiaires

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name AntiSpam ForumWar
// @description Regler les conneries des stagiaires
// @author Singles
// @match  http://forumwar.herokuapp.com/room/*
// @run-at document-end
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version 0.6.4
// @grant none
// @noframes
// @namespace https://greasyfork.org/users/27093
// ==/UserScript==



$(document).on('DOMNodeInserted', function(e) {
    if ( $(e.target).hasClass('m10') ) {
         
var message = $(e.target).text().substr($(e.target).text().indexOf(": ") + 1);
    
       
      if(message.toLowerCase().indexOf("@"+$('.pseudo').text().toLowerCase()) >= 0)
         {
         $(e.target).css( "color", "green" );
         }
    }
});






var jBlocked=new Array(0);
var counter=0;

$("#players li").css('width:90%');
$("#players li").append('<img class="mute" style="width:12px " src="http://image.noelshack.com/fichiers/2017/28/7/1500165872-if-volume-sound-speaker-mute-2203527.png" />');


$(".mute").click(function(){
    var flag=false;
      var joueur=$(this).parent().text();
 
        
          var ind=jQuery.inArray(joueur, jBlocked);
    console.log(jBlocked);
          if(ind!== -1)
          {
              
              jBlocked.splice(ind,1);
                          alert(joueur + " a été débloqué");
                     $(".m10 b:contains('" + joueur + "')").parent().show();

          }
          else
          {
               

                
              flag=true;
          }
      
    if(flag)
    {
  jBlocked.push(joueur);
   
    counter++;
            alert(joueur + " a été bloqué");

         }
});
(function loop() {
  setTimeout(function () {
      for( i=0; i<jBlocked.length;i++)
      {
          $(".m10 b:contains('" + jBlocked[i] + "')").parent().hide();

      }    console.log(jBlocked);


 
    loop();
  }, 800);
}());