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

Macro help (I know there are a million, but I couldn't find one that matched

Good day to you all. I would like to preference this post with 2 factors I need to be considered. I do not have access to premium content, so I can't use  API's or  Character s heets for macro shortcuts. This appears to be a major problem as after searching the internet for around an hour every item that looked like it could be useful for what I am after was using char sheets to call figures. What I am looking for is basically a work around macro for ability checks/saves, but with the option for Adv Dis etc. So a macro that will prompt me with a from down menu with options which would trigger the correct type of roll, THEN to prompt me with a text box where I can enter a number which would be added to the chosen roll. Each part is easy enough, the below works for that the drop down. {{ ?{Result| Advantage, [[2d20kh1]]|  Standard, [[1d20]]|  Disadvantage, [[2d20kl1]]| } And + ? {Modifier|0}]]}} works for the text prompt when added to an open roll.  The problem is combining them. Because Roll20 seems to use | to separate options in the 1st drop down, if the 2nd section is still part of the 1st script it assumes "0" is a 4th option. But if I separate them to 2 scripts in the same macro, then they just show in separate boxes and do not get added together. Is there a way to write a macro which will roll standard, advantage or disadvantage and then add a prompted number to the result? With great thanks to anyone who can help.
That should work: [[?{Result|Advantage, [[2d20kh1]]| Standard, [[1d20]]|Disadvantage, [[2d20kl1]]} + ?{Modifier|0}]]
API Scripter
Hey, John... you're running into the need to perform HTML escapes on the nested queries. Basically, as the parser passes over the query syntax, any of the control characters it encounters (a vertical pipe, a comma, or a right-brace) trigger it to move forward in its progression through the query. For any of these characters that are going to be *in* a query but which you don't want to be *part* of the query, you'll need to use HTML replacements. The Wiki has some good information on it, but your macro could just look like this: ?{Result|Advantage, [[2d20kh1 + ?{Modifier|0}]]| Standard, [[1d20 + ?{Modifier}]]| Disadvantage, [[2d20kl1 + ?{Modifier}]]}

Edited 1663918703
You're both absolute legends. They both worked, though differently. I ended up going with Timmaugh because I found it easier to tweak giving my a name prompt for the save too. Thank you both so much. And Timmaugh, thanks for that link too, I didn't realise there were replacements like that, absolutely getting bookmarked haha.