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

Run macro multiple times

Is there a way to repeat a macro several times? I see that simply add a multiplication dont work. For example, 3 * #Macro would run the Macro 3 times. The same with rolltemplates. For example, 3 * &{Rolltemplate} would run it 3 times. Is it possible?
1511345246
Ziechael
Forum Champion
Sheet Author
API Scripter
The quickest, non-API, way would be to click into the chat box after running it and press 'up' to get the macro text then enter to run it, rinse and repeat as often as needed. What is your full use case as there may be better ways beyond repetition?
1511350698

Edited 1511357549
Fábio_CM
Sheet Author
The full case is: I have a custom sheet with a roll template that return a string based on two variables: one d20 roll and a variable (called column) that is asked to the player or readed from a sheet attribute. It simulates a table roll using helper functions. So, as the column increase, the number for a better result in the d20 decrease. Depending the column selected by the player, two or more table rolls must be necessary, and the most favorable result is taken. However, as the results don't are solely dependant of the roll, is possible to have a better result with a lower d20 number. For example, a d20=10 will output a better result in column 20 than a d20=11 will output in column 1. It makes useless to keep the highest d20 number, and makes necessary to roll the entire macro again.
1511365385

Edited 1511365558
Are the results of the table roll numerical or based on text? If it's numerical, could you post the table?
Sorry. I was away for a time. The table is: The text over the colors are the output of the rolltemplate.
Fábio_CM said: For example, a d20=10 will output a better result in column 20 than a d20=11 will output in column 1. If I'm understanding correctly, players may have to compare the results of two or more table rolls that use different column numbers? And you would like this comparison to take place within the output of a single Roll Template macro?
Most of the time will be only one roll. The player will cross column (skill level) and row (dice roll) to read the result. However, at higher levels, a skill can get higher than 20, and so the column. In this case, it is necessary to roll 2 or more times and take the better result. For example, with a skill level of 26, it is necessary to roll 2 times, one in the 20th collumn and other in the 6th collumn, then take the better result based on the colored table. If possible, I would like to make a math to roll the macro "ceil (column / 20)" times.