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

Is it possible to stop a dice macro if a condition is met?

1600367906

Edited 1600368302
Hi ya! I'm trying to make the life of my GM a bit easier with a macro. The situation is this: 1) Counting the number of successes (the number of rolls equal to or under x). Done. 2) Inputting the number of rolls when launching the macro. Done. 3) Halting the macro if the roll is equal to or under y, but including the roll as a success. Working on this. 4) Outputting the number of successes and whether there was a roll equal to or under y. Next. (y is always less than x) That's the situation at the moment. Is there a way to halt the rolls when a roll is equal to under a certain number?
1600369508

Edited 1600369531
GiGs
Pro
Sheet Author
API Scripter
roll20 dice macros cannot do conditional checks. You cant halt a macro, but you might be able to build an expression that gives your desired results and doesn't need halting. Your description doesnt include enough detail for me to judge if what you want is possible.
1600374958

Edited 1600375000
That's a shame. The goal is to automate multiple hits with a force field from 40KRPGs. They block on an attack if you roll under the protection value and overload if you roll under their overload value, with the overload still protecting the character for that hit. The idea was in case of multiple hits at the same time to have the macro automatically calculate multiple hits, but since the force field stops working after an overload there would have to be some form of a stop. Any ideas on how that might be macroed?
1600377620
GiGs
Pro
Sheet Author
API Scripter
I think the only way to handle that without the API (a pro subscriber perk) is to do it manually. If you use the /roll method, rolls will be shown in order, so you can see when the overload happens. If you use inline rolls, you see only the total and cant see the individual dice unless you mouse over the total. But you could print an API Commabd Button (doesnt need the API) in chat to make an attack roll, and then just click the button as many times as you need to, stopping after you get an overload (if that's how it works).
Thanks for the information. The "Just smash the button" was the plan if I couldn't macro it.
Oh, one more question. Within a macro, is it possible to output a message for successful roll, but if the roll is over or under a certain roll it outputs that the roll was a critical success?
1600421375
GiGs
Pro
Sheet Author
API Scripter
Unfortunately no - that's a conditional effect: "if roll is above this, output this, otherwise output this". There is a way to highlight rolls as criticals or fumbles. For example: /roll 1d20cs&gt;19 will highlight the d20 green if it rolls 19 or higher.&nbsp; Critical and fumble checking works on a per dice basis; you cant to /roll 3d6cs&gt;17 for example. That would check each die to see if it is 17 or higher, not the total of the three dice. You can see what you can do with rolls here:&nbsp;<a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a>