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

A couple questions about Queries

Heyo all. I was playing around with a macro that posts a query to try to streamline some rolls for my players, and I hit two snags that my initial research hasn't found answers on, and these are: Whenever I nest a query inside another, I am using escaped curly brackets, comma or pipe. ( &#125 ;, , and | ) But, it seems that at some point, maybe when I close the tab of the game and open it again, it substitutes the escaped forms for the common forms ( } , , and | ) So, when I come back to my game, the query no longer works, because it no longer treats }, , and | as escaped inputs. Am I doing something wrong? How many queries can I nest together? By what I tested, it seems I can only make 2 subsequent queries. I can only go question 1 > question 2, and not question 1 > question 2 > question 3. Again, am I doing something wrong? Thank you guys for the help, I've posted quite a few times in the past few days and I appreciate the support.
1618121711
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Roll20 parser will resolve all html replacements whenever you close your macro. It's best to keep a pristine copy somewhere outside the game. Alternatively a better practice (IMHO) is to use a  Macro Character Sheet , and code everything as Actions instead of Macros. Actions generally avoid the substitution problem, and will retain the code as you wrote it. Nesting queries can get eye-watering very quickly. My suggestion would be to use a  Chat Menu  for anything complex. They are much easier to code, and maintain, and even easier when you are using a Macro Character Sheet.
1618129154
Andreas J.
Forum Champion
Sheet Author
Translator
keithcurtis said: Nesting queries can get eye-watering very quickly. My suggestion would be to use a&nbsp; Chat Menu &nbsp;for anything complex. They are much easier to code, and maintain, and even easier when you are using a&nbsp;Macro Character Sheet. The <a href="https://wiki.roll20.net/Chat_Menus" rel="nofollow">https://wiki.roll20.net/Chat_Menus</a> page has more details &amp; examples than your original forum post, and is a more practical guide to link when bringing it up. (you could edit the tip to link to the wiki page)
1618143591
Ziechael
Forum Champion
Sheet Author
API Scripter
If you absolutely need to pursue a nested query option you need to&nbsp; escape the ampersand for each level you go down: } becomes &amp;#125; which becomes &amp;amp;#125; which becomes &amp;amp;amp;#125; which becomes &amp;amp;amp;amp;#125; etc etc
Hello, everyone! I'm testing around with the Char Menus, and I had seen that only briefly before, I hadn't thought of using it. With the guide linked here, I could make it work very easily, and I think it looks very neat! Also, I wasn't aware about the ampersand trick, I'll keep that in mind if I ever need it again! I'll also save all my macros somewhere else in case they get changed. Thank you guys!