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.

GeneralstockMarket

by Limon
Add a configurable stock market economy to Takaro game servers. GeneralstockMarket lets players buy and sell virtual stocks, track portfolios, and react to market events using in-game currency.
Use this module to:
  • Create sectors, stocks, prices, and volatility settings.
  • Let players buy, sell, inspect markets, and view portfolios.
  • Run scheduled market updates and price changes.
  • Trigger admin market events that affect stock behavior.
  • Add a longer-term economy loop beyond simple currency rewards.
Good fit for communities that want trading, investment gameplay, server economy depth, and repeatable financial events managed through Takaro.

Module details

Stock Market: A Dynamic Virtual Trading System
Create an immersive economic experience with this comprehensive stock market module that lets players invest, trade, and react to market events.
Market Features:
Market Summary
  • Multiple Economic Sectors: Configure various industry sectors (Technology, Healthcare, Energy, etc.) each with their own market dynamics.
  • Realistic Stock Behavior: Stocks have configurable volatility, sector-based pricing, and react differently to market events.
  • Dynamic Market Events: Random or admin-triggered events like "Global Pandemic" or "Tech Boom" impact different sectors in realistic ways.
Market Events
Trading System:
  • Buy & Sell Shares: Players can purchase stocks and sell them later for profit or loss.
  • Transaction Fees: Configurable fee percentage on all trades creates a realistic market economy.
  • VIP Benefits: Special permissions for designated "Stock Brokers" who receive fee discounts.
Buy Stock Example
Players can track price changes and sell at the right moment to maximize profits or minimize losses.
Sell Stock Example
Player Portfolio:
  • Portfolio Tracking: Players can view their holdings, average purchase prices, and current profit/loss.
  • Transaction History: System tracks all buy/sell transactions for each player.
  • Summary Statistics: See overall portfolio performance and value across all holdings.
Portfolio View
Market Information:
  • Detailed Stock Info: Players can research specific stocks, including risk levels and sector trends.
  • Industry Filters: View stocks by specific sectors to better understand market segments.
  • Market Alerts: Server-wide notifications for significant price changes keep players engaged.
Stock Information
Industry View
Configuration Options:
  • Sectors & Stocks: Define your own market sectors and individual stocks with customizable starting prices and volatility.
  • Market Events: Create unique events with specific sector impacts to drive market dynamics.
  • Transaction Settings: Configure fee percentages, VIP discounts, and alert thresholds.
  • Event Frequency: Control how often random market events occur and how long they last.
Commands:
  • /markets [industry] - View all stocks or filter by industry
  • /stockinfo [ticker] - Get detailed information about a specific stock
  • /buystock <ticker> <amount> - Purchase shares of a stock
  • /sellstock <ticker> <amount> - Sell shares from your portfolio
  • /stockportfolio - View your current holdings and performance
  • /triggerevent [event] - Admin command to trigger specific market events
Perfect for servers wanting to add economic depth, encourage player engagement, and create opportunities for strategic gameplay!
communityTakaro v0.0.24
(2 versions available)

Components Overview

1
config
6
commands
0
hooks
2
Cron Jobs
0
functions
4
permissions

New Module: GeneralstockMarket

NEW
August 6, 2025
Updated to version latest. Added 6 commands: buystock, sellstock, stockportfolio, markets, stockinfo, triggerevent. Added 2 scheduled tasks: updatestockprices, marketnews. New permissions: STOCK_MARKET_USE, STOCK_MARKET_TRADE, STOCK_MARKET_BROKER, STOCK_MARKET_TRIGGER_EVENT. New configuration options: sectors, stocks, marketEvents, eventFrequency, defaultEventDuration, transactionFee, vipDiscount, priceAlertThreshold.

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)

sectorsarray
Market Sectors

Define economic sectors for categorizing stocks

Default:Array of 5 items
id:"TECH"
name:"Technology"
id:"HEALTH"
name:"Healthcare"
... and 3 more items
stocksarray
Stocks

List of stocks available for trading

Default:Array of 8 items
id:"AAPL"
name:"Apple Inc."
sector:"TECH"
... and 2 more properties
id:"MSFT"
name:"MicroSoft Corp"
sector:"TECH"
... and 2 more properties
... and 6 more items
marketEventsarray
Market Events

Special events that can impact the market

Default:Array of 5 items
id:"PANDEMIC"
name:"Global Pandemic"
description:"A worldwide health crisis affe..."
... and 1 more properties
id:"OIL_CRISIS"
name:"Oil Supply Crisis"
description:"Major disruption in oil supply..."
... and 1 more properties
... and 3 more items
eventFrequencynumber
Event Frequency

Average number of cronjob runs between market events (0 to disable events)

Default: 10
Constraints: min: 0
defaultEventDurationnumber
Default Event Duration

Default number of cronjob runs an event lasts if not specified in the event definition itself

Default: 5
Constraints: min: 1, max: 20
transactionFeenumber
Transaction Fee

Percentage fee charged on all buy/sell transactions (5 = 5%)

Default: 5
Constraints: min: 0, max: 25
vipDiscountnumber
VIP Discount

Percentage discount on transaction fees for players with the STOCK_MARKET_BROKER permission (50 = 50%)

Default: 50
Constraints: min: 0, max: 100
priceAlertThresholdnumber
Price Alert Threshold

Percentage change that triggers a market alert (10 = 10%)

Default: 10
Constraints: min: 5, max: 50

UI Schema

No configuration properties defined. This module uses default settings.

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 (6)

These commands can be executed by players in-game. Each command has a trigger word, optional arguments, and executes JavaScript code on the server.

buystock

/buystockTrigger Command

Description

Buy shares of a stock

Arguments (2)

stock
stringPosition 0
Help: The stock ticker symbol
Default: ""
amount
numberPosition 1
Help: Number of shares to buy
Default: ""

Function Implementation

buystock Function

JAVASCRIPT

Usage Example

Player types: /buystock <stock> <amount>

sellstock

/sellstockTrigger Command

Description

Sell shares of a stock

Arguments (2)

stock
stringPosition 0
Help: The stock ticker symbol
Default: ""
amount
numberPosition 1
Help: Number of shares to sell
Default: ""

Function Implementation

sellstock Function

JAVASCRIPT

Usage Example

Player types: /sellstock <stock> <amount>

stockportfolio

/stockportfolioTrigger Command

Description

No help text available

Function Implementation

stockportfolio Function

JAVASCRIPT

Usage Example

Player types: /stockportfolio

markets

/marketsTrigger Command

Description

View stock market prices and activity. Use '/markets ALL' to see all industries, or specify an industry name (e.g., '/markets TECH') to see stocks in that industry only.

Arguments (1)

Industry
stringPosition 0
Help: View stock market prices and activity. Use '/markets ALL' to see all industries, or specify an industry name (e.g., '/markets TECH') to see stocks in that industry only.
Default: "all"

Function Implementation

markets Function

JAVASCRIPT

Usage Example

Player types: /markets <Industry>

stockinfo

/stockinfoTrigger Command

Description

Shows all available stocks in the market. Use with a ticker symbol (e.g., /stockinfo ticker) to see detailed information about a specific stock.

Arguments (1)

ticker
stringPosition 0
Help: stock ticker or ALL to get detailed information about a specific stock
Default: "all"

Function Implementation

stockinfo Function

JAVASCRIPT

Usage Example

Player types: /stockinfo <ticker>

triggerevent

/triggereventTrigger Command

Description

Shows all available market events when run without parameters. Use with an event name (e.g., /triggerevent TECH_BOOM) to trigger a specific market event.

Arguments (1)

EventName
stringPosition 0
Help: Event name to trigger a specific market event
Default: "all"

Function Implementation

triggerevent Function

JAVASCRIPT

Usage Example

Player types: /triggerevent <EventName>

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.

Scheduled Jobs (2)

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

updatestockprices

5 4 * * *Schedule

Schedule Details

Cron Expression
5 4 * * *
Human-Readable Schedule

At minute 5 at 4 AM on every day of the month in every month on every day of the week

Function Implementation

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

marketnews

0 */1 * * *Schedule

Description

gives you market news

Schedule Details

Cron Expression
0 */1 * * *
Human-Readable Schedule

At minute 0 of every 1 hours on every day of the month in every month on every day of the week

Function Implementation

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

Permissions (4)

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

4 permissions

Stock Broker

STOCK_MARKET_BROKERPermission Key
Description

VIP status that reduces transaction fees

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

Trade Stocks

STOCK_MARKET_TRADEPermission Key
Description

Allows the player to buy and sell stocks

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

Trigger Market Events

STOCK_MARKET_TRIGGER_EVENTPermission Key
Description

Allows admins to manually trigger market events

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

Use Stock Market

STOCK_MARKET_USEPermission Key
Description

Allows the player to view market prices and their portfolio

Permission Details
Full Key:STOCK_MARKET_USE
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.