您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
block noob!
当前为
- // ==UserScript==
- // @name block 'drop' in steam.tv
- // @version 1.3
- // @description block noob!
- // @author xz
- // @include *://steam.tv/*
- // @grant none
- // @namespace https://greasyfork.org/users/48754
- // ==/UserScript==
- (function() {
- 'use strict';
- //auto report spam user, maybe steam will ban u
- var AutoReport=false;
- if(typeof CBroadcastChat !== 'undefined'){
- console.log("script has loaded! AutoReport is "+(AutoReport?"on":"off"));
- CBroadcastChat.prototype.DisplayChatMessage = function( strPersonaName, bInGame, steamID, strMessage, bLocal )
- {
- var _chat = this;
- if(strMessage.search(/^!|drop$|box$|(\w)\1{4,}|^(\u02d0.*?\u02d0)\2{4,}|^\u02d0(\w)*\u02d0$|^.$|tradeoffer\/new/i)>-1)
- console.log("%s(%s)\t\t%s",steamID,strPersonaName,strMessage);
- if ( AutoReport && !this.m_mapMutedUsers[steamID])
- //this.MuteUserForSession(steamID,strPersonaName);
- {
- this.m_mapMutedUsers[steamID] = strPersonaName;
- var rgParams =
- {
- chat_id: this.m_ulChatID,
- user_steamid: steamID,
- muted: 1
- };
- this.m_webapi.ExecJSONP( 'IBroadcastService', 'MuteBroadcastChatUser', rgParams, true, null, 15 )
- .done( function()
- {
- return 0;
- })
- .fail( function()
- {
- if (bOwner)
- {
- console.log('Failed to mute %s. Please try again.'.replace( /%s/, strPersonaName ) );
- delete _chat.m_mapMutedUsers[steamID];
- return 0;
- }
- });
- console.log("auto reported user: "+this.GetMutedUsers().length);
- return 0;
- }else{
- return 0;
- }
- //console.log(this.IsUserMutedLocally(steamID));
- }
- var elMessage = $J('#ChatMessageTemplate').clone();
- elMessage.attr( 'id', '' );
- elMessage.attr( 'data-steamid', steamID );
- var elChatName = $J( '.tmplChatName', elMessage );
- elChatName.text(strPersonaName);
- elChatName.attr( 'href', 'https://steamcommunity.com/profiles/' + steamID );
- elChatName.attr( 'data-miniprofile', 's' + steamID );
- if ( steamID == this.m_broadcastSteamID )
- elMessage.addClass( 'Broadcaster' );
- var elText = $J( '.tmplChatMessage', elMessage ).text(strMessage);
- var strHTML = elText.html();
- strHTML = this.AddEmoticons(strHTML, steamID, bLocal);
- strHTML = this.AddLinks(strHTML);
- elText.html(strHTML);
- elMessage.show();
- var bAutoScroll = this.BAutoScroll();
- $J('#ChatMessages').append(elMessage);
- // if text is too long, add expand button
- var elText = $J( '.tmplChatMessage', elMessage );
- if ( elText.height() > elMessage[0].clientHeight )
- {
- var elExpand = $J( '<div class="ChatExpand">+</div>' );
- elMessage.append(elExpand);
- elExpand.on('click', function () { _chat.ExpandMessage(elMessage) } );
- }
- if (bAutoScroll)
- this.ScrollToBottom();
- };
- }
- })();