SimpleAFK
SimpleAFK - A simple to use AFK system with advanced features
Version: v0.9.1
Tested against CraftBukkit Release Build: 1.1-R4
SimpleAFK is a very basic AFK system, though higly configurable and with some nice features. Initially I created this Plugin for my own Server stonedCRAFT.de but when it got more features and I saw no other Plugin offering a similar feature set I'd though I'd also release it here.
Optional additional Plugins:
- Any plugin that utilizes the Display Name (to make the Display Name change take any effect). For example (and tested with):
- iChat
- motd v1.0
- WorldGuard for having different Auto AFK times for protected and unprotected regions
Features:
- Set yourself as AFK
- Check if other Players are AFK
- List all Players which are currently AFK
- AFK-Booter (kick AFK players after a specified time)
- Right-Click a player to check if he is currently AFK
- Automatically set Players as beeing AFK when they Idle for a certain (configurable) amount of time (Different AFK times for protected and unprotected regions using WorldGuard)
- Change players Display Name when beeing AFK (iChat or some similar Plugin needed)
- Automatic AFK-Disable on player movement
- Block pushing of Players which are currently AFK
- Make a player automatically send a chat-message when going AFK
- Make a player automatically send a chat-message when coming back from beeing AFK
- Automatically broadcast a message when a Player goes AFK
- Automatically broadcast a message when a Player is coming back from beeing AFK
- Highly configurable through Config file:
- Change any message displayed to or automatically sent by the users (Supporting Chat Colors and Multi-Line messages)
- Enable or disable the automatic chat-messages
- Enable or disable "Automatic AFK-Disable on player movement"
- Enable or disable Display Name change and edit the pattern how to change the Name
- Enable or disable "Automatic AFK on Idle" and set time used as treshhold as well as the default AFK Message to use for this feature
Plugin usage:
- /afk [message]
Set you as AFK ([message] parameter is optional, you can also be AFK without any message)
Change your current AFK message
Set you as back from beeing AFK (when [message] is empty and you are set AFK at the moment)
- /isafk [name]
Check if the player [name] is currently AFK
- /afklist
Lists all players which are currently AFK
Plugin setup:
Just copy the SimpleAFK.jar file into your Plugins folder. Upon first startup it will create a folder "SimpleAFK" containing the default config files (all messages in english) in which you can do all further configurations. The default config file is commented and should be pretty self-explanatory ;)
You like my plugins? Please consider donating a little bit. Thanks!
@GameCharmer
Its the "AutoKickAfk" Option.
How do you disable the auto-kick? I don't see an option for it in the config...
@bassfader
Time will tell. I wish you all the best! :)
@ThisUsernameIsMine
It is allready planned for v1.0 ;) Though I am still "brainstorming" about it, and how I could solve it exactly.
@bassfader
:D @ chatting part. Looking forward to the new version! :)
edit: One problem. I'm Op and i often use Vanish No Packet to hide myself (my name also disappears from TAB and /list), but if i idle for some time the plugin still broadcasts my name/status in the chat xD.
Could you possibly add a/some nodes or toggle/switch so that i can choose if and/or when i want other players to be able to get a notification about my status? This would be great!
Best regards ;)
@ThisUsernameIsMine
About chatting: I never thought about that xD Allready created a Ticket, will be included in the next version ;)
About moving: When the option "BlockPushAfk" is set to true, a player can't be moved by anybody else (also not by mobs), but they cant move by them self either (there was no other way to solve it). Therefor I made it so that moving the mouse will set them back online again... Sorry but theres no other way to provide the "Anti-Push" feature. If you set that option to false players will be able to move and will be set back online again as soon as they do so.
I was happy when i saw this plugin, but it doesn't seem to go out off AFK when only typing on the keyboard (this also aplies to chatting). Moving the mouse works.
Thanks! :)
@h0us3cat
Seems to be related to how CommandBook gets the player name. CommandBook should utilize the Player.getDisplayName() which is modifyable by plugins, but instead it uses Player.getName() which is not modifyable at all.
Maybe ask the CommandBook developers to change that behaviour or to atleast add an option for it.
Details: The function "public static String getOnlineList(Player[] online)" uses "player.getName()" instead of "player.getDisplayName()". (CommandBookUtil.java @ 126).
As far as I can tell there is allready an option to enable or disable usage of DisplayNames, but its just not checked in getOnlineList. I've seen that option in this code here:
PlayerUtil.java @ 310:
BTW: The new version is almost ready... going to release it TODAY. Currently I am at work and will be back home in about 5 hours from now on, then I am finishing v0.9 ;)
@bassfader yes
@h0us3cat
What exactly do you mean? You mean that it doesn't display the AFK Tag anymore in front of the Players name in the /who list? Never noticed that... Going to look into it but can't promise anything...
@bassfader Can you add back support for commandbook's /who? Its broken since some commandbook updates. thx in advance
@SchwarzerZylinder @deleted_6894743 Going to work on the new version today. Sorry for the very long delay, I have been very busy in the last few weeks... I am approching a complete rewrite, though since I am able to reuse many code from the "original" it won't take that long. Expect a new Version sometime this week!
@Liger_XT5 Going to integrate this into the new Version as well.
When do you release a fix for the NullPointer on WorldGuard? Isn't it just one if(WorldGuard != null) line? =)
I keep getting errors such as this, related to WorldGuard (which I do not have installed):
2011-11-30 16:31:54 [SEVERE] Exception in thread "Thread-8070" 2011-11-30 16:31:54 [SEVERE] java.lang.NoClassDefFoundError: com/sk89q/worldedit/Vector 2011-11-30 16:31:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:64) 2011-11-30 16:31:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:38) 2011-11-30 16:31:54 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) 2011-11-30 16:31:54 [SEVERE] at java.lang.Thread.run(Thread.java:680) 2011-11-30 16:32:54 [SEVERE] Exception in thread "Thread-8137" 2011-11-30 16:32:54 [SEVERE] java.lang.NoClassDefFoundError: com/sk89q/worldedit/Vector 2011-11-30 16:32:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:64) 2011-11-30 16:32:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:38) 2011-11-30 16:32:54 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) 2011-11-30 16:32:54 [SEVERE] at java.lang.Thread.run(Thread.java:680) 2011-11-30 16:33:54 [SEVERE] Exception in thread "Thread-8204" 2011-11-30 16:33:54 [SEVERE] java.lang.NoClassDefFoundError: com/sk89q/worldedit/Vector 2011-11-30 16:33:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:64) 2011-11-30 16:33:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:38) 2011-11-30 16:33:54 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) 2011-11-30 16:33:54 [SEVERE] at java.lang.Thread.run(Thread.java:680) 2011-11-30 16:34:54 [SEVERE] Exception in thread "Thread-8271" 2011-11-30 16:34:54 [SEVERE] java.lang.NoClassDefFoundError: com/sk89q/worldedit/Vector 2011-11-30 16:34:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:64) 2011-11-30 16:34:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:38) 2011-11-30 16:34:54 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) 2011-11-30 16:34:54 [SEVERE] at java.lang.Thread.run(Thread.java:680) 2011-11-30 16:35:54 [SEVERE] Exception in thread "Thread-8338" 2011-11-30 16:35:54 [SEVERE] java.lang.NoClassDefFoundError: com/sk89q/worldedit/Vector 2011-11-30 16:35:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:64) 2011-11-30 16:35:54 [SEVERE] at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:38) 2011-11-30 16:35:54 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34) 2011-11-30 16:35:54 [SEVERE] at java.lang.Thread.run(Thread.java:680)
I like how this really works. Any thoughts of a small auto kick if AFK for too long?
I'm just looking for a plugin that puts the user into AFK mode when idle for 3-5 minutes, then after being AFK for another 10 minutes, they are kicked.