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.
horseRacing
- Configure horses, odds, and race timing.
- Let players place racing bets with in-game currency.
- Show race stats, leaderboards, recent races, and upcoming races.
- Run betting events on a schedule or through staff control.
Components Overview
New Module: horseRacing
NEWhorseLeaderboard, horseStats, startrace, lastRace, horses, nextRace, horseBet, mybets. Added 1 hook: test (log). Added 2 scheduled tasks: announceRace, runRace. Added 1 function: utils. New permissions: HORSE_RACING_BET, HORSE_RACING_ADMIN. New configuration options: minBet, maxBet, Horses.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 (3)
minBet
Minimum amount required to place a bet
50maxBet
Maximum amount allowed for a bet
1000Horses
List of horses that can race. Format: HorseName; Odds (whole number) - one horse per line
"Thunder; 2""Lightning; 3"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.
Commands (8)
These commands can be executed by players in-game. Each command has a trigger word, optional arguments, and executes JavaScript code on the server.
horseStats
Description
Function Implementation
horseStats Function
JAVASCRIPTUsage Example
startrace
Description
Function Implementation
startrace Function
JAVASCRIPTUsage Example
lastRace
Description
Function Implementation
lastRace Function
JAVASCRIPTUsage Example
horses
Description
Function Implementation
horses Function
JAVASCRIPTUsage Example
nextRace
Description
Function Implementation
nextRace Function
JAVASCRIPTUsage Example
horseBet
Description
Arguments (2)
horse
stringPosition 0""amount
stringPosition 1""Function Implementation
horseBet Function
JAVASCRIPTUsage Example
mybets
Description
Function Implementation
mybets Function
JAVASCRIPTUsage Example
About Module Commands
Commands allow players to interact with your module through chat. Each command has a trigger word that players type (prefixed with /), optional arguments for parameters, and a JavaScript function that executes when the command is used. Arguments are automatically validated and passed to the function.
Hooks (1)
These hooks respond to various game events automatically. Each hook executes JavaScript code when its specific event type occurs, allowing modules to react to player actions, system changes, and more.
System Events
test
Pattern Match
takaro-hook-regex-placeholderThis hook only triggers when the event data matches this regular expression pattern.
Function Implementation
test Hook Function
JAVASCRIPTEvent Details
About Module Hooks
Hooks allow your module to respond automatically to game events like player actions, server status changes, and chat messages. Each hook has an event type that determines when it triggers, optional regex patterns for filtering specific events, and a JavaScript function that executes when the conditions are met. Hooks are grouped by category for better organization.
Scheduled Jobs (2)
These jobs run automatically on a schedule defined by cron expressions. Each job executes JavaScript code at specific times or intervals.
announceRace
Schedule Details
Cron Expression
Human-Readable Schedule
Daily at midnight
Function Implementation
announceRace Function
JAVASCRIPTCron Expression Format
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).
runRace
Schedule Details
Cron Expression
Human-Readable Schedule
Daily at midnight
Function Implementation
runRace Function
JAVASCRIPTCron Expression Format
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.
utils
Function Implementation
utils Function
JAVASCRIPTImport Usage
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.
Permissions (2)
These permissions control who can access different features of this module. Administrators can assign these permissions to roles, allowing fine-grained access control.
General Permissions
Horse Racing Admin
HORSE_RACING_ADMINPermission KeyDescription
Allows the player to manage horse races
Permission Details
HORSE_RACING_ADMINPlace Horse Racing Bets
HORSE_RACING_BETPermission KeyDescription
Allows the player to bet on horse races
Permission Details
HORSE_RACING_BETAbout Module Permissions
Permissions control access to module features and functionality. Each permission has a unique key for identification, a friendly name for display, and a description explaining what it allows. Some permissions are countable, meaning they can have numeric values or limits assigned. Administrators assign these permissions to user roles to control who can use different module features.







































