FaK+

Ever wanted to be K+? This adds a K+ on your screen... no private chats... and not on other screens... FUN!!!

当前为 2015-05-20 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         FaK+
// @namespace    http://alphaoverall.com
// @version      0.1
// @description  Ever wanted to be K+? This adds a K+ on your screen... no private chats... and not on other screens... FUN!!!
// @author       AlphaOverall
// @include      http://www.kongregate.com/games/*/*
// @grant        unsafeWindow
// ==/UserScript==

function init() {
    var checkIfLoaded = setInterval(function(){check()}, 100);
    var i = 100;
    function check(){
        var youser = document.getElementsByClassName("chat_avatar");
        if (youser.length != 0){clearInterval(checkIfLoaded);setTimeout(kplus, 800);}
        else { i--;}
        if (i<=0) { console.log("Chat not found!");clearInterval(checkIfLoaded);}
    }
    holodeck.addChatCommand("kplus", function(l,n){
        check();
        return false;
    });
    function kplus() {
        var windows = document.getElementsByClassName("chat_room_template");
        var you = [];
        for (var j=0; j<windows.length; j++){
            if (!windows[j].style.display){
                you = windows[j].getElementsByClassName("user_row")[0];
            }
        }
        var kicon = document.createElement("span");
        kicon.className = "spritesite premium_icon clickable";
        kicon.title = "Kongregate Plus";
        kicon.innerText = "Kongregate Plus";
        you.insertBefore(kicon, you.childNodes[you.childNodes.length - 2]);
        holodeck._active_dialogue.kongBotMessage("You are now a Pseudo Premium Kongregate user! If not, or you want more K+, use the /kplus command...")
    }
}

setTimeout(init, 1000);