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
This post has been closed. You can still view previous posts, but you can't post any new replies.

IF and Then statements for Macros

If and Then Statements would be extremely useful for Macros. It would allow that if something happens for example a roll is over a certain amount for something else to happen. For example I could use an simple attack roll. Normally for my npcs I might use this macro: /gmroll 1d20 /gmroll 1d6 This is fine but what if my attack roll wasn't high enough to actually hit, the 1d6 wasn't a necessary roll and just clogs up my chat space. But with the combination of IF/THEN statements and variables this could easily be avoided. See this as a possible example IF '/gmroll 1d20>AC|15}' THEN '/gmroll 1d6' So in this example the user would use the macro and would receive a prompt to enter the AC then if the d20 roll was higher then the target it would roll 1d6.
IF/ELSE logic most likely will not be added to the base macro's. You'll need to become a mentor to access that kind of scripting.
1391439408

Edited 1391439421
Gauss
Forum Champion
You can use a combination of /w GM and inline rolls to clean up your chat. Example: /w GM Attack: [[1d20]] Damage [[1d6]]
Gauss said: You can use a combination of /w GM and inline rolls to clean up your chat. Example: /w GM Attack: [[1d20]] Damage [[1d6]] Thanks I'll give that a try.
1391545098
Paul S.
Sheet Author
API Scripter
As a mentor and GM of a couple campaigns - I would love to see this. The macros are pretty powerful as is and I use and abuse them, but this would just be icing on the cake.