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

Query to pass variable number of targets

Hey. So, I'm tying to pass some targets via macro to the API, but I don't know ahead of time how many targets there will be. I tried something like: !BSFX MagicMissile ?{Targets|1, @{target|token_id}|2, @{target|token_id} @{target|token_id}} But that didn't work. I also tried entering the code for the closing brackets on those target calls, which didn't work. Any idea how this might be doable?
1511475867
The Aaron
Pro
API Scripter
In my scripts, I handle this by taking a bunch of ids after the argument --ids, I then reduce those to just unique ids: !BSFX MagicMissile --ids ?{Target|1|token_id} ?{Target|2|token_id} ?{Target|3|token_id} ?{Target|4|token_id} Then, you can just target the same token multiple times to easily supply only a few ids.  TokenMod and Torch both employ this technique.