AutoAfk

Automatically marks you as AFK after a specified period of time greater than zero. Type "/aafk time_in_minutes" to automatically go afk after time_in_minutes; "/aafk 0.1" will mark you as afk 6 seconds after you send a message

当前为 2016-03-06 提交的版本,查看 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name            AutoAfk
// @namespace       skyboy@kongregate
// @author          skyboy
// @version         1.1.0
// @description     Automatically marks you as AFK after a specified period of time greater than zero.  Type "/aafk time_in_minutes" to automatically go afk after time_in_minutes; "/aafk 0.1" will mark you as afk 6 seconds after you send a message
// @include         http://www.kongregate.com/games/*/*
// @exclude         http://www.kongregate.com/games/*/*/*
// @homepage        http://userscripts.org/scripts/show/72449
// ==/UserScript==
if (/^\/?games\/[^\/]+\/[^\/?]+(\?.*)?$/.test(window.location.pathname))
setTimeout(function() {
window.location.assign("javascript:(function(){var a=ChatDialogue.prototype.sendInput,t=function(){clearTimeout(window.skyAFKTimer);window.skyAFKTimer=setTimeout(\"holodeck.setPresenceAway();\",window.skyAFKTimout||900000);a.apply(this,arguments)};holodeck.addChatCommand(\"aafk\",function(b,d){var a=window.skyAFKTimout=(parseFloat((d.match(/^\\/aafk\\s*((?:(\\d+)?\\.\\d)|\\d+)/i)||[0,\"15\"])[1],10)*60000)||900000;Cookie.set(\"afkAFKTimeout\",a);window.skyAFKTimer=setTimeout(\"holodeck.setPresenceAway();\",a);return false});holodeck.chatWindow()._rooms.each(function(T){T.value._chat_dialogue.sendInput=t});window.skyAFKTimeout=parseInt(Cookie.get(\"afkAFKTimeout\"),10)||900000;(function(){try{if($(holodeck.chatWindow()._active_room.usernameNodeId(holodeck.username())).parentNode.className.match(/\\baway\\b/)){return;}}catch(e){clearTimeout(window.skyAFKTimer);var a=window.skyAFKTimeout||900000;window.skyAFKTimer=setTimeout(\"holodeck.setPresenceAway();\",a);arguments.callee.delay((a+50)||10)}}).defer()})();void(0)");
}, 1250);