TF2R Spookoween

Changes everyone's avatars to skemeletons (or pumpkins if you're a dork) and more!

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name       TF2R Spookoween
// @version    2014
// @description Changes everyone's avatars to skemeletons (or pumpkins if you're a dork) and more!
// @namespace  http://niceme.me/
// @include    http://tf2r.com/chat.html
// @include    http://tf2r.com/user/*
// @include    http://tf2r.com/k*
// @copyright  2014+, Gus and the skeleton living inside Gus
// ==/UserScript==
    changeRankColorsToo = false; // set this to false if you're a fag

    avatars = ["qLZagZM","At2czog","mlVvyJP","MZ1qjci","G5yTJjj",
               "qIJ2w3x","Yhv7LH0","Z4s6SSh","AVM1gdk","sqTcqwF",
               "1z33hg7","kLRxDTp","ssaFeTY","snlG2DE","fQwKlfh",
               "dUyMONf","lTWHFTZ","Cb6JcnL","RmSat2s","CrpgU1B",
               "Khk0BAB","QwU8fdG","4v2jbct","fGibHIO","WABMcoU",
               "DgSSPOs","kpueZ7L","ppiYwEI","vqgVRqZ","mxXZ7MU",
               "ZxllDNK","QPdic56","TQfKPs3","n62RL3r","X4lo3XZ",
               "EEHi1e4","36bRrF7"];

    rankColors = ["FF6600", "7519FF"];

    $("#header_left img").attr("src", "http://i.imgur.com/izt4yr5.png").attr("title", "boo");

window.setInterval(function() {
    $(".ufavatar").each(function(){
        avatarNum = parseInt($(this).find('a').attr('href').replace(/[^\d]/g, "").substr(4)) % 37;
        rankNum = (parseInt($(this).find('a').attr('href').replace(/[^\d]/g, "").substr(4)) % 2);
        replaceUrl = 'http://i.imgur.com/' + avatars[avatarNum] + '.jpg';
        replaceText = "<img src=\'" + replaceUrl + "\' width=\'32\' height=\'32\'>";
        avatarUrl = $(this).find('img').attr('src');
        if (avatarUrl != replaceUrl) {
            $(this).find('img').replaceWith(replaceText);
            if (changeRankColorsToo == true) { 
              $(this).siblings().find('a').css("color","#" + rankColors[rankNum]);
            };
        } else {
            return false;
        };
    });
}, 1000); // Increase this number if your performance drops