ClearCommand

Adds a /clear command to chat to clear chat messages.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==   
// @name            ClearCommand
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.1.0
// @description     Adds a /clear command to chat to clear chat messages.
// @include         http://www.kongregate.com/games/*/*
// @homepage        http://userscripts.org/scripts/show/94190
// ==/UserScript==   
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname)) {
setTimeout(function() {
	javascript:void(window.location.assign("javascript:void(document.observe('holodeck:ready',function(){holodeck.addChatCommand('clear', function(){holodeck.activeDialogue().clear(); return false});$$('select.chat_actions_dropdown').each(function(e){if(!e.innerHTML.include('clear_chat'))e.insert('<option value=\"clear_chat\" class=\"action hasLayout\" onclick=\"holodeck.activeDialogue().clear()\">Clear chat</option>')});$$('#chat_actions_dropdown_template').each(function(e){e.innerHTML=e.innerHTML.replace(/(<\\/select>)/i,'<option value=\"clear_chat\" class=\"action hasLayout\" onclick=\"holodeck.activeDialogue().clear()\">Clear chat</option>$1')});}));"));
}, 1250);
}