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

Help with a macro

Hi!, I've recently started using macros and haven't got a great understanding of them just yet, and I've been struggling to find or make a macro to help speed up a mass combat encounter that I'm currently building.  I'm looking for a macro that will do the following - Opens an input box to input the value of X (typed in manually) displaying the message "Number of Attackers" > opens a second box to input the value of Z (typed in manually, or chosen from dropdown menu of dice values) displaying the message "damage die" > the macro then rolls 1dX to get the resulting value of Y, and then rolls YdZ. (X being the initially chosen die value, Y being the result of the first 1dX roll, and Z being the type of dice, like d4 or d6, or chosen from a dropdown menu). Example - I click the macro and a box opens, I input 17 > a second box opens for the type of dice (typed input or from dropdown menu), and I type or choose d6 > the macro then rolls 1d17, and the result is 7, so it rolls 7d6 and displays the results in chat. Hopefully that makes some amount of sense for what I'm trying to do, was a little long winded but I'm not too sure how to best describe it clearly. At the moment, I'm using two separate macros to do this, one to gain the results for Y, then using the second macro to input Y for the second roll, using one type of dice. So I'm essentially trying to combine them together and skip the need to manually input Y (Number of Targets Hit), mainly to make less rolls and inputs during the game and save some time. I'm not too sure if it's even possible, but any help with it would be amazing. First macro - /roll 1d?{Number of Attackers?|} Second macro (copied for each type of dice) - &{template:default} {{name=Dice}} {{d6 = [[?{Number of Targets Hit}d6]]}}
1623539665
Kraynic
Pro
Sheet Author
You just need to put your first macro (minus the /roll) in a set of double square brackets and then use that to replace the query in your second macro. &{template:default} {{name=Dice}} {{d6 = [[[[1d?{Number of Attackers?|}]]d6]]}}
Macro works perfectly, thank you Kraynic!, and thanks for the explanation too, still learning my way around macros and that has just cleared up a long headache and saved me a lot of time.