CommandMacro
CommandMacro by Astantos
Description:
This plugin allows users to group multiple commands from any plugin together as a macro command under this plugin. Macros can have permissions assigned, and allows users to bypass permissions they would otherwise require (e.g. a player who can't use /give will still be able to use /give as part of a macro, IF they have permission for that macro). Commands can be individually delayed. All settings are managed using the config.yml file.
NOTE: this is a tiny project that I was using to learn how to code plugins. It's not anything amazing, feel free to use this if it might help your servers :)
Instructions:
- On the first time running CommandMacro (henceforth the plugin), a config.yml file will be created under the directory:
plugins\CommandMacro\config.yml - The default configuration file should have some examples. ExampleMacro is a useless macro: it should have no effect whatsoever.
- All new macros should be added to the config file created by this plugin, in the format specified (see Format). Macros should be called by the name provided under the NAME tag for that macro.
- This plugin passes commands directly to the console! While this means players can use commands WITHOUT needed the appropriate permissions for each individual command, it also means that any command which implicitly refers to the user (e.g. /home) will NOT work.
FORMAT:
All Macros should follow the layout of the ExampleMacro.
For clarity, all SPACES are noted by a [].
The layout is:
macro0:
[][]name:[]macroName
[][]permission: commandmacro.something
[][]command0:#-command[]argument0[]argument1
[][]command1:#-command[]argument0
Commands can be added as necessary. There shouldn’t be a limit (well there is because of the rules of programming, but that number is 2,147,483,647 so . . . ). All tags (name, command1 etc) should be kept to the same format as provided by the example.
MACRO tag must be different for each macro. For maximum clarity, name MACRO tags as macro0, macro1, macro2 . . . and so forth.
macroName is the name of the macro. This should be what you want to type when you want to write the macro (see Usage). These names must be different or you will end up running more than one macro.
command is the command that you want to run. There can be as many arguments after that command as necessary. Command tags (e.g. command0) must be different. If identical command tags are located by the plugin, only the last identical command tag will run.
permission is the permissions tag that allows individual macros to be assigned different permissions. Because of the way I had designed it, use 'ALL' to tag a macro that should be accessible to everyone.
# is the delay before the command executes, in Minecraft ticks. There are, on without lag, about 20 ticks a second.
To refer to the macro user, use the code CMSENDER.
Example: Change weather to clear, then kill the macro user after 20 seconds:
macro300:
name: skincancer
command0: 0-weather clear
command1: 400-kill CMSENDER
USAGE:
/cmreload Reloads the plugin’s config.yml file to incorporate changes
/cmlist Lists all the currently set macros and their command calls.
/cmrun macroName Runs the macro ‘macroName’ as specified in the config file.
-
View User Profile
-
Send Message
Posted Aug 2, 2017Good plugin!
How do you make each first join player executes a macro?
REgards.