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

[Script] GroupAbility - call abilities en masse

1476713094

Edited 1526029383
Jakob
Sheet Author
API Scripter
Here's a small script I developed, it probably already exists in one form or another by The Aaron, but I couldn't find it, so I hacked it together for myself. Use case: you have a bunch of tokens linked to characters and you want to call a single ability from all of them. Entering %{selected|abilityname} launches the ability only for a single selected character, that's not optimal. Usage Select all the tokens (representing characters) that you want to use the ability for, and enter !ga --abilityname in chat. If you want to to run a bunch of abilities at once, you can do this, just use !ga --abilityname1 --abilityname2 ... Also, there are a bunch of options: --prefix blabla  adds the text blabla  in front of each ability call (e.g. --prefix /w GM). --suffix   blabla  adds the text blabla  after each ability call. Also, the string %%NAME%% in the suffix is replaced by the token's name. You can use this, together with the behaviour of roll20's roll templates to only show the last of any entered roll template value, to, for example, replace the character name displayed by the token name (e.g.: --suffix {{name=%%NAME%%}}) --multi n  will run each ability n  times. Example . Suppose you have tokens selected that represent the characters Sarah , R2-D2  and Bill . Then !ga --strength_check will almost* be equivalent to entering the following lines in chat: %{Sarah|strength_check} %{R2-D2|strength_check} %{Bill|strength_check} The code is available on  Github . * The limitation here is that they are sent as commands from the API instead of being sent by yourself. This means that @{selected|...} will not produce any useful results - although this one should not be necessary -, and neither &tracker for initiative nor @{target|...} will work.
1476713918
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
very nice.
Awesome!
1476717480
Tetsuo
Forum Champion
This seems useful for initiative as well
1476720636
Jakob
Sheet Author
API Scripter
Franky H. said: This seems useful for initiative as well That's the one thing it will not work for, since &tracker does not work from the API.