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

Need some help with a macro

1462145952
Pat S.
Forum Champion
Sheet Author
/w gm &{template:default} {{name=Open Locks: [[@{openlocks} or less}} {{[[1d100]]}} is the macro. Now what I want to do is add @{DEXbonus)*5 to the @{openlocks}. For the life of me I can not remember the additional bit used to group @{DEXbonus}*5 together so I can add it to @{openlocks}
1462147585

Edited 1462147926
Silvyre
Forum Champion
Would [[ @{openlocks} + @{DEXbonus} * 5 ]] work? If @{DEXbonus} is a sum, e.g. floor(@{dex}/2) - 5, you'd want to surround @{DEXbonus} in parentheses, i.e. (@{DEXbonus}) * 5
1462147680

Edited 1462147717
Pat S.
Forum Champion
Sheet Author
I thought so to but I need only the dexbonus affected by the *5 and not the whole string. I've forgotten how to group stuff together and couldn't find it in the wiki.
1462147989

Edited 1462148235
Silvyre
Forum Champion
Within [[ @{openlocks} + @{DEXbonus} * 5 ]] (i.e. [[ @{openlocks} + 5 * @{DEXbonus} ]]), 5 will only multiply @{DEXbonus}. <a href="https://en.wikipedia.org/wiki/Order_of_operations" rel="nofollow">https://en.wikipedia.org/wiki/Order_of_operations</a>
1462148267
Pat S.
Forum Champion
Sheet Author
Thanks