Custom Commands

User Triggered Actions aka Custom Commands

Triggers can be activated by users in the BattleMetrics interface. There are three types of triggers that can be activated in the interface.
All actions are available the same as they would be for any other type of trigger.
This feature is currently not allowed for personal triggers.

Trigger Types

Player Action

Adding the Player Action trigger type will allow users to select this trigger from the player commands dropdown found on the detailed server page and under a player's command dropdown.
This is the only type that can reference a player and use player actions.

Server Action

Adding the Server Action trigger type will allow users to select this trigger from the Server Commands dropdown on the detailed server page.

Server Broadcast Action

Adding the Server Broadcast Action trigger type will allow users to select this trigger from the Server Commands dropdown on the dashboard.
This action type operates on multiple servers and as a result can not use variables for input defaults.

Server Selection and Command Availability

You choose where your trigger can run by selecting actions and which servers those actions run on. 
The trigger will only be visible if there are actions that would run for the server. The trigger must be enabled for it to be visible.

Trigger Inputs

String

A string input is a standard input that allows the user to provide text. It allows for just about any type of input.

Number

A number input will restrict input to numbers and, optionally, to within a range that you provide.
You may use variables for the default value, but if they do not resolve to a number it will be as though you provided no default.

Duration

A duration input is simply a number input with a helper to automatically convert between time units.
You may choose between the following units: seconds, minutes, hours, and days.
Smaller units than the selected unit will not be allowed. For example if you choose the hour unit then seconds and minutes will not be available.
The unit determines how the provided input will be output. If a user selects 1 hour and the unit is set to minutes the value will be 60 for variables and conditions.
The default value is assumed to be in the correct unit.

Boolean

A boolean input will render as a checkbox and is used for simple true/false/yes/no options.
The default value can be static (always true or false) or the result of a condition.

Select

A select input will render as a dropdown and allow the user to select one of the provided options.
There is a limit of 25 options.
Options must have a value, but a label is optional. The value, label, and default status reference trigger variables.
The default value can be static (always true or false) or the result of a condition. The first option with a default value that resolves to true will be used.

Conditions

In addition to all standard trigger conditions and variables there are a few that are specific to user actions.
  • user.id is the ID of the user that triggered execution.
  • user.nickname is the nickname of the user that triggered execution.
  • input.<name> the value of the trigger input can be used in conditions and as a variable in templates.

Permissions

Permission must be granted before a trigger can be executed by users. After creating a trigger a permission will become available in the permissions editor. Permissions can be given at the organization level or limited to individual servers.
The permissions for triggers can be found under Player and Server Trigger Actions. Permissions share their names with the trigger.

Results

A log of actions taken, conditions evaluated, and command responses is shown to the user after running a trigger. The purpose of the log is to provide feedback on what happened and why. Depending on the information used in the trigger and commands executed this log could contain sensitive information. If you disable the visibility of the log (see below), that permission will limit what appears in the log.

Condition Log

If the trigger's condition uses information that an end user should not see then "Log Condition Result" should be disabled.

Action Response

Most trigger actions will have some kind of response. The response is visible by default and can be disabled by clicking the eye found at the top of each action. This also controls if the condition evaluation log should be shown for the action.

If the action condition, options, or command response contains information that an end user should not see then the response should be hidden.

Toggling the action's response visibility has no impact on the ability to use the response in conditions or templates.

Action responses are capped at 20KB (20,480 bytes) and are always treated as strings.

Still need help? Contact Us Contact Us