Inactive [INFO] SimpleAFK v0.9.1 - A simple to use AFK system with advanced features [1.1-R4]

Discussion in 'Inactive/Unsupported Plugins' started by bassfader, Jul 7, 2011.

  1. Offline

    bassfader

    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.​
    SimpleAFK Moved to BukkitDev! Click here to visit the page


    You like my plugins? Please consider donating a little bit. Thanks!
    [​IMG]


    Changelog:
    Version 0.9.1
    Code:
    Changed:
        - Fixed ConcurrentModificationException on Auto Kick
        - Fixed possible NullPointerException

    Version 0.9
    Code:
    Added:
        - Option to disable "pushing" of players who are AFK
        - AFK-Booter (kick AFK players after a specified time)
        - Broadcast Message on Afk / Back
    Changed:
        - Code completely rewritten from scratch
        - Finally fixed WorldGuard-NPE Bug when no WG is used
        - Changed Config file completely! OLD CONFIG FILES
          WON'T WORK ANYMORE!
        - Moved to Bukkits new EventHandler System
    Show Spoiler


    Version 0.8
    Code:
    Changed:
        - Fixed a nullPointerException bug
        - Optimized code structure

    Version 0.7
    Code:
    Changed:
        - (Hopefully) fixed a problem generating the config file
          on Unix based Systems
    Version 0.6
    Code:
    Added:
        - Different Auto AFK times for protected and
          unprotected regions (Using WorldGuard)
     
    Changed:
        - Problem fixed with Essentials
          (Now overriding Essentials /afk command properly)
    Version 0.5
    Code:
    Added:
        - Automatic enable (set Player as AFK after X
          minutes of Idling)
     
    Changed:
        - Optimized code structure
    Version 0.4
    Code:
    Added:
        - Changing Display Name of a user when beeing AFK
        - /afklist
          Displays a list of all Players currently beeing AFK
     
    Changed:
        - Fixed event prioritys (Thanks to Dinnerbone for his
          great explanation of these!)
        - Fixed console output (Colors not printed to Console
          anymore for console info messages)
    Version 0.3
    Code:
    First public release
     
    Added:
        - Auto-Disable on Player Move
     
    Changed:
        - Enabled Multi-Line-Messages for all messages
        - Auto-Generated Config is now much better
          structured and commented
        - Removed Version string from Sendmessages
          (so there is more space for the actual messages)
    Version 0.2
    Code:
    Added:
        - Right Click on Player to check if he's AFK or not
        - YAML Config file for configuring: Texts,
          Enabled/Disable automatic Chat messages
          (Supports colored Chat Messages)
    Version 0.1
    Code:
    Initial beta testing release
     
    Features:
        - /afk [message]
          Set yourself as AFK and automatically write a Chat
          message that you're AFK. Leave [message] blank to
          reset you're AFK status.
        - /isafk [name]
          Check if a player is currently set as AFK
     
    mc.donkeyhonk and Tim Visee like this.
  2. Offline

    rolandostar

    Awesome plugin, very simple yet powerful and organized.
    But can you implement iChat or LoginMessage plugin? (displayname [AFK])
     
  3. Offline

    bassfader

    Thanks, glad you like it :)

    Great idea with the iChart support, I'll try my best to implement it for changing the Displayed Name of the user in the Chat. I currently have no clue how to go about that, but I will look into it!

    I could also make the plugin send a message to each user joining, listing all currently AFK users. But I don't know if I can hook up into the LoginMessage plugin. But I'll take a look at this also ;)
     
  4. Offline

    Tim Visee

    Great plugin, I love the idea that you can see if somebody is AFK with a right mouse click on him :D.
     
  5. Offline

    bassfader

    Thanks :)

    @rolandostar:
    I've looked into it and am going to update the Plugin soon for changing the Players Display Names. This will work with iChat and all other Plugins making use of the DisplayName attribute. So it should also work for Plugins displaying a Login message, as long as they use the correct attribute to get the Players Display Name.

    I am also going to add an inbuilt AFK-List command to get list of all players currently AFK!

    ETA for the update is sometime between this night and tomorrow ;)


    Plugin Updated to Version 0.4!

    Code:
    Added:
        - Changing Display Name of a user when beeing AFK
        - /afklist
          Displays a list of all Players currently beeing AFK
          
    Changed:
        - Fixed event prioritys (Thanks to Dinnerbone for his
          great explanation of these!)
        - Fixed console output (Colors not printed to Console
          anymore for console info messages)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  6. Offline

    bassfader

    Plugin Updated to Version 0.5!

    Code:
    Added:
         - Automatic enable (set Player as AFK after X
           minutes of Idling)
    
     Changed:
         - Optimized code structure
     
  7. Offline

    Tim Visee

    Great, that functions to rename a player display name and that automatic enable funtion :D.
    Can you add world guard regions support, it souds crazy but some pelople (such as me) wand to have a diferend 'Auto AFK after minutes' time in a protected region, such as a big city than outside all the regions, where players can built or something else.
     
  8. Offline

    bassfader

    So you mean that there are 2 times definable in the config, one for protected regions in general and one for all other regions? Or do you mean that each protected zone has its own AFK time?

    I guess a general "protected regions Auto AFK time" should be doable, but I am not sure about individual Auto AFK times for each protected zone...

    But I'll definately look into it. And thanks for the suggestion, really nice Idea :)
     
  9. Offline

    svennp

  10. Offline

    bassfader

    Seems like it conflicts with the /afk Command from Essentials. Going to test this now and report back as fast as possible. I can maybe do something about the "Log-Spam", but I guess you'd have to disable essentials /afk command to make my Plugin work properly.

    But I'll take a look.
     
  11. Offline

    ledhead900

    How do you check for movement in this plugin, I seen other AFK plugins offer customizable hooks so and movement checks so that basic movement macro does not circimvent the afk dedection.
     
  12. Offline

    bassfader

    Basically it works like this:
    If a player moves his last position and the time when he moved will be stored. A scheduler checks frequently through the saved data and if someones position hasn't changed for a specific time (defined in the config) it will set this player as AFK.
     
  13. Offline

    ledhead900

    So how does this stop players from macroing the jump button and moving 4 blocks in a random direction and back to work around being AFK.

    The issue with most AFK systems is that you can work around them by opening a chest or macroing the attack/place block buttons and jumping and things like that. You need to check these events and ignore them and instead of going to the extreme of offering hooks to check for movement like some do have the afk check movement between first going AFK and where they ended up between each check. If its below xx amount stay AFK if it is above xx blocks moved or placed in spots other then one coord remove afk.

    Other then this it seems prettty light weight tho if u only check basic movement its ineffective for players in the know ;)
     
  14. Offline

    bassfader

    It doesn't stop players from using macros as it would be hard to detect, only way is the one you described, by setting some sort of treshhold for different actions and only if the "count value" rises above that treshhold it would set someone as not beeing afk.

    But I think thats not the purpose of this plugin as it just sets one as AFK, its not intended to kick idling players or something like that. Also such a complex detection algorithm would just "bloat" my plugin, so it wont be "Simple" anymore ^^ Its intended to be a lightweight soloution for players to set themselfes as beeing AFK so everyone else knows the are currently not at the keyboard. Nothing more nothing less.

    But really: I don't know why would someone do macros and stuff just for the sake of not beeing marked as AFK?
    If you want to kick idling players there are other plugins around to do exactly that. My plugin really isn't intended to detect idling players and kick them, its just a "feature" for your users to mark themselfs as AFK.
    The autodetection is just a complementary feature so if someone has to go quickly AFK and forgets about setting himself as AFK, it will do that for him after a certain time.



    @svennp:
    I was able to stop the "Log-Spam", though none of the AFK commands work anymore then until the one from essentials or the one from SimpleAFK is disabled.
    I am just looking more into this and try to find a better soloution (just parsing Essentials code to check what they are doing since the exception seems to rise from their code, not mine).

    @svennp:
    I've found a soloution for the problem! Going to update the plugin now and upload it here as soon as possible. Expect a new version some time today ;)

    Plugin Updated to Version 0.6!

    Code:
    Added:
         - Different Auto AFK times for protected and
           unprotected regions (Using WorldGuard)
    
    Changed:
         - Problem fixed with Essentials
           (Now overriding Essentials /afk command properly)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  15. Offline

    Tim Visee

    Thanks for adding my suggestion :)
     
  16. Hmm what did you create your config in? It seems to have a lot of these: ^M
     
  17. Offline

    bassfader

    Its an auto generated YAML config... I don't see any "^M" in there... which editor are you using?

    EDIT: I am using Notepad++ for viewing the files, but just tried it also in Windows´ standard Notepad, also in Wordpad and I can't see any "^M". Maybe just delete the config file and let SimpleAFK generate a new config file.
     
  18. Offline

    svennp

    thanks for the update, it works great now :D
     
  19. Offline

    ledhead900

    I see, I'm currrently using AFK booter
     
  20. Even the auto-generated config is showing bad formatting, simply opening it in VIM on unix console. Something is going wrong in your config generation, this is the only plugin I have seen this issue in...

    ====

    # ---------------------------------------------^M
    # SimpleAFK v0.6 auto generated config.yml file^M
    # --------------------------------------------- ^M
    #^M
    # General configuration help:^M
    #^M
    # %player - Placeholder for the Player-Name in a message^M
    # %message - Placeholder for the AFK-Message in a message^M
    ^M
    # Definition for the New Line placeholder^M
    messagesNewLineSeperator: <n>^M
    ^M
    # Enable or Disable automatic AFK Disable on Player Move^M
    autoDisableOnMove: true^M
    ^M
    # Enable or Disable automatic AFK Enable on Player Idle, set the Idle time used as treshhold (in minutes, for protected and unproteced regions) and set the AFK Message which will be automatically set^M
    # Applicable placeholders for message: NONE!^M
    autoEnableOnIdle: true^M
    autoEnableOnIdleTime: 5^M
    autoEnableOnIdleTimeProtectedRegions: 10
     
  21. Offline

    bassfader

    I really can't reproduce it here, even opening it with VIM on my Linux (Debian Lenny) Server it looks like this:

    config_in_vim.png

    I am just using a normal new line feed "\r\n" to get a new line in the auto generated Config. Could you upload you're config anywere for me to take a look at? I really need something I can reproduce to try to fix it...
     
  22. I dunno, I suggest checking what method other plugins use to generate a config? You are probably using a non-portable method.
     
  23. Offline

    bassfader

    For now just open VIM and enter the following command:
    :%s/^M/\r/g
    (Press CTRL+V to enter the ^ and press CTRL+M to enter the M)

    This should replace all ^M to normal new line feeds in VIM.

    And I'm going to take a look at it but really can't promise anything as I am pretty much unable to test anything I change in that case due to me not beeing able to reproduce the error.
     
  24. Offline

    Kohle

    Source please?
     
  25. Well I opened your config in Windows in n++, copied that to a fresh config file in vim, and that fixed it. Albeit my point was not that I couldn't manually fix it, but that the config generator is not portable :p

    Small grammar fix: beeing --> being

    Last 2 lines :)
     
  26. Offline

    bassfader

    Maybe sometime in the future, not yet :p Have a specific question how somethings working? Write me a PM and I'll sure try to explain or send you some example code ;)

    Reached over 200 Downloads so far, still not a single donation...
    Well, here's the new version anyways:

    Version 0.7
    Code:
    Changed:
        - (Hopefully) fixed a problem generating the config file
          on Unix based Systems
     
  27. Offline

    an0x

    thx man i searched a while for a plugin like thix thank you
     
  28. Offline

    h0us3cat

    cb #1000
    simpleafk 0.7
    Code:
    2011-07-20 22:42:22 [SEVERE] java.lang.NullPointerException
    2011-07-20 22:42:22 [SEVERE]     at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.isPlayerInRegion(sAfkIdleScheduler.java:56)
    2011-07-20 22:42:22 [SEVERE]     at de.stonedCRAFT.SimpleAFK.sAfkIdleScheduler.run(sAfkIdleScheduler.java:35)
    2011-07-20 22:42:22 [SEVERE]     at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-07-20 22:42:22 [SEVERE]     at java.lang.Thread.run(Unknown Source)
     
  29. Offline

    bassfader

    @h0us3cat
    Looking into it right now.

    @h0us3cat
    Is it possible that you do not have WorldGuard on your server?

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

    h0us3cat

    I have worldguard & worldedit
    it is spamming btw, so not x time.
     

Share This Page