FaK+

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

  1. // ==UserScript==
  2. // @name FaK+
  3. // @namespace http://alphaoverall.com
  4. // @version 0.1
  5. // @description Ever wanted to be K+? This adds a K+ on your screen... no private chats... and not on other screens... FUN!!!
  6. // @author AlphaOverall
  7. // @include http://www.kongregate.com/games/*/*
  8. // @grant unsafeWindow
  9. // ==/UserScript==
  10.  
  11. function init() {
  12. var checkIfLoaded = setInterval(function(){check()}, 100);
  13. var i = 100;
  14. function check(){
  15. var youser = document.getElementsByClassName("chat_avatar");
  16. if (youser.length != 0){clearInterval(checkIfLoaded);setTimeout(kplus, 800);}
  17. else { i--;}
  18. if (i<=0) { console.log("Chat not found!");clearInterval(checkIfLoaded);}
  19. }
  20. holodeck.addChatCommand("kplus", function(l,n){
  21. check();
  22. return false;
  23. });
  24. function kplus() {
  25. var windows = document.getElementsByClassName("chat_room_template");
  26. var you = [];
  27. for (var j=0; j<windows.length; j++){
  28. if (!windows[j].style.display){
  29. you = windows[j].getElementsByClassName("user_row")[0];
  30. }
  31. }
  32. var kicon = document.createElement("span");
  33. kicon.className = "spritesite premium_icon clickable";
  34. kicon.title = "Kongregate Plus";
  35. kicon.innerText = "Kongregate Plus";
  36. you.insertBefore(kicon, you.childNodes[you.childNodes.length - 2]);
  37. holodeck._active_dialogue.kongBotMessage("You are now a Pseudo Premium Kongregate user! If not, or you want more K+, use the /kplus command...")
  38. }
  39. }
  40.  
  41. setTimeout(init, 1000);