Takaro module library

Takaro Modules

Takaro is a game server management platform for running, automating, and moderating multiplayer communities. These modules install into Takaro to add server automation, Discord workflows, economy systems, and moderation tools.

SVMPlaytimeRewards

by SVMOTNIK
This Takaro module acts as an automated playtime-based reward system for game servers, granting configured items to online players at fixed or random intervals.
Use this module to:
  • Track accumulated playtime and reward players with configured item pools.
  • Control drop chances and single-item or multiple-item selection modes.
  • Define role-specific reward profiles, intervals, and item pools for Takaro or Discord-synced roles.
  • Send success notifications through server broadcasts, private messages, or a dedicated Discord channel.
For 7 Days to Die item codes, use https://commands.gg/7dtd/items.
communityTakaro 0.0.0

Components Overview

1
config
0
commands
0
hooks
1
Cron Jobs
1
functions
0
permissions

Configuration

Configure this module using the schemas below. The JSON schema defines the data structure, while the UI schema customizes how the configuration form is displayed.

Configuration Schema

Configuration Properties (8)

playtimeIntervalMinutesinteger

Minimum reward interval in accumulated playtime minutes. This is also the fixed interval when playtimeIntervalMaximumMinutes is empty.

Default: 120
Constraints: min: 1
playtimeIntervalMaximumMinutesinteger

Optional maximum reward interval in accumulated playtime minutes. Leave empty or set equal to playtimeIntervalMinutes for a fixed interval; set it higher to choose a random interval per player and reward cycle.

Constraints: min: 1
selectionModeenum

Grant at most one passing item or every item whose chance passes.

Default: single
Allowed values (2):
singlemultiple
rewardMessagestring

Message after a successful reward. Supports {playerName}, {playerId}, {gameId}, {items}, {itemCount}, {profileName}, and {intervalMinutes}.

Default: {playerName} received {items} after {intervalMinutes} minutes of playtime.
messageDeliveryenum

Where successful reward messages are sent: broadcast to the server, private message only to the rewarded player, both, or off.

Default: broadcast
Allowed values (4):
broadcastprivatebothoff
playtimeRewardDiscordChannelIdstring

Optional Discord channel ID where reward notifications will be sent.

Default:
itemsarray

Default item pool.

Default: [] (empty array)
roleOverridesarray

Reward profile overrides for Takaro roles, including Discord-synced roles.

Default: [] (empty array)

UI Schema

No UI schema defined. Configuration form will use default rendering.

About Configuration Schemas

The Configuration Schema defines the structure and validation rules for module settings. The UI Schema customizes how the configuration form is displayed in the Takaro interface, including field ordering, labels, and input types.

Scheduled Jobs (1)

These jobs run automatically on a schedule defined by cron expressions. Each job executes JavaScript code at specific times or intervals.

grant-playtime-item-rewards

*/5 * * * *Schedule

Description

Grant item rewards to online players who reached a new playtime interval.

Schedule Details

Cron Expression
*/5 * * * *
Human-Readable Schedule

Every 5 minutes

Function Implementation

grant-playtime-item-rewards Function

JAVASCRIPT

Cron Expression Format

minute hour day-of-month month day-of-week

Each field can contain numbers, ranges (1-5), lists (1,3,5), or wildcards (*). Use */n for intervals (e.g., */5 for every 5 units).

About Scheduled Jobs

Cron jobs allow your module to execute code automatically on a schedule. Each job has a cron expression that defines when it runs, and a JavaScript function that executes at those times. Jobs run server-side and can perform maintenance tasks, send notifications, or update game state automatically.

Functions (1)

Reusable JavaScript functions that can be imported and used by other module components like commands, hooks, and cron jobs. These promote code reuse and modularity.

playtime-item-reward-helpers

functionReusable Component

Function Implementation

playtime-item-reward-helpers Function

JAVASCRIPT

Import Usage

Import: import { playtime-item-reward-helpers } from './utils';

About Module Functions

Functions are reusable JavaScript components that can be imported and used by commands, hooks, and cron jobs within your module. They promote code reuse, improve maintainability, and allow you to organize complex logic into modular pieces. Functions must be exported with proper ES6/CommonJS syntax to be importable by other components.