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 .
×

Adding a number to the end of a macro equal to the number of dice?

1562205555

Edited 1562205572
Simplistically put: I would like to make a macro (which for shorthand I've named "ed" for "Exalted Dice") where all I have to do is type x#ed and my formula work properly. So our dice are a success so long as they're 7 or higher. 10s are a double success (it works based off d10s) The formula I found that worked (and displays the results correctly) is this: /roll Xd10>10f<6+X Where X = the amount of dice you're rolling. I can get my macro to work up until the addition on the end. Does anyone know how to code the macro to understand the dice number needs to be the same for the addition on the end?
1562208600
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If I can suggest a slightly different method: /roll ?{number}d10>10f<6+?{number} This will put the number in twice. You only need enter it once. Instead of type "X#ed [return]", you type "#ed [return] X [return]". One more keystroke, but it's about the only way to reference the same number twice in one macro. You can do it by refencing an attribute, but I don't think you'd want to be bothered with changing an attribute manually every time you run the macro.
keithcurtis said: If I can suggest a slightly different method: /roll ?{number}d10>10f<6+?{number} This worked great! I don't mind having to type the number. It's still better than typing the whole dice roll each time, hahaha. Thanks so much for the help! :D
1562227155
Ziechael
Forum Champion
Sheet Author
API Scripter
For the sake of speed and preventing accidentally sending the macro to run with no query input I'd recommend putting a default value in, or even a range of possibles if it is finite: /roll ?{number|1}d10>10f<6+?{number} or /roll ?{number|1|2|3|4|5|6|7|8|9|10}d10>10f<6+?{number}
Ziechael said: For the sake of speed and preventing accidentally sending the macro to run with no query input I'd recommend putting a default value in, or even a range of possibles if it is finite: Oh, fancy thank you o: