# 😴 Afk

Monitors player activity and executes certain actions when players considered as "afk" and when they comes back.

## Commands & Permissions

* [Commands](https://nightexpress.gitbook.io/sunlight/general/commands#afk-module) link.
* [Permissions](https://nightexpress.gitbook.io/sunlight/general/permissions#afk-module) link.

## Features

* ✅ **Activity Points**. Players considered as active/afk based on their actions.
* ✅ **Run Commands**. Run custom commands when player enters/leaves afk mode.
* ✅ **Idle Time**. Customizable auto-afk time based on player ranks and permissions.
* ✅ **Kick Time**. Customizable auto-kick afk players time based on player ranks and permissions.
* ✅ **Placeholders**. Display player activity status in tablist and nametags using PlaceholderAPI.

## Configuration

### Activity Points

Activity points used to determine whether player is active or not. Every activity resets player's idle time to zero if player is not in afk mode. Otherwise, activity points accumulates up to required amount to move player out of afk mode.

You can configure them at `WakeUp` -> `ActivityPoints`.

### Commands

To setup commands when player leaves afk mode, use `WakeUp` -> `Commands` setting.

To setup commands when player enters afk mode, use `AFK` -> `Commands` setting.

**Syntax example:**

```yaml
Commands:
- say %player_name% is afk.
- broadcast %player_name% is afk.
```

### Idle and Kick Times

You can edit them at `AFK` -> `Idle_Time` and `AFK` -> `Kick_Time`.

There is enough config comments explaining both options, read them carefully to setup it properly.

One thing you should know is that `Kick_Time` **includes** `Idle_Time`.&#x20;

**Example**: With idle time 60 and kick time 90, player will be kicked after being afk for 30 seconds (60 + 30).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nightexpress.gitbook.io/sunlight/modules/afk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
