Plugin Request: SimpleAFK

Discussion in 'Archived: Plugin Requests' started by coolperez8, Aug 2, 2014.

  1. Offline

    coolperez8

    Plugin category: MISC.

    Suggested name: SimpleAFK

    What I want: Basically, this plugin allows players to go AFK and other players can see if they're AFK or not by using a simple command. Basically, it generates a folder, with two files, one being "config.yml", and the other one is "counters.yml". In the config, there are several lines, one of them reads "afkcommandstage=2". This is basically the stage in the counters.yml that is triggered when a player runs the command /afk, the next one says "cooldown=30", I'll get into it later. The plugin also has a separate count for each player that is reset to 0 when the player does an action such as walking, talking in chat, or disconnecting, And in the counters.yml file, each line is 1 stage, it is basically formatted like this:

    -1="&cThe Player &4[playername] &cseems to be &eoffline&c."
    0="&cThe Player &4[playername] &cdoes not seem to be &4AFK&c."
    30="&cThe Player &4[playername] &cis probably &4AFK&c."
    300="&cThe Player &4[playername] &2is &4AFK&c."
    86400="&cThe Player &4[playername] &cprobably forgot he left his Minecraft running for a full day."

    Basically, the lines must be in numeral order, if they aren't, the plugin will sort them out. The first two lines must say "-1" and "0", however anything after the equal sign doesn't count. If the first lines don't say "-1" or "0", it will be regenerated in the plugin config with the default messages. Also, the text in quotes is basically what it says when the player tries to check if somebody is AFK. Also, if the plugin notices a line that's not in proper format, it will put a hash symbol right before the line, so if the line says "puppies!", it will change it to "#puppies!" and ignore it. Oh, here's also what the config.yml looks like.

    disableafkcommand=false #self-explanitory
    afkcommandstage=2
    cooldown=30

    Ideas for commands:
    /afk - go afk.
    /checkafk (playername) - checks the target player's AFK counter, then reports a message in "counters.yml" according to the counter.
    /setafkcount (playername) (amount) - sets the player's AFK counter to that amount.
    /freezeafkcount (playername) - freezes the player's AFK count
    /checkfreezeafk (playername) - checks if the player's AFK count is frozen, the player who checked will get a message from counters.yml that has the smallest value but is above 0 if it's frozen, and the message that is labeled 0 if it's not, if there is not a value above 0, and the target player's afk counter is not frozen, the checker will get a message that says "missingno." (The value is the number before the equal sign).

    Ideas for permissions: simpleafk.admin - Allows use of commands other than /afk or /checkafk.

    When I'd like it by: August 3rd.
     
  2. Offline

    567legodude

    coolperez8 The only difference between this and the essentials /afk is that you want a different message to appear if they have been AFK for longer. I would suggest sticking to the essentials /afk command, it works perfectly fine.
     
  3. coolperez8 Do I have this right? You want an AFK plugin but with these extra features?

    • Different messages depending on how long they've been AFK
    • Automatic mark as AFK
    • The ability for an admin to change how long someone has been AFK
    • I don't really get the whole "checkfreezeafk" message, couldn't there just be a separate message? Seems more logical :p
     
  4. Offline

    coolperez8

    Yes, basically the checkfreezeafk message just checks if they're afk, how about instead have it report true if the counter is frozen but false if it isn't, also don't forget the ability to freeze the AFK counter so it stays the same and doesn't count up.
     
  5. Offline

    coolperez8

    sorry, I meant the checkfreezeafk checks if they're afk counter is frozen.
     
  6. coolperez8 Should work now https://www.dropbox.com/s/oxhyj1i7jnicg4z/TimedAFK.jar

    Is a little different from what you wanted, but hopefully it's okay.

    Commands:
    /afk - Go afk
    /afk check <player> - Check the player
    /setafk <player> <time> - Set the player's afk timer
    /freezeafk <player> - Freeze the player's afk timer

    Example config:

    Code:
    # The time, in seconds, that AFK timer should be updated
    check-frequency: 10
    # The value that the counter should be set to when a player types /afk
    afk-point: 30
     
    # Here are the messages that should be sent for each stage of AFK. Please use a number for the key.
    # Colour codes are supported, and %player% will be replaced with the player's name.
    messages:
      offline: '&cThe Player &4%player% &cseems to be &eoffline&c.'
      0: '&cThe Player &4[playername] &cdoes not seem to be &4AFK&c.'
      30: '&cThe Player &4[playername] &cis probably &4AFK&c.'
      300: '&cThe Player &4[playername] &2is &4AFK&c.'
      86400: '&cThe Player &4[playername] &cprobably forgot he left his Minecraft running for a full day.'
     

Share This Page