-
Notifications
You must be signed in to change notification settings - Fork 5
Macros
Macros allow multiple commands to be run from a single menu item.
/sms macro add mymacro1 \Hello!
/sms macro add mymacro1 \And now goodbye!
This creates a macro "mymacro1" with two entries - one to make the player say "Hello!" and one to make the player say "And now goodbye!".
Note the leading backslash (\) - this is needed for text that should be spoken by the player when the CommandSigns plugin is being used to process commands.
/sms macro list
2 lines (page 1/1)
---------------------------
1 macros
1) mymacro1
---------------------------
/sms macro list mymacro1
3 lines (page 1/1)
---------------------------
2 commands
1) Hello!
2) And now goodbye!
---------------------------
/sms macro remove mymacro1 2
Removed command from macro 'mymacro1'.
/sms macro remove mymacro1
Removed macro 'mymacro1'.
You need to prefix the macro name with a '%' sign.
/sms add mymenu1 Macro test|%mymacro1|Tested macro!
Macros can even call each other:
/sms macro add mymacro2 /time day
/sms macro add mymacro1 %mymacro2
The plugin will, however, detect recursive loops and stop their execution, posting a warning.
All macros are stored in commands.yml, which can be edited directly if you choose. However, be sure to do a "/sms reload" immediately after any changes to ensure they don't get overwritten when the plugin next does a save.
Maybe you want to allow some players to switch the game time to day or night via a sign. But you also want everyone on the server to know who's doing the switching.
/sms macro add daytime \I'm making it daytime now!
/sms macro add daytime /@time day
/sms add mymenu Daytime|%daytime
Now, when a player executes that menu item, they'll tell the entire server that they've done it.