Module: command_warmup
Overview
This module allows defining a cooldown
before command execution.
Color Boxes
The command_warmup
module is before
the command execution.
The command_cooldown
module is after
the command execution.
NOTE: Players with level permission 4 can bypass the command warmup.
◉ The command warmup
will NOT be applied if...
-
The command source is
the console
. -
The command source is
admin
(level permission >= 4) -
The command source has the
warmup bypass permission
for that command.
◉ Set up the warmup for all commands.
Regex: .+
The .
character in regex means match any character
.
The +
character in regex means a quantifier, one or more times
.
◉ Set up the warmup for all commands, but specify a special setup for /back
command.
You can just write the config section
for /back
command at the top
of rules.
The rules
are matched
from up to down, and the first matched rule
will be used.
So, you can just write the special rule
at the top of other rules.
◉ Set up the warmup for all command, except the /back
command.
Regex: (?!back).+
The regex use the negative lookahead
, to exclude the string that starts with back
.
◉ Share the same warmup setup for multiple commands.
Regex: (back)|(heal)|(feed)
You can use the alternative character |
in regex
.
Configurations
The following JSON content is provided for reference only. It must NOT be copied directly into the configuration directory, as it does not represent valid JSON syntax.
- File Name:
config.json
- File Content:
Click to see the default
content...
{
/* Should we send a warning message for no movement? */
"warn_for_move": true
/* Defined `warmup` rules. */,
"rules": [
{
"tags": [
"default-tag-name"
],
"command": {
"regex": "back",
"warmup_time_ms": 3000
},
"interruptible": {
"enable": true,
"interrupt_distance": 3.0,
"interrupt_on_damaged": true,
"interrupt_in_combat": true
}
},
{
"tags": [
"default-tag-name"
],
"command": {
"regex": "heal",
"warmup_time_ms": 1000
},
"interruptible": {
"enable": true,
"interrupt_distance": 3.0,
"interrupt_on_damaged": true,
"interrupt_in_combat": true
}
}
]
}