Inactive [MECH] AFK v1.5 - An Advanced AFK System [1000]

Discussion in 'Inactive/Unsupported Plugins' started by isamgray, Jul 20, 2011.

  1. Offline


    AFK - Advanced AFK System
    Version: v2.0​
    This plugin gives you a nice AFK system to start with. I will add extra features if they are requested, but I think this is a good start. I hope you all enjoy it!​
    • Makes the "/afk" command toggle your AFK status in-game.
    • When you try talking, /telling, interacting(mining, etc.), or moving while AFK, it will automatically get rid of your AFK status.
    • Sending a /tell to a person who is AFK will let you know they're AFK, yet they'll still receive the message.
    • Puts a green [AFK] tag in front of your display name.
    • While AFK your immune to creatures targeting you, as long as one wasn't already targeting you when you went AFK.
    • If the server is full, and some online users are AFK, and another user is trying to login, it will kick a AFK user to make room for the new user.
    • Now generates a folder called "AFK" with a "properties.txt" that allows you to disable/enable two of the major functions of this plugin.(protection from monsters, and kick AFKers for new room for users)
    Features Coming:
    • Expand the property list to include ability to disable/enable every feature.
    • Auto-marking people as AFK after a certain amount of time doing nothing.
    • Auto-kick AFK players after a certain amount of time.
    • Keep track of the time someone has been AFK.(hopefully useful for when the plugin API gets written, so other plugins can communicate with this)
    • Figure out a way to detect if the player moved, or if something else forced them to move.
    Change Log:

    Version 2.0
    • Just modernized to use the new API. Tested and works on the beta 1.3.2-R0.1 Everything seems to work fine like before. The source is still available via the link above on github too. :)
    Version 1.5
    • Adds a property file to enable/disable some features.
    Version 1.42
    • Fixes a bug with Entity targeting.

    Version 1.41
    • Fixes a bug that spams the server full of targeting information.

    Version 1.4
    • Now kicks AFK users if the server is full and needs room for a new logging in user.

    Version 1.3
    • Now people who are AFK can not be targeted by creatures. However, to keep from people abusing the /afk command just to get immunity, if a creature already has them targeted before they go AFK, they will still be attacked and also become un-AFK'ed.

    Version 1.2
    • Now if a player interacts with the world at all(tries mining, etc.) while AFK, it'll disable the AFK status.

    Version 1.1
    • Changed the way AFK gets disabled. Now whenever you move, /tell, or chat while AFK it automatically gets rid of your AFK status.
    • AFK people will still receive any /tell messages they get.
    Version 1.0
    • Just the initial release with the features listed above.
    Version 1.5
    • Adds a property file to enable/disable some features.
  2. Offline


    I like this. It's a good start, it's practical, and most importantly, it's functional.
    Nice :)
  3. Offline


    Thank you. I'm also thinking about adding it so AFK players can't move. Not sure if people would like that feature or not though. lol

    Got any suggestions for other features I should add?
    meiamone likes this.
  4. Offline


    Perhaps instead of making them unable to talk or use just "/tell" when afk, why not mark them as not afk any longer? As if they are chatting, or sending a message, they clearly are not AFK.

    Also, when you send a message to someone who is AFK, do not cancel the event, simply tell them that the person is AFK. This allows users such as myself who have ImprovedChat to scroll up and see any missed messages.
  5. Offline


    How about AFK people aren't able to be killed by mobs / PVP ?
  6. Offline


    Very nice ideas, working on implementing them now. Thank you!

    I'll work on that for sure. :) Thanks for the suggestion, it's a very good one!
  7. Offline


    maybe it they do something while afk, it reminds them they're afk, people on my server forget to /afk all the time when they get back, just an idea. and hopefully you'll get your dev status soon
  8. Offline


    I just added a new version. I think this method of doing things(that NuclearW suggested) is much better than my original idea.

    Also, Crash, I'm working on your idea now. It's proving to be a bit strange, because of how I have moving get rid of AFK status. When you get hit by a monster it moves you, thus getting rid of the AFK status, and thus allowing the monster to damage you. Trying to figure out a way around that now. It'll be in version 1.2 if I can figure it out.
  9. Offline


    maybe you could make it so mobs couldn't enter any space within a 3 block radius, or something like that...
  10. Offline


    I was thinking about something like that. However, people might abuse the /afk command just to become immune to enemy attacks...I'm not sure if that's a good thing. So I'm actually not sure if I'm even going to add that feature. It might just make people have to make sure they're in a safe area before going AFK.
  11. Offline


    Or you could check if a player moved or anything, and if so, he no longer is AFK?
  12. Offline


    Already have that included with version 1.1. (read the first post, it's in the feature list/change log)
  13. Offline


    Aah, my bad but that fixes the risk of players cheating to be safe I'd say?
  14. Offline


    Not exactly because if I use noah's idea of monsters can't get in a 3 block radius of an AFK user, then if someone sees a monster coming at them they can quickly just use /afk.

    I have an idea that I'll look into implementing when I can tonight. Typing this from my iPhone btw, so excuse any mess ups.
  15. Offline


    got an idea, no mobs can get in 3 blocks, but if you move at all, then they're atomatically not afk anymore. so you can use it, and your protected, but if you move, and/or use a tool/block, you're screwed,
  16. Offline


    That's sorta already how it works. If you move you go un-AFK. I just now coded it so if you interact with something your AFK status goes away too.

    I'm trying to figure out a way to see if the player moved himself, or if it's something else forcing him to move. Cause if a player is AFK, and another player bumps him, which moves him slightly, the player's AFK status goes away.

    Version 1.2 is available now. Source is also synced up with it.

    Sorry for the double post(I don't know if that's frowned upon here or not) but I just updated to 1.3. It gives AFK users immunity to creatures targeting them. Read the change log for full details. I think this covers all the requests for features thus far...Anything else anyone?

    I think with version 1.3 this is a very solid AFK system that will work on most server types.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  17. Offline


    Very nice plugin, i needed an AFK plugin that auto removes AFK once they move, also very nice feature with the anti mobs, i have a feature suggestion, not sure how difficult this is but,

    Possible if a player is afk, via /afk, if another player speaks to the player (via saying their name) the plugin either /msg's them saying they are AFK or just prints out on screen "X is afk"

    Just a suggestion.
  18. Offline


    Do you mean if a player tries to /tell a player who is AFK, they player sending the message will get alerted that they're AFK? Or do you mean in just normal chat if a player's name is mentioned, then they'll get alerted they're AFK.

    If it's the latter of those two options, I'm not going to implement it. That would put a lot of strain on the server having to check through every message, and parse every message, and sometimes the person might not even be talking too that person, just about them. In which case, I doubt they'd want to be alerted about their AFK status.

    Thanks for the compliments, and the suggestions though. :p I hope this plugin fits your needs!
  19. Offline


    was just a vague suggestion, i see what it is not possible, and after i wrote it i thought, that could get really anoying... haha. nice work on the plugin tho!
  20. Offline


    This is already in the plugin. Read the feature list. :)

    Direct quote from the features list in the first post.
  21. Offline


    Is it possible to add a feature which will kick a person who is AFK too long?
  22. Offline


    I'll look into it.
  23. Offline


    Cool. I just thought it would be useful for servers since you don't want players to just sit there when there are other players who want to log in (but can't due to space limitations). Thanks!
  24. Offline


    I just might make it so that when a player tries to logon, and there is an AFKer, and the server is full, it'll kick the AFKer and replace him with the new guy. If that makes any sense...
    meiamone likes this.
  25. Offline


    That definitely does. I'm not just saying it is the better option, nor is it easier to implement (cause I have no clue how Java works), but I have an economy that pays based on how long someone is logged in, so I don't want "farmers." Though the idea of kicking the AFKer is no doubt useful too. I'd use both.
  26. Offline


    Working on that right now. :) It'll be included in the next update to the plugin.

    Just updated to version 1.4. This now kicks AFK users if the server is full, and needs space for a new logging-in user. The source on github is also updated to 1.4.

    There may have been a better way for me to program in this new feature, but I did it the easiest/simplest way. I may go back and refactor it once I gain some more knowledge of the workings of Bukkit/Java.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
  27. Offline


    Awesome plugin! I have three requests/suggestions:
    1. Can you add an option to auto-mark players afk if they haven't done anything (move, chat, break a brick, etc.) in X minutes?
    2. Can you add a method for other plugins to find out if a player is afk or not for integration into other features? eg. A plugin that pays players for time spent playing on the server, but subtracts afk time to prevent exploitation.
    3. The kick when server is full is great, but an option to kick after X minutes of afk would be awesome for people with home servers trying to conserve their crappy dsl bandwidth.
  28. Offline


    I'll try and work on number 1 first. I'm not sure exactly how I'll do it, but it'll be on my to-do list for this plugin. It won't be happening right away, cause I'm focusing on plugins for my friend's and I's server right now.

    2.) I'm not really sure how I could set it up to communicate with other plugins. I'd have to look into how to do that...I'm still very new to this plugin/Java scene. haha

    3.) I'll look into doing that as well.

    Thanks for the suggestions! I hope you enjoy using my plugin with the features enabled so far. :)
  29. Offline


    Being immune to creatures could help you in pvp, me thinks :p
  30. Offline


    I guess it does slightly. But it doesn't make you immune to other players. So on PVP server, you still need to make sure your safe before going AFK.

Share This Page