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] groupCheck - Roll checks, saves, et cetera for many tokens at once

1479840575

Edited 1479843629
Jakob
Sheet Author
API Scripter
eastwood said: Ok, with the new update, I get this error: *snip* Can you try again with the newest version? I messed up by using an old version of a function in the --showaverage code.
Jakob said: Can you try again with the newest version? I messed up by using an old version of a function in the --showaverage code. Worked like a charm : ) Used:    !group-check --process --showaverage --whisper --Stealth
1479842872
Jakob
Sheet Author
API Scripter
Great! Don't forget you can turn on --process permanently via config. I'm going to do that, I much prefer rolls without that ugly yellow background :).
Jakob said: Don't forget you can turn on --process permanently via config.  Ah, good idea! Jakob said: I much prefer rolls without that ugly yellow background :). Me too!
1480500381

Edited 1480500428
Jakob
Sheet Author
API Scripter
1.1 New option: --button [buttonname] [buttoncommand]  (only available if you use --process). Specifics are in the documentation, but it works like this: below all the rolls, the script will display an API command button with name [buttonname] . The exact command will be the text [buttoncommand] , with the following changes: A tilde(~) inside will be replaced by double dashes (You cannot put actual double dashes, since GroupCheck would interpret these as the start of a new option.) You can insert the token ids of any token you rolled for by typing IDS([sep]) somewhere inside the command; this will be replaced by the tokenids of the tokens that GroupCheck rolled for, separated by [sep]. For example, use IDS(,) to get a comma-separated list of tokenids. Similarly, you can use RESULTS([sep]) to insert the results. This will only use the result of the first  inline roll for any token, until I can think of a better way to do it (should be enough for most purposes). As an example of the syntax, you could have a macro like this: !group-check {{ --Dexterity Save --button PressMe !command ~ids IDS(,) ~results RESULTS(,) ~someotheroption }}
I found out that for NPCs in 5e OGL this macro doesn't actually rolls their special Saving Throws and skills - those that are written in their sheet other than calculated as d20+(Stat-10)/2. For example for Assassin token it will roll stealth as d20+(16-10)/2=d20+3, but in its sheet it is written that its Stealt Skill is +6. This is calculated normally for Player Characters however. Is there any way to fix it or maybe it is something wrong with my version (1.1)?
1480758900
Jakob
Sheet Author
API Scripter
Alexey said: I found out that for NPCs in 5e OGL this macro doesn't actually rolls their special Saving Throws and skills - those that are written in their sheet other than calculated as d20+(Stat-10)/2. For example for Assassin token it will roll stealth as d20+(16-10)/2=d20+3, but in its sheet it is written that its Stealt Skill is +6. This is calculated normally for Player Characters however. Is there any way to fix it or maybe it is something wrong with my version (1.1)? Urgh, why do sheet creators make separate attributes for NPCs? I'll see what I can do.
Jakob said: Alexey said: I found out that for NPCs in 5e OGL this macro doesn't actually rolls their special Saving Throws and skills - those that are written in their sheet other than calculated as d20+(Stat-10)/2. For example for Assassin token it will roll stealth as d20+(16-10)/2=d20+3, but in its sheet it is written that its Stealt Skill is +6. This is calculated normally for Player Characters however. Is there any way to fix it or maybe it is something wrong with my version (1.1)? Urgh, why do sheet creators make separate attributes for NPCs? I'll see what I can do. Thanks a lot! Anyway the script is marvellous! I use it for party stealth checks and saves. Great job!
1480800520

Edited 1480804728
Jakob
Sheet Author
API Scripter
Alexey said: Jakob said: Alexey said: I found out that for NPCs in 5e OGL this macro doesn't actually rolls their special Saving Throws and skills - those that are written in their sheet other than calculated as d20+(Stat-10)/2. For example for Assassin token it will roll stealth as d20+(16-10)/2=d20+3, but in its sheet it is written that its Stealt Skill is +6. This is calculated normally for Player Characters however. Is there any way to fix it or maybe it is something wrong with my version (1.1)? Urgh, why do sheet creators make separate attributes for NPCs? I'll see what I can do. Thanks a lot! Anyway the script is marvellous! I use it for party stealth checks and saves. Great job! Thanks for the praise! I've tweaked the formulas and now they seem to work for NPCs with bonuses as well. I'll work it into the next version, for now, you can replace lines 156-188 in the script with the following and reimport 5e-OGL.  Doesn't work, don't use it. Working code in post below.
Sorry to be the bringer of more bad news, but I don't think this is working anymore with the new shaped sheet update. It's now at 7.3.7 and this script just outputs an empty box with the normal title. I'll post a screenshot and get you version numbers and a reproduction path when I get back to my conpiter
1480801691

Edited 1480804787
Jakob
Sheet Author
API Scripter
eastwood said: Sorry to be the bringer of more bad news, but I don't think this is working anymore with the new shaped sheet update. It's now at 7.3.7 and this script just outputs an empty box with the normal title. I'll post a screenshot and get you version numbers and a reproduction path when I get back to my conpiter Very strange, it's working for me with the Shaped sheet. But please give a reproduction path if something doesn't work for you. EDIT: Just realized that the above formulas for 5E-OGL give the wrong answer if the character is a PC and the modifier is negative. Guess I'll have to do some more work on the dice expression after all. EDIT2: Ok, the following code should be better. Unless you make a habit of converting your NPC sheets to PC sheets or something. '5E-OGL' : { 'Strength Save': { 'name' : 'Strength Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%strength_save_bonus% + %globalsavemod% + %npc_str_save%]]' }, 'Dexterity Save': { 'name' : 'Dexterity Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%dexterity_save_bonus% + %globalsavemod% + %npc_dex_save%]]' }, 'Constitution Save': { 'name' : 'Constitution Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%constitution_save_bonus% + %globalsavemod% + %npc_con_save%]]' }, 'Intelligence Save': { 'name' : 'Intelligence Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%intelligence_save_bonus% + %globalsavemod% + %npc_int_save%]]' }, 'Wisdom Save': { 'name' : 'Wisdom Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%wisdom_save_bonus% + %globalsavemod% + %npc_wis_save%]]' }, 'Charisma Save': { 'name' : 'Charisma Saving Throw', 'formula' : '[[d20 + (1-%npc%)*%charisma_save_bonus% + %globalsavemod% + %npc_cha_save%]]' }, 'Strength Check': { 'name' : 'Strength Check', 'formula' : '[[d20 + %strength_mod%]]' }, 'Dexterity Check': { 'name' : 'Dexterity Check', 'formula' : '[[d20 + %dexterity_mod%]]' }, 'Constitution Check': { 'name' : 'Constitution Check', 'formula' : '[[d20 + %constitution_mod%]]' }, 'Intelligence Check': { 'name' : 'Intelligence Check', 'formula' : '[[d20 + %intelligence_mod%]]' }, 'Wisdom Check': { 'name' : 'Wisdom Check', 'formula' : '[[d20 + %wisdom_mod%]]' }, 'Charisma Check': { 'name' : 'Charisma Check', 'formula' : '[[d20 + %charisma_mod%]]' }, 'Acrobatics': { 'name' : 'Dexterity (Acrobatics) Check', 'formula' : '[[d20 + (1-%npc%)*%acrobatics_bonus% + %npc_acrobatics%]]' }, 'Animal Handling': { 'name' : 'Wisdom (Animal Handling) Check', 'formula' : '[[d20 + (1-%npc%)*%animal_handling_bonus% + %npc_animal_handling%]]' }, 'Arcana': { 'name' : 'Intelligence (Arcana) Check', 'formula' : '[[d20 + (1-%npc%)*%arcana_bonus% + %npc_arcana%]]' }, 'Athletics': { 'name' : 'Strength (Athletics) Check', 'formula' : '[[d20 + (1-%npc%)*%athletics_bonus% + %npc_athletics%]]' }, 'Deception': { 'name' : 'Charisma (Deception) Check', 'formula' : '[[d20 + (1-%npc%)*%deception_bonus% + %npc_deception%]]' }, 'History': { 'name' : 'Intelligence (History) Check', 'formula' : '[[d20 + (1-%npc%)*%history_bonus% + %npc_history%]]' }, 'Insight': { 'name' : 'Wisdom (Insight) Check', 'formula' : '[[d20 + (1-%npc%)*%insight_bonus% + %npc_insight%]]' }, 'Intimidation': { 'name' : 'Charisma (Intimidation) Check', 'formula' : '[[d20 + (1-%npc%)*%intimidation_bonus% + %npc_intimidation%]]' }, 'Investigation': { 'name' : 'Intelligence (Investigation) Check', 'formula' : '[[d20 + (1-%npc%)*%investigation_bonus% + %npc_investigation%]]' }, 'Medicine': { 'name' : 'Wisdom (Medicine) Check', 'formula' : '[[d20 + (1-%npc%)*%medicine_bonus% + %npc_medicine%]]' }, 'Nature': { 'name' : 'Intelligence (Nature) Check', 'formula' : '[[d20 + (1-%npc%)*%nature_bonus% + %npc_nature%]]' }, 'Perception': { 'name' : 'Wisdom (Perception) Check', 'formula' : '[[d20 + (1-%npc%)*%perception_bonus% + %npc_perception%]]' }, 'Performance': { 'name' : 'Charisma (Performance) Check', 'formula' : '[[d20 + (1-%npc%)*%performance_bonus% + %npc_performance%]]' }, 'Persuasion': { 'name' : 'Charisma (Persuasion) Check', 'formula' : '[[d20 + (1-%npc%)*%athletics_bonus% + %npc_athletics%]]' }, 'Religion': { 'name' : 'Intelligence (Religion) Check', 'formula' : '[[d20 + (1-%npc%)*%religion_bonus% + %npc_religion%]]' }, 'Sleight of Hand': { 'name' : 'Dexterity (Sleight of Hand) Check', 'formula' : '[[d20 + (1-%npc%)*%sleight_of_hand_bonus% + %npc_sleight_of_hand%]]' }, 'Stealth': { 'name' : 'Dexterity (Stealth) Check', 'formula' : '[[d20 + (1-%npc%)*%stealth_bonus% + %npc_stealth%]]' }, 'Survival': { 'name' : 'Wisdom (Survival) Check', 'formula' : '[[d20 + (1-%npc%)*%survival_bonus% + %npc_survival%]]' }, 'AC' : { 'name' : 'Armor Class', 'formula' : '%AC%' } },
Huh. Yeah, it's working for me now too. Weird.  Though I am on a different computer now.   More testing is needed (from me that is) xD
Works great now, Thank you! 
1480860116

Edited 1480860727
Jakob
Sheet Author
API Scripter
1.2 Fixed 5E-OGL default checks to also use the correct bonuses for NPCs. Added --input option. It is now possible to use \[ and \] to create double square brackets for insertion into --custom and config --add. --input is a new option for inputting target numbers, DCs, and such into the rolls without having to type the whole formula out every time with --custom. Reimporting 5E-OGL will be necessary for the first fix to take effect.
So I did some more testing, even upgrading to 1.2 and I'm still encountering an issue with this script in one of my games. Here is the main command I'm testing with: /w gm  !group-check --process --showaverage --whisper So anyway, this is only a problem in one of my games, the others are running it just fine. I get this as an output: Character Sheet version: 5e shaped  7.7.4 Group check script  1.2
1481150457

Edited 1481150699
Jakob
Sheet Author
API Scripter
Well, have you imported anything in that game? What is the output of !group-check-config --show ? EDIT: Interesting to see someone actually uses the command menu. I never use that one, I always use a macro with a query...
1481150618

Edited 1481150664
Jakob said: What is the output of !group-check-config --show ? Was just about to post that haha. Jakob said: Well, have you imported anything in that game?  I'm not sure what you mean by this. Are you referring to NPC's ? If that's the case, then yes. But any commands from the group check script (to do rolls) just show the first picture I linked (in my last reply) even while doing checks solely for PC's
1481150832
Jakob
Sheet Author
API Scripter
That's not what I meant. You need to run !group-check-config --import 5E-Shaped first to populate the list of checks. You must have done that at some point in the other games as well :).
Jakob said: That's not what I meant. You need to run !group-check-config --import 5E-Shaped Wow...That fixed it. I feel like a moron lol. Thanks a lot Jakob.  Sorry for bothering you with my lack of re-reading installation notes   /facepalm
1481151120
Jakob
Sheet Author
API Scripter
eastwood said: Jakob said: That's not what I meant. You need to run !group-check-config --import 5E-Shaped Wow...That fixed it. I feel like a moron lol. Thanks a lot Jakob.  Sorry for bothering you with my lack of re-reading installation notes   /facepalm No problem. Happy rolling!
1481537411

Edited 1481537424
Jakob
Sheet Author
API Scripter
Argh, it was still doing the wrong thing for the 5E-OGL sheet. I should have fixed it now on Github, except in the rare situation that an NPC has a saving throw of +0 (different from their ability modifier). The formula is totally hacky, but I cannot figure out a better way due to the odd way the sheet has been set up - are you supposed to roll an ability check when an NPC has no saving throw proficiency? That's totally counter-intuitive!.
1481538457

Edited 1526029260
Jakob
Sheet Author
API Scripter
Okay, I have written a small script for applying area of effect damage, respecting the saving throws made by GroupCheck. Code is  here . Now, you would call this script by !apply-damage --type [TYPE] --ids [IDLIST] --saves [SAVELIST] --DC [DC] --dmg [DMG] --bar [1|2|3] Here, [TYPE] is half for half damage on save or none  for no damage on a save; [IDLIST] is a comma-separated list of token ids, [SAVELIST] is a comma-separated list of their saves, in the same order, [DC] is the save DC, [DMG] is the damage to apply (may be given as an inline roll), and the --bar option specifices the bar to apply the damage to. [TYPE] defaults to half, [DC] defaults to -1, and the default bar is 1. Now, this script isn't really suitable for being called manually, BUT, you can combine with Group-Check in the following fun way: !group-check {{ --Dexterity Save --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) }} Output:
Thank you Jakob will try it this week. 
Didn't work for me at first- then I realized this wasn't getting auto updated. :) Works great- thanks much
Modified the script just slightly to allow for other stat checks- then realized perhaps all aoe dmg is dex?   !group-check {{ --?{Ability Save|Strength,Strength Save|Dexterity,Dexterity Save|Constitution,Constitution Save|Intelligence,Intelligence Save|Wisdom,Wisdom Save|Charisma,Charisma Save} --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) }}
1481813498
Jakob
Sheet Author
API Scripter
No, there's Con and Wisdom saves for AoE damage too, I just didn't include them in my sample macro :).
There are con saves- like shatter. But I have yet to come up with a wis aoe that causes damage. The wisdom seem to be debuffs. 
1482611174

Edited 1482611447
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Jakob. I'm trying to implement the Passive Perception example you gave from the previous page: !group-check --die 0d0 --custom Passive Perception,repeating_skill_$11_passive But all I'm getting in the chat response is: Giant Spider 1     repeating_skill_$11_passive I'm using the Shaped sheet. What am I doing wrong?
1482669614

Edited 1482674686
Jakob
Sheet Author
API Scripter
Oh,  that tip was for an older version of the script. Try !group-check --custom Passive Perception, %repeating_skill_$11_passive% I can't test it right now, but it should work.  You can add it permanently by !group-check-config --add { "Passive Perception" : { "name" : "Passive Perception", "formula" : "%repeating_skill_$11_passive%" } }
Hi Jakob - having a small problem with the script and the 5e OGL settings. With completely stock options, I get this on pretty much every check: Error Something went wrong with the roll. The command you tried was: !group-check --whisper --Persuasion The error message generated by Roll20 is: Cannot mix sum and success rolls in a single roll expression Any ideas? Maybe roll20 switched something in the backend?
1485937476
Jakob
Sheet Author
API Scripter
Gary said: Hi Jakob - having a small problem with the script and the 5e OGL settings. With completely stock options, I get this on pretty much every check: Error Something went wrong with the roll. The command you tried was: !group-check --whisper --Persuasion The error message generated by Roll20 is: Cannot mix sum and success rolls in a single roll expression Any ideas? Maybe roll20 switched something in the backend? Indeed, it seems to be a backend change in how rolls are parsed by Roll20. My default setup for the 5E-OGL rolls relies on a somewhat dirty hack - see below for Persuasion, but it's the same for pretty much all the rolls - to make a single formula work for both PCs and NPCs (due to the terrible way NPC bonuses are set up in that sheet). Unfortunately, this doesn't seem to work anymore. I guess I'll have to ask Silvyre to come up with a new trick :D. [[d20 + @{CHARNAME|persuasion_bonus} * {1@{CHARNAME|npc_persuasion}0, 0}=10 + 0@{CHARNAME|npc_persuasion}]]
1485941732

Edited 1485943606
Jakob
Sheet Author
API Scripter
Thanks (again) to Silvyre, I have updated the formula for the defaults to something that still works. Pulling the newest Github code and re-importing 5E-OGL should fix it (submitted to one-click as well, but that takes time). EDIT: While doing this, I've become aware of the fact that I some changes had to be done to the Shaped import data due to changes in the sheet. All the ability checks and saving throws (but not skill checks) for the Shaped sheet have been wrong for a while now. Anyone affected will have to grab the newest version of the script and re-import 5E-Shaped.
Thanks Jakob! :)
1486110733
Jakob
Sheet Author
API Scripter
1.2.2 The script will now try to detect which version of the data you're running and update it automatically. Updated formulae for 5E-OGL to work again, and for 5E-Shaped to do the correct checks. The script's output will now use the full width of the chat area. All menu or error message output is changed to noarchive.
1486268172
PaprikaCC
Pro
API Scripter
I can't believe I didn't spot this earlier. I wish I had this when I ran mass combat a few months ago. Thanks!
Jakob have you used this script with shaped sheet 9? I think that should go live soon. 
1486922725
Jakob
Sheet Author
API Scripter
Gary W. said: Jakob have you used this script with shaped sheet 9? I think that should go live soon.  I'm using it with Shaped 9.0.1 right now, there were no changes necessary between 7.12.2/8.5.1/9.0.1 . The default import data had actually not worked for a while in 7.12.2 and some earlier versions, but that situation has been remedied as of GroupCheck 1.2.2.
Awesome-thanks. 
1488949998

Edited 1488950013
So I finally got time to check out the newest version of this and WOW! This is just great! No more applying damage to 1 mob at a time over and over again! Thanks Jakob! Side Question: Is there a setting to not have the bar go negative when over-kill happens?
1488954913
Jakob
Sheet Author
API Scripter
eastwood said: So I finally got time to check out the newest version of this and WOW! This is just great! No more applying damage to 1 mob at a time over and over again! Thanks Jakob! Side Question: Is there a setting to not have the bar go negative when over-kill happens? Great you're enjoying it. There's no such option at the moment, but you could probably just replace lines 70 and 75 with newValue = Math.max(parseInt(token.get(bar)) - dmg, 0); newValue = Math.max(parseInt(token.get(bar)) - Math.floor(dmg / 2), 0);
Really cool script Jakob! Sadly it seems it's not compatible with Aura/Tint HealthColor&nbsp;:&nbsp; <a href="https://app.roll20.net/forum/post/4630083/script-a" rel="nofollow">https://app.roll20.net/forum/post/4630083/script-a</a>... Aura's don't update, effects don't trigger. Don't want to lose that lovely script either, any chance they could become compatible?
What I have been doing is either moving the token a smidgeon or clicking on the hp and hitting enter- either forces the Aura to recalculate. &nbsp;
Gary thanks for the tip! Only the animation doesn't work now, but that's not a big deal. I could be missing something, but there's no way to set an icon/status on tokens that fail saves correct? For non-dmg AOE spells, to mark which ones are e.g. Blinded?
1489305362

Edited 1489317876
Jakob
Sheet Author
API Scripter
Actually, it seems there might be a way to call HealthColors to update from ApplyDamage. I will take a quick look and see if I can quickly add it to ApplyDamage. Regarding the icon, there's no possibility, but I see if I can conjure up something quick & dirty. EDIT: Ok, I added (untested) support for HealthColors, as well as a new --status option for ApplyDamage. You'd run it by adding e.g. "--status red" as an option to the ApplyDamage call. Will apply this status marker to any tokens that fail their saving throw. I also added a global variable at the beginning of the script that you can set to true to cap health from below at zero.&nbsp;
Thanks Jakob! Testing report: - Damage now updates instantly, which is great. - "healthStopsAtZero = true", works, yay. - Animations from HealthColors do not play yet. - Red cross from HealthColors does not appear on 0 HP tokens. - I am using "--status red" but red status is not appearing on failed saves. Manually setting "red" is still working. ps. List of my enabled &nbsp;scripts: G Critical G GroupInitiative HitDice G TokenNameNumber G Aura/Tint HealthColors TurnMarker G GroupCheck G Vector Math G MatrixMath G Path Math G KABOOM G Torch ApplyDamage TokenMod No Token Rotation G 5th Edition OGL by Roll20 Companion RollStats
1489321009
Jakob
Sheet Author
API Scripter
Arno said: Thanks Jakob! Testing report: - Damage now updates instantly, which is great. - "healthStopsAtZero = true", works, yay. - Animations from HealthColors do not play yet. - Red cross from HealthColors does not appear on 0 HP tokens. - I am using "--status red" but red status is not appearing on failed saves. Manually setting "red" is still working. ps. List of my enabled &nbsp;scripts: G Critical G GroupInitiative HitDice G TokenNameNumber G Aura/Tint HealthColors TurnMarker G GroupCheck G Vector Math G MatrixMath G Path Math G KABOOM G Torch ApplyDamage TokenMod No Token Rotation G 5th Edition OGL by Roll20 Companion RollStats Thanks for the detailed report! You are adding the --status red as "~status red" together with the other apply damage options, right? Just double-checking before I delve deeper into this. So healthcolors updates the color based on damage, but red cross and animations do not work? Odd. I'll check how this works, but it may be a healthcolors problem.
1489321126

Edited 1489321186
HealthColors won't play animations or adjust the icon status of a token based on changes from a script unless you send that information to the HealthColors script. The healthcolor script require both the current token object and the previous token object (before it was changed).
1489321215

Edited 1489321404
Jakob
Sheet Author
API Scripter
SkyCaptainXIII said: HealthColors won't play animations or adjust the icon status of a token based on changes from a script unless you send that information to the HealthColors script. I tried to do that, but apparently I failed :). I'll check again. edit: but calling HealthColors.Update (obj, prev) should be enough, right?&nbsp;
If they have the correct information.