1. These forums are still being retired! Please use GitHub discussions or Discord. You cannot create new threads or new accounts now. If you need to contact some user of the forums, you should do it sooner, rather than later. This notice was last updated on May 30th, 2021.

[1.15] AFK Warp / Kick Plugin

Discussion in 'Unsupported / Outdated Plugins' started by DarkunderdoG, Nov 11, 2013.

  1. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    Description:

    AFK Warp taken from and improved upon from the Jail / Prison plugin. When idle for the defined time will auto warp you to the "afk" warp or if you type /afk. Newly added is the ability to kick people after being AFK for a set time. See the below permissions and commands.

    Permission(s):
    • afk.comm - Gives users access to /afktime , /afk, and /back
    • afk.cfg - Gives users access to /afkwarptime , /afkkicktime and /afkreload
    • afk.nokick - Prevents users from being kicked or receiving kick messaging
    Command(s):
    • /afktime - provides users details about their afk status
    • /afk - warps users to afk
    • /back - warps users back to where you were (Talking or warping outside the afk region also does this)
    • /afkwarptime - allows users to change the duration of when a person is warped to afk
    • /afkkicktime - allows users to change the duration of when someone is kicked because they were afk
    • /afkreload - reloads the afk config file
    Config File Options:

    "afkwarp": true, (Do you want afk warping enabled)
    "afkkick": true, (Do you want afk kicking enabled)
    "afkwarptime": 300, (Duration before warped to afk)
    "afkkicktime": 700, (Duration before kicked)
    "afkspam": 20 (Duration before the user can use /afk again)

    Usage:

    For AFK Warp:
    Create a region with "afk" in the name​
    Create a warp called "afk" within the afk region - if you want to hide it do /warp hide afk true​
    (Now users can use /afk)​

    For AFK Kick:
    No setup required other than to have it enabled. It will warn users at 3 times before kicking them. (at 70%, 80%, and 90% of the afkkicktime)​
    Give users you don't want to be kicked the afk.nokick permission​

    Links:
     
    • Like Like x 3
  2. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    How does it check if you're afk?'

    also /back conflicts with essentials /back command.

    I've actually used region flags to define a nomobs region and a warp called AFK and an alias command for/afk and /unafk to tp in and out of this region.

    all i want is somethign that warps ppl there if theey are afk, but the thing is, if you have ravens or minions of some kind, killing things, you're not technically afk.

    I want it to check if your pos xy has changed in x time, as opposed to the games afk method check.
     
  3. Ancientgods

    Plugin Developer Zero Day Plugin Author

    Joined:
    Sep 15, 2013
    Messages:
    712
    Looking into source code helps, yes it checks if you moved position every second
     
  4. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    Pink also just make sure afkwarp is true and then don't give users the afk.comm and it will only warp people there if they are afk - Also if you need me to make you a version that has those commands are named something different let me know.
     
  5. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    Sure.

    I just want a plugin with no commands, just the option to warp players to the warp point called "afk" (ie force them to run "/warp afk") after being afk for a defined period of time.
     
  6. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    https://dl.dropboxusercontent.com/u/16051044/PinkAFK.dll

    Source Changed: (Removed non admin commands)


    Code:
            public void OnInitialize()
            {
                SetupConfig();
                Commands.ChatCommands.Add(new Command("afk.cfg", AFKreload, "afkreload"));
     
                if (AFKConfig.afkwarp)
                {
                    Commands.ChatCommands.Add(new Command("afk.cfg", setwarptime, "afkwarptime"));
                }
                if (AFKConfig.afkkick)
                    Commands.ChatCommands.Add(new Command("afk.cfg", setkicktime, "afkkicktime"));
            }
     
    • Like Like x 1
  7. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
  8. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    FYI - to get back to where they warped from they can either just type or walk out of the afk region (Just make sure the afk warp is in a region that has afk in the name)
     
  9. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    I have alias commands that do the following

    /afk - /warp afk
    /unafk - /warp spawn

    ive setup warp points for the afk zone, and a warp at the spawn point so they dont get stuck if tehy had a bed somewhere.

    and also as i mentioned, essentials has a /back commadn that tps you back to where you just teleported from.
     
  10. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    Awesome! Well let me know if you have any questions! :)
     
  11. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    ok i installed it and it looks like it works, but when someone goes afk, where does it put them?

    or did you make it do "/warp afk" like now i metnioned i had mine setup?



    Nevermind, my warp was called AFK, i made one called afk too and it sends them their now.

    Sweet.

    Also, the notice with ppl Being back from afk "YAY", how doe that work? is it a check to see if they have moved and just tps them back to where they were?
     
  12. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    If they move out of the region named afk or off the location of the warp named afk or if they say anything it warps them back
     
    • Like Like x 1
  13. pink_panther

    pink_panther Level 9

    Joined:
    Oct 14, 2013
    Messages:
    370
    Ah ok. sweet.
     
  14. IamUSER

    IamUSER Level 7

    Joined:
    Jul 29, 2013
    Messages:
    184
    Great job man! Can't believe i missed it!
     
  15. IamUSER

    IamUSER Level 7

    Joined:
    Jul 29, 2013
    Messages:
    184
    Is it possible that this will see a region labeled "afk2" or something as an afk region also? Essentially im looking to make multiple afk spots.
     
  16. Brockway

    Brockway Level 6

    Joined:
    Aug 10, 2011
    Messages:
    143

    multiple afk spot sounds great.
     
  17. DarkunderdoG

    Plugin Developer

    Joined:
    Jul 21, 2011
    Messages:
    239
    IamUser any region that has the word "afk" in it acts as a afk spot - however currently only one is warped to are you looking for mutiple /afk warps?
     
    • Like Like x 1
  18. IamUSER

    IamUSER Level 7

    Joined:
    Jul 29, 2013
    Messages:
    184
    I can make alias commands to add warps. Thanks for the info Dark :D
     
  19. IamUSER

    IamUSER Level 7

    Joined:
    Jul 29, 2013
    Messages:
    184
    One idea I just had Dark... An auto response if you type the name of someone in afk. "____ is currently away from their keyboard." Maybe make it customizable?
     
  20. specialops0

    Plugin Developer

    Joined:
    Jul 29, 2013
    Messages:
    415
    Could you please add your update to this? :)