Modcaller *OLD*

Adds a modcall link to the chat

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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);