module

Advanced Macros

Endorsements
3
Installs
34.43%
Comments
0
Latest version1.11
Minimum Core0.8.5
Compatible Core0.8.6
Last updated1 week ago
Created4 months ago
Authors
Languages English
中文
Systems All systems
Project source Project URL

With Advanced Macros, a "Run Macro" button will appear in macro configuration windows to allow you to quickly test your macro and see its results. Do note that if you use an asynchronous macro which never resolves, you may end up with a macro in an invalid state if you end up cancelling the changes.

 

Check out the Macros compendium for some useful macros that showcase the advanced macros system as well as provide additional features.

 

In the case of chat macros, you can now use handlebars templating to render your chat text using common helpers, or use it along with the macro helper to call other macros, like for example {{macro "name of my macro" actor 3 "a text argument"}}

 

In the case of script macros, you can now use a return statement for the early return paradigm, but also to retun a string which can then be used in chat macros. You will also be able to receive arguments via an array named args, and you can use the await keyword to make your script asynchronous. Do note however that if you create an async macro, it cannot be used to return text in a chat macro when using the {{macro}} helper. It will still be executed if used, but will be considered to have returned an empty string. If you want to use an async macro that prints its results to chat, read further for the use of recursive async chat commands.

 

Besides those two enhancements to macros, you can now also create a temporary chat macro with handlebars templating directly from the chat entry, by entering text in the chat that includes the handlebars mustache characters {{ }}. You will also be able to call your macro directly from chat with the / prefix. As an example, you can send in the chat /my-macro-name argument1 argument2 argument3. If your macro name has spaces in it, you can call it with /"My macro name" "argument one" 100 for example. You can also call multiple macros by writing them one per line.

 

In addition, you can now recursively call macros, so you could call a script or chat macro which returns a /macro-name text for it to call the macros recursively.

 

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x