Modcaller *OLD*

Adds a modcall link to the chat

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           Modcaller *OLD*
// @author         MrSpontaneous (http://www.kongregate.com/accounts/MrSpontaneous)
// @namespace      http://www.kongregate.com
// @description    Adds a modcall link to the chat
// @include        *://www.kongregate.com/games/*/*
// @version 0.0.1.20171113053528
// ==/UserScript==
// You cannot modify or redistribute this script without permission.

function init() {
  var inject_code = new Array();
  inject_code.push('insertmodwhisper = function (mod) { if (mod[0] != "^") {this.holodeck.insertPrivateMessagePrefixFor(mod + " [MC] I need help in " + this.holodeck._chat_window._active_room._room.name + ".");} else { error = mod.split(":"); this.holodeck.activeDialogue().displayMessage(error[0].substr(1), error[1], {class:"whisper sent_whisper"}, {"non_user":true});} };');
  inject_code.push('loadScript = function() { var newScript = document.createElement("script"); newScript.src = "http://modcaller.appspot.com/modcaller.js?room="+this.holodeck._chat_window._active_room._room.id; document.body.appendChild(newScript);};');
  inject_code.push('whispermod = function() { loadScript();};');

  var script = document.createElement('script');
  script.innerHTML = inject_code.join('\n');

  document.getElementsByTagName('head')[0].appendChild(script);
}

call = document.createElement("option");
call.setAttribute("class","action");
call.setAttribute("onclick","whispermod();");
call.innerHTML="Call a Mod";

select = document.getElementsByClassName("chat_actions_container")[0].childNodes[1];
select.appendChild(call);

setTimeout(init, 500);