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

Getting a headache trying to Nest macros.

Hi, I'm trying to create a Macro that refers to another Macro which itself refers to a Rollable Table and I'm not having much luck. So first Macro is: ?{Which? |LRM5,#LRM5 |LRM10,#LRM10 |LRM15,#LRM15 |LRM20,#LRM20 |SRM2,#SRM2 |SRM4,#SRM4 |SRM6,#SRM6} Which then should lead to (Depending on which is chosen) : /r ?{Number of Racks fired}t[LRM5] Which leads to a Rollable table with the info on it. The second Macro works fine as does the Rollable Table. It's just that first Macro that doesn't want to play the game.  For the life of me I can't seem to see what I've done wrong. I believe it meets the required format for nesting Macros???? Any help would be appreciated.  Thanks in advance.
1637639631
GiGs
Pro
Sheet Author
API Scripter
You have an } character in the nested macro. The first macro sees that, thinks its the } macro that ends its macro, and ends early. If you really want to nest macros (I don't recommend it), you need to look into html entity substitutions. If you add html entities to your nested macros, they will stop working on their own - they will only work when called from another macro. So it's best to build one mega-macro that includes all the nested macros - there's no point calling other macros when they no longer work as macros. A better approach in my view is to use chat menus, where you can still use the nested macros - they don't need to be edtited att all, but you whisper yourself (or print openly in chat) a series of buttons, which you can then click insitead of picking from a list. You can also use them multiple times. I'll let someone else provide the links :)
1637643981
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Chat Menu :)
1637660262
Ziechael
Forum Champion
Sheet Author
API Scripter
Or drop the additional macro call: /r ?{Number of Racks fired|1}t[?{Which|LRM5|LRM10|LRM15|LRM20|SRM2|SRM4|SRM6}] I've added a default of 1 to the number of racks being fired to prevent a null error.
Ziechael said: Or drop the additional macro call: /r ?{Number of Racks fired|1}t[?{Which|LRM5|LRM10|LRM15|LRM20|SRM2|SRM4|SRM6}] I've added a default of 1 to the number of racks being fired to prevent a null error. Thanks so much that is exactly what I was after and works a treat. Your brain is a marvel .....Thanks.