// ==UserScript== // @name *headdesk* // @namespace ganthor93@kongregate // @description Adds a headdesk button and command // @include http://www.kongregate.com/games/*/* // @version 0.0.1.20160401053137 // @downloadURL https://update.greasyfork.icu/scripts/17772/%2Aheaddesk%2A.user.js // @updateURL https://update.greasyfork.icu/scripts/17772/%2Aheaddesk%2A.meta.js // ==/UserScript== if (/^\/?games\/[^\/]+\/[^\/?#]+([\?#].*)?$/.test(window.location.pathname)) { setTimeout(function(){ javascript:void(window.location.assign("javascript:$('header').innerHTML+='';var timeObj={time:0};function headDesk(){if(timeObj.time < new Date().getTime()){sendChatMessage('*headdesk*');timeObj.time=new Date().getTime()+7000}holodeck.activeDialogue()._input_node.focus();return false};function sendChatMessage(a){a = a.replace(/\\\\(?!u[0-9a-fA-f]{4}|x[0-9a-fA-f]{2})/g, '\\\\\\\\');dispatchToKonduit({type:KonduitEvent.ROOM_MESSAGE,data:{message:a,room:holodeck.chatWindow()._active_room._room}});return a;};holodeck.addChatCommand('head', headDesk);holodeck.addChatCommand('HEAD', headDesk);(function(){var a=$$('.room_name_container'),b,i;for(i in a){if(!(b=a[i]).HEAD)b.HEAD=b.innerHTML+=\"\";}})();window.headDesk=headDesk;window.sendChatMessage=sendChatMessage;void(0);")); }, 1250); }