AFK Indicator

Description

API to check player AFK status 🔗

Want to know that is a player away-from-keyboard? This mod is for you!

API Methods 🔗

afk_indicator.update(name) 🔗

Allow mods to report that the player is active at the time.

  • name: The name of the player

afk_indicator.delete(name) 🔗

INTERNAL: Remove the record of a player. Should only call once when the player leaves.

  • name: The name of the player

afk_indicator.get(name) 🔗

Get the record of a specific player, return the AFK duration, or false if the player is not online.

  • name: The name of the player

afk_indicator.get_all() 🔗

Get list of AFK records. It returns a table, with player name as key and AFK duration as value.

afk_indicator.get_all_longer_than(p) 🔗

Similar to afk_indicator.get_all(), but only return records with AFK duration longer than p.

  • p: The minimum AFK duration for the returned records.

Variables 🔗

afk_indicator.last_updates 🔗

A key-value pair of player names and AFK start time.

It's recommended to use afk_indicator.get_all() or afk_indicator.get(name), as it calculate the AFK time for you.

Chatcommands 🔗

/afk_stat 🔗

A command mostly for debugging purpose, showing the AFK time of the online players.

basic_privs is required to use this command.

Executing the chatcommand is also an action. Therefore, it's pointless to include the command executor's own AFK time as it's always 0.

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

ensure player exist

Download

2024-03-09 04:27 UTC

ensure player exist 🔗

No release notes

fix bug player is nil

Download

2024-03-09 04:24 UTC

fix bug player is nil 🔗

No release notes

Exclude Pipeworks fake player

Download

2024-03-06 08:58 UTC

Exclude Pipeworks fake player 🔗

No release notes

.get(name)

Download

2022-09-18 08:22 UTC

.get(name) 🔗

No release notes

2022-09-18

Download

2022-09-18 01:44 UTC

Ensure the player is online before update()ing 🔗

No release notes

All releases

Information

Provides

afk_indicator

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
afk_indicator
Languages
English
License
MIT
Maintenance State
Maintenance Only
Added
2022-09-18 01:37 UTC
Maintainers
1F616EMO

Used By