Skip to content
wiseguy12851 edited this page Jun 28, 2013 · 11 revisions

< Back to home page

Credit to wiseguy12851 for creating this page

Table of Contents

General

The general format of the config.yml file is:

define:
  key: value
  coolglowystone: 89
  $me: $player

aliases:
  CommandName:
    define:
      both: this and that
    command: someCommand
    runCommand:
      - say This
      - say That
      - say $key $coolglowystone $$p
      - say $both
    runAs: CONSOLE
    strictArgs: yes
    successMessage: some message
  • In this file, some keys are optional while others are required. Not including a required key won't cause any problems but will cause the entire command group to be ignored.
    For example: in the code above, if the 'command: someCommand' were to be left out then the whole 'CommandName' group will be ignored.

Reference

define (Optional)
Allows you to define your own special variables that are available to all commands in the runCommand section, simply put the variable name on the left and the value to be replaced with on the right. To use simply prefix the variable name with a $ in your runCommand list
Tip: This section is always run first, that means you can achieve some helpful or interesting tricks by replacing any built-in special variables / commands with your own, modify them, or make aliases to them.
Tip: This section is run from the top to the bottom, that means you can create your own variables who expand into more of your own variables etc...
Warning: variables defined here are expanded on match, that means, for example, if you define a variable $p and in one of your commands you are using the built-in variable $player then the $p in $player will be matched and expanded giving undesired output
aliases (Required)
All alias sections must go under here
aliases > CommandName (Required)
Marks the section name of the alias, inside this section is the command, runCommand, runAs, etc... Beyond that it has no other purpose except for permissions.
Note: This plugin creates a permission node for each CommandName, the node is SudoAlias.alias.X where X is the CommandName.
aliases > CommandName > define (Optional)
See the define section mentioned above, this is the same as that except on a local scope. Any defines mentioned here will only be available to that alias. Also these list of defines get processed first before the Global Defines. All the same warnings and tips apply here as well.
aliases > CommandName > command (Required)
This is what the user will type to start the chain of commands. It can be typed from the server console or from the player chatbox no matter what runAs is.
Question marks can be placed after the command name to indicate placeholders for arguments which will be available to your command chain
Warning: If question marks are present then the arguments are required and not using one in a command will result in the entire alias being ignored unless strictArgs is disabled (See below).
aliases > CommandName > runCommand (Required)
list on each line the commands you want to run, the preceding slash is added for you
Note: To use worldedit commands that have 2 slashes add one instead as the other will be added for you.
Note: Any argument placeholders that are in the command will be available to all of the runCommand's, they can be accessed by $# where # is the position of the question mark, 2 arguments can be accessed by $0 and $1, etc..., arguments can be used more than once and not all arguments have to be used
aliases > CommandName > runAs (Required, Case-Insensitive)
Should the command be run from the console or the logged in player, if the console then enter CONSOLE otherwise PLAYER
Note: PLAYER does not mean the player name.
aliases > CommandName > strictArgs (Optional)
Should the arguments be required or optional, if set to yes or true then the argument are required and they must match exactly. If set to no or false then the arguments are ignored, the command will take any number of arguments.
Note: The argument variable number will only be filled in for the number of arguments sent to the command. In other words, if you have $5 in your run command and only 2 arguments are entered the $5 won't be used and will be sent as it is "$5"
aliases > CommandName > successMessage (Optional)
If present it outputs when the command has finished running
Warning: Despite it's name, it only outputs when the list of commands has finished being executed not when they all execute correctly, that means if some commands fail to execute then this message will still appear.

Special Commands and Variables

The following can be entered into the runCommand list

Special Commands

These Commands must be entered on their own line alone

$wait:### (Milliseconds)
This is a special command to insert a pause of a specified time before the next command is executed
Warning: If a single number doesn't follow the ':' then the pause may be ignored or defaulted to 1000 milliseconds
Note: 1000 milliseconds is in a second
Special Variables

These Variables can be entered anywhere in any command even special commands, they can be repeated as often as needed and put in any order

$player
The player name who issued the command
$#
The number of the provided argument starting with 0
For Example: $0, $1, $2, etc...

Examples

Some Examples

Bare Minimum

Using only the mandatory fields
By typing /lol it will print out Laugh Out Loud (^_−)−☆ to the rest of the server players.
aliases:
  SayLol:
    command: lol
    runCommand:
      - say Laugh Out Loud (^_−)−☆
    runAs: PLAYER

Minimum with Arguments

Using mainly the mandatory fields but with an argument
by typing /cry and an argument like /cry WHY! it sends out to the server players
WHY!

。・°°・(>_<)・°°・。

aliases:
  SayLol:
    command: cry ?
    runCommand:
      - say $0
      - say 。・°°・(>_<)・°°・。
    runAs: PLAYER