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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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);