// ==UserScript== // @name Me-command *OLD* // @namespace http://www.kongregate.com/games/* // @description Gives a "/me" command // @include http://www.kongregate.com/games/* // @version 0.0.1.20160330193305 // @downloadURL https://update.greasyfork.icu/scripts/18376/Me-command%20%2AOLD%2A.user.js // @updateURL https://update.greasyfork.icu/scripts/18376/Me-command%20%2AOLD%2A.meta.js // ==/UserScript== // Rewritten by the awesome Ventero for compatibility with his scripts. var loaded = false; function init(){ if(this.holodeck && this.ChatDialogue){ loaded = true; var _holodeck = this.holodeck, styleColor = GM_getValue("kong_slashMeColor", "\#660099"); GM_registerMenuCommand("Change \/me command text color", function(e) { var color = prompt("Please enter the color code in the form \#HHHHHH (default \#660099)"); if (z=color.match(/(\#[0-9a-fA-F]{6})/)){ styleColor=z[1] sheet = document.styleSheets[1]; for (var i=0;i:'); var c = content.indexOf('"', content.indexOf('

' + content.substring(l+9); } else if(content.indexOf('\u200B')!=-1){ content = content.substring(0, c) + ' slashMe' + content.substring(c, k) + '* ' + content.substring(k, l) + '' + content.substring(l+8); } else if (content.indexOf('\ufeff') != -1) { content = content.substring(0, c) + ' slashMe' + content.substring(c, un) + '' + content.substring (l+9); } this.oldInsertFunction1234(content); } this.holodeck.addChatCommand("me", function(l,n) { l.chatWindow().activeRoom().sendRoomMessage('\u200B' + n.substring(n.indexOf('\/me ') + 4)); return false; }); this.holodeck.addChatCommand("nouser", function(l,n) { l.chatWindow().activeRoom().sendRoomMessage('\ufeff' + n.substring(n.indexOf('\/nouser ') + 8)); return false; }); sheet = document.styleSheets[1]; sheet.insertRule('#kong_game_ui .chat_message_window .slashMe { color:'+styleColor+';}',sheet.cssRules.length); } else { setTimeout(init, 1000); } }; if (!loaded) { setTimeout(init, 1500); };