Simple AFK
About
Working in 1.5.1
This plugin will monitor players when they are afk. It's pretty simple.
You can also configure it so that if they're afk for too long it will kick them.
You can also configure an "AFK" prefix for when they're afk.
This plugin was really just made for personal use on my server (IP: 2rb.fiscalleti.com), But i decided to make it public.
Just put the jar file in your plugins and you're set :)
You can configure everything in the config.
Config
The Config should look like this:
# You can use %PLAYERNAME% or %PLAYERDISP% # Wait times are based on a 20 TPS server tick rate Prefix: Enabled: true AfkPrefix: "&4[AFK]&f" Afk: Enabled: true Time: 60 # The time before the player becomes AFK in seconds NoLongerAfk: "%PLAYERDISP% is no longer AFK" IsAfk: "%PLAYERDISP% is AFK" Radius: 5 # How far they can move without being set to "Not Afk" Kick: Enabled: true Time: 60 # The amount of time AFTER the player has become AFK to to wait before kicking them in seconds KickReason: "%PLAYERDISP% was AFK for too long!"
Commands
- /afk [player] - Sets a player to afk. If you leave the "[player]" empty it will set your self to afk.
Permissions
- simpleafk.exempt - Makes the user exempt from being set to AFK
- simpleafk.afk.self - Allows a player to set themself to afk using /afk
- simpleafk.afk.other - Allows a player to set another player to afk using /afk [player]
Download
V0.8
Changelog -
- Fixed Concurrent modification exceptions.. Again
http://dev.bukkit.org/server-mods/simple-afk/files/6-simple-afk-v0-8/
V0.7
Changelog -
- Fixed Concurrent modification exceptions
http://dev.bukkit.org/server-mods/simple-afk/files/5-simple-afk-jar-v0-7/
V0.6
Changelog -
- Fixed AFK tag being left when plugin disabled
http://dev.bukkit.org/server-mods/simple-afk/files/4-simple-afk-jar-v0-6/
V0.5
Changelog -
- Fixed Thread Exception Errors
- Fixed simpleafk.exempt Permission
- Fixed players leaving by pressing "X" errors
- (Recompiled in jre6 instead of jre7 using craftbukkit 1.4.4)
http://dev.bukkit.org/server-mods/simple-afk/files/2-simple-afk-jar-v0-5/
V0.1
Changelog -
Source Code
https://github.com/thefiscster510/Simple-AFK
Thanks to PoopYou for getting me started with plugin coding!
http://dev.bukkit.org/bukkit-plugins/afkplus/
Players get kicked after 1.667 min, wether I configured 15 and later 1800 minutes/seconds.
Seems like not working.
If i walk straight it sets me afk and then not afk over and over.
I did write an advanced version of an AFK system, named AdvancedAFK. You may take a look at it, if you want to update some code.
It has alot more features including AFKTerminator api for AFKMachine detection.
It has an API which lets plugins get if a player is afk.
And alot more configurations.
Have fun
Why simple afk no got kicked?
There is already a bug...
I'm using SimpleAFK.jar V0.7 for CB 1.4.7-R1.0 and whenever someone does the command /afk nothing happens. There are no errors in the console and no messages in chat.
My serveur crash when a player is kick !!
There is some bugs on 1.4.7 already :/
I've set time to 90 sec
Hey, on 1.4.6 I'm having trouble with players not un-afking if they move or type. I set the radius to 1, and it still has trouble. I had another AFK plugin that waited for a player to type or move their mouse, or use WASD, but it went inactive. I'd love to see this type of innovation put into this plugin as well :)
@coldog22
If you're talking bout how long until it kicks players, it is in the bottom section of the config. Go back and look at it again.
@coldog22
.. The what?
You need to add a command where you can add a number (minutes) for how long you want the afk killer to delay. as of now it is extreemly short.
@ray73864
Version 0.6 :3
Also noticed an issue with turning the plugin on and off.
We have plugman installed for managing our plugins which allows us to load, unload, enable and disable a plugin (using all standard bukkit stuff), and if i unload or disable the plugin while people are afk, the AFK tag is never removed from them.
Would it be possible to get the onDisable set up so that when the plugin is unloaded/disabled, it does a cleanup of all AFK tags?
@BobbySoSlo @ray73864 @gawelium Fixed all issues, See V0.5 (Recompiled in jre6 instead of jre7 using craftbukki 1.4.4)
oh, forgot to mention, i have compiled this against the most recent beta build of Bukkit.
I had issues where i couldn't /afk another person because i have the exempt permission set on me, so i've forked and made a pull request with my changes to the code, improved it a decent amount, some things i still have to improve, but all in all, it works nicer now.
I haven't fixed the below issue that i keep receiving on occasions yet though.
getting some errors like the following on the console:
14:47:48 [INFO] pieterjoosten was AFK for too long!
14:47:48 [SEVERE] Exception in thread "pool-1-thread-265"
14:47:48 [SEVERE] org.apache.commons.lang.UnhandledException: Plugin Simple AFK v0.1 generated an exception while executing task 21
at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:839)
at java.util.HashMap$KeyIterator.next(HashMap.java:874)
at me.thefiscster510.betterafk.Afk.run(Afk.java:14)
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:53)
at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
... 3 more
We are running the plugin in 1.4.2, i know it wasn't designed for that but some plugins work regardless, and for the most part, this one seems to work fine, it just has the odd issue.
Hi ! I add the permission : simpleafk.exempt for admin group but i was kick ! Why please ?
Hi, just wondering, what unit of time is the afk time in? (ie. the 60), is it minutes? ticks?