> For the complete documentation index, see [llms.txt](https://nightexpress.gitbook.io/sunlight/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nightexpress.gitbook.io/sunlight/modules/afk.md).

# 😴 Afk

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

## Commands & Permissions

* [Commands](/sunlight/general/commands.md#afk-module) link.
* [Permissions](/sunlight/general/permissions.md#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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
