MiscCommands *OLD*

Adds slap commands

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            MiscCommands *OLD*
// @namespace       skyboy@kongregate
// @description     Adds slap commands
// @author          skyboy
// @include         http://www.kongregate.com/games/*/*
// @homepage        http://userscripts-mirror.org/scripts/show/75201
// @version 0.0.1.20160401080327
// ==/UserScript==
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname))
window.location.assign("javascript:function foc(){holodeck.activeDialogue()._input_node.focus();};function s(b,a){sendChatMessage('*slaps'+a.replace(/\\/slap/,'')+' with a trout*');foc();return false};function r(a){return a.replace(/\\\\(?!u[0-9a-fA-f]{4}|x[0-9a-fA-f]{2})/g, '\\\\\\\\')};function sp(b,a){sendPrivMessage('*slaps you with a trout*',a); return false};function sendChatMessage(a){dispatchToKonduit({type:KonduitEvent.ROOM_MESSAGE,data:{message:r(a),room:holodeck.chatWindow()._active_room._room}});return a;};function sendPrivMessage(a,b){dispatchToKonduit({type:KonduitEvent.PRIVATE_MESSAGE,data:{message:r(a),username:b.replace(/\\/\\S*\\s([\\s\\S]+)/,'$1')}});return a;};holodeck.addChatCommand('slap', s);holodeck.addChatCommand('pmslap', sp);void(0);")