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

Query to Output Macros

I am trying to build a simple query output dropdown. I want to set up a query macro that I can set to be a token action that will then refer my other macros. For example I have the macro Check-Strength @{selected|wtype}&{template:simple} {{rname=^{strength-u}}} {{mod=@{selected|strength_mod}@{selected|jack_bonus}}} {{r1=[[@{selected|d20}+@{selected|strength_mod}@{selected|jack_attr}[STR]]]}} @{selected|rtype}+@{selected|strength_mod}@{selected|jack_attr}[STR]]]}} @{selected|charname_output} I acquired this text by clicking a button on a sheet, then pressing up in the chatbox. This appears to be the full command as sent to roll. If I type #Check-Strength it dumps out a roll just like I'd clicked the button in Roll20. This is what I want. I then try to build a new macro: ?{Check|Strength,#Check-Strength |Dexterity,#Check-Dexterity } and all the way down the rest of my macros. The problem I am encountering is that as I tinker with the macro I get a ton of problems. First off, if I do this just as listed the text box for the query is jam packed with gibberish as it pulls in part of the macro. There is no output to the chatbox, but the roll is happening as when I test this using my initiative macro the initiative is updating to the tracker. So I figure the damage is being done in the roll template section, but I can't determine the problem. So I instead look into ways to ensure the macro isn't parsed and is instead passed out, and I find out about the HTML breaks. So I try to change # to !
 and next thing I know my entire workshop crashes and won't reload until I clear the chat log. I am completely lost. Can anyone tell me what I am doing wrong or if this is something I can't do?
1551000677
Ziechael
Forum Champion
Sheet Author
API Scripter
Your primary issue with this setup is, as you figured out, the need for HTML replacements. That path is fraught with issues and a LOT of work to maintain... take it from someone who dedicated most of a 4 year game to extensive query based menus! While it can be solved I would highly recommend checking out the  Chat Menus  'stupid trick'. It is a great way to consolidate your macros without the need for fiddly, potentially table breaking, character replacements. If you are determined to go the full on query route however let me know, I can help... I just don't want to expose you to the madness unless absolutely necessary ;)
Ziechael said: Your primary issue with this setup is, as you figured out, the need for HTML replacements. That path is fraught with issues and a LOT of work to maintain... take it from someone who dedicated most of a 4 year game to extensive query based menus! While it can be solved I would highly recommend checking out the  Chat Menus  'stupid trick'. It is a great way to consolidate your macros without the need for fiddly, potentially table breaking, character replacements. If you are determined to go the full on query route however let me know, I can help... I just don't want to expose you to the madness unless absolutely necessary ;) I actually developed the exact same menu concept when I discovered the action buttons I mentioned in the other thread. I'll read through that thread and adapt as much technology as I can. Thank you.