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

[Script,Update] GroupInitiative -- With filter and roll with.

1788127189

Edited 1788127258
The Aaron
Roll20 Production Team
API Scripter
Update v0.9.42 -- Added --filter-with for --add-group and --with for rolls. (Thanks KeithCurtis!) Sometimes you want to switch between a set of stat groups based on transient information.&nbsp; Lets say you want to make a roll for initiative for a group of tokens with advantage because of a situation, not a character sheet feature.&nbsp; In this case, you might want to flag a stat group with an identifier and then specify it with the roll. !group-init --add-group --label Advantage Beacon --filter-sheet dnd2024byroll20 --filter-with advantage --roll-die-count 2 --roll-die-mod kh1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --label Disadvantage Beacon --filter-sheet dnd2024byroll20 --filter-with disadvantage --roll-die-count 2 --roll-die-mod kl1 --computed initiative_bonus --computed init_tiebreaker !group-init --add-group --label Beacon --filter-sheet dnd2024byroll20 --computed initiative_bonus --computed init_tiebreaker This sets up new rules for advantage, disadvantage and a regular roll.&nbsp; (Note the --filter-with part).&nbsp; The created rules then will only be matched if the matching --with line is supplied. !group-init --with advantage This will force selection of rules that have the --filter-with advantage.&nbsp; They will only be considered if they are before other rules without --filter-with lines.&nbsp; For example, if you had: !group-init --with tacos The 3rd rule would be matched.&nbsp; Additionally, if the rules were in reverse order, the regular rule would be matched first.&nbsp; Not having a --filter-with clause is not a reason for rejection in the case of a --with being supplied, so keep that in mind when ordering your rules. Code is available here now:&nbsp; <a href="https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/GroupInitiative/GroupInitiative.js</a> or you can get it from the 1-click on Tuesday or so.
1788148791
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have a couple of players who thank you for this addition.