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

by Limon
Run virtual horse racing bets for game server players through Takaro. horseRacing lets players bet currency on scheduled or staff-run races, then pays winners based on race results.
Use this module to:
  • 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.
Good fit for communities that want race betting, server minigames, economy sinks, and repeatable player events managed through Takaro.
communityTakaro main
(2 versions available)

Components Overview

1
config
8
commands
1
hooks
2
Cron Jobs
1
functions
2
permissions

New Module: horseRacing

NEW
August 12, 2025
Updated to version latest. Added 8 commands: horseLeaderboard, 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)

minBetnumber
minBet

Minimum amount required to place a bet

Default: 50
Constraints: min: 1
maxBetnumber
maxBet

Maximum amount allowed for a bet

Default: 1000
Constraints: min: 1
Horsesarray
Horses

List of horses that can race. Format: HorseName; Odds (whole number) - one horse per line

Default:Array of 7 items
"Thunder; 2"
"Lightning; 3"
... and 5 more items

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.

horseLeaderboard

/horseleaderboardTrigger Command

Description

View top bettors by winnings and win rate

Function Implementation

horseLeaderboard Function

JAVASCRIPT

Usage Example

Player types: /horseleaderboard

horseStats

/horsestatsTrigger Command

Description

Shows your betting history, win rate, and favorite horses

Function Implementation

horseStats Function

JAVASCRIPT

Usage Example

Player types: /horsestats

startrace

/startraceTrigger Command

Description

Immediately starts a horse race with current bets

Function Implementation

startrace Function

JAVASCRIPT

Usage Example

Player types: /startrace

lastRace

/lastRaceTrigger Command

Description

No help text available

Function Implementation

lastRace Function

JAVASCRIPT

Usage Example

Player types: /lastRace

horses

/horsesTrigger Command

Description

No help text available

Function Implementation

horses Function

JAVASCRIPT

Usage Example

Player types: /horses

nextRace

/nextraceTrigger Command

Description

No help text available

Function Implementation

nextRace Function

JAVASCRIPT

Usage Example

Player types: /nextrace

horseBet

/horsebetTrigger Command

Description

Name of the horse you want to bet on

Arguments (2)

horse
stringPosition 0
Help: Name of the horse you want to bet on
Default: ""
amount
stringPosition 1
Help: Amount of currency to bet
Default: ""

Function Implementation

horseBet Function

JAVASCRIPT

Usage Example

Player types: /horsebet <horse> <amount>

mybets

/myhorsebetsTrigger Command

Description

No help text available

Function Implementation

mybets Function

JAVASCRIPT

Usage Example

Player types: /myhorsebets

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

1 hook

test

logEvent Type
Pattern Match
takaro-hook-regex-placeholder

This hook only triggers when the event data matches this regular expression pattern.

Function Implementation

test Hook Function

JAVASCRIPT
Event Details
Event Type:log
Trigger:Pattern Match Required
Category:System Events

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

0 0 * * *Schedule

Schedule Details

Cron Expression
0 0 * * *
Human-Readable Schedule

Daily at midnight

Function Implementation

announceRace 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).

runRace

0 0 * * *Schedule

Schedule Details

Cron Expression
0 0 * * *
Human-Readable Schedule

Daily at midnight

Function Implementation

runRace 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.

utils

functionReusable Component

Function Implementation

utils Function

JAVASCRIPT

Import Usage

Import: import { utils } 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.

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

2 permissions

Horse Racing Admin

HORSE_RACING_ADMINPermission Key
Description

Allows the player to manage horse races

Permission Details
Full Key:HORSE_RACING_ADMIN
Can Have Count:No
Category:General

Place Horse Racing Bets

HORSE_RACING_BETPermission Key
Description

Allows the player to bet on horse races

Permission Details
Full Key:HORSE_RACING_BET
Can Have Count:No
Category:General

About 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.