Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

how do I bundle macros

Hallo Guys i have a question i play Roll20 for more than 2 Years as Game Master and at this time i Great a lot of Macros so i like to Great One Macro to bundle several Macros at one.  as example: i Have 3 Atacks 1. Atack Fist, 2. Atack Sword and 3 Atack Magic now they New Macro Atack locks like this: it dosent Work but i cant Understand why hope some one can Help me. pls
1681593484
timmaugh
Forum Champion
API Scripter
It's because of the order of operations, where macros are expanded before queries are resolved. This often leads to query-breaking characters ending up in the command line. Commas, vertical pipes, and right braces are the problematic characters, because the parsers read them as part of the query... Intended to move the parsing to another "part" of the query. You can perform HTML replacements for these characters in your macros, but then they won't work called on their own. They'd have to be run through a query. That isn't good. The common suggestion is to do a chat menu, so you can click a button to launch your macro... But you can also do Fetch constructions for the macros and leave them in the query format. I'm on my phone, so if no one can provide links for the order of operations, HTML replacements, and chat menus, I'll try to do it later. I'll also give a Fetch example.
1681595205
Gauss
Forum Champion
To add to what timmaugh wrote, here are some links:  Macros HTML Entities Chat Menus In general I would suggest switching to Chat Menus instead of queries for what you are trying to do.  Also, it appears you are using Collection tab macros, that won't work well for what you are trying to do because a Collection tab macro doesn't play well with HTML entities.  I would switch to Ability macros, or if they are game wide macros for your players switch to using ability macros on a Macro Mule for all of your macros instead of collection tab macros. 
1681736901

Edited 1681740857
timmaugh
Forum Champion
API Scripter
Thanks Gauss, for the links! Here is a Fetch + ZeroFrame example, using your macros. The thing to remember with these is whether or not the command line of each sub-macro is sending a standard chat message or a mod-script message. If it is sending a standard message, we are going to have to use a ZeroFrame {&simple} construction to output the message to chat. Quick Explainer In order to engage the metascripts (like Fetch & ZeroFrame), we need to start our message with an exclamation point. That creates a message that is sent to the Script Moderator instead of the chat panel. Once the metascripts are done, if what is left in the command line is intended for a script, we can just let it go (the message passes from the metascripts into the normal scripts). On the other hand, if what is left in the command line would have been intended to hit the chat (for instance, the result of the query leaves a Fetch construction that retrieves a macro, and that macro is intended to be a simple chat ouput message), then we need to include the {&simple} tag to make that happen. Placement of the SIMPLE We can put the {&simple} tag in a few places... we can put it in each sub-macro, or we can put it in the top-level macro that bundles the others up in a query. If we put it in the top-level macro, we can put it outside the query (to make it apply to any/all query options), or we can put it in individual query options if we want it to apply to some but not all potential choices. Typically, for a number of reasons I won't get into right now, I suggest putting the {&simple} in the top-level macro wherever it is needed. I am going to assume that every macro in your set is a standard message, so we can get away with putting it outside the query. That would look like this: !?{Which macro?|Attack Fist,#(Atack-Fist)|Atack Sword,#(Attack-Sword)|Atack Magic,#(Attack-Magic)} {&simple} Just for the sake of example, if we assume that the first 2 options in that query (Attack Fist and Attack Sword) were supposed to be simple chat messages but the last (Attack Magic) was a call to a mod script), then we would have to include the {&simple} inside the query for the first 2 options. Since that tag has a character that would break a query (the closing brace), we'll have to do an HTML replacement on it. The final version of the macro where the first two query options were intended to be simple chat output while the third would be a mod script call would look like this: !?{Which macro?|Attack Fist,#(Atack-Fist)  {&simple} |Atack Sword,#(Attack-Sword)  {&simple} |Atack Magic,#(Attack-Magic)} REQUIRED SCRIPTS: ZeroFrame , Fetch
First, Big Thank for the detailed explanation, i have solved the Problem with the help of Chat Menus (Again thx for it) to Justify i have no Experience at Comon Skripting, Coding and so forth all my knowledge cames from Try and Error at roll20 and one or two Youtube tutorials xD --> if it cames to HTML, Java or some other subjects i am out. to the last Again Thx for the Help
1682189870
Kraynic
Pro
Sheet Author
I make extensive use of chat menus.&nbsp; If you haven't checked out the article on macro character sheets, you might want to incorporate that as well in how you set up your macros:&nbsp; <a href="https://wiki.roll20.net/Macro_Character_Sheet" rel="nofollow">https://wiki.roll20.net/Macro_Character_Sheet</a> You can then use sheets to categorize different macros, easily move batches of them from game to game by way of the character vault or transmogrifier, etc.