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 .
×
Advertisement Create a free account

[Script] groupCheck - Roll checks, saves, et cetera for many tokens at once

1494193337

Edited 1494193698
Hey Jakob,  I've been trying to puzzle out how to use this API for about 20 hours or so, and while I'm sort of getting the hang of it, there are a lot of places where I'm completely lost. I need to say that I have no background in programming or coding experience so that's the biggest thing working against me. None the less I'm getting there.  OK with that preamble out of the way, I'm trying to create an initiative check that will send the results to the Turn Tracker. This is for the Star Wars SAGA sheet and as such I can't just import things from the SRD. I have to build things by hand but this is driving me up a well. Any help would be appreciated bud.  Here is what I've got so far any direction would be darn useful.  Peace --Mike !group-check-config --add { "Initiative" : { "name" : "Initiative", "formula" : "[[d20 + %Initiative% &{InitiativeTurn}]]"} } PS I have tried the standard &{tracker} as well. 
1494194941
Jakob
Sheet Author
API Scripter
J. Mike Blanche said: Hey Jakob,  I've been trying to puzzle out how to use this API for about 20 hours or so, and while I'm sort of getting the hang of it, there are a lot of places where I'm completely lost. I need to say that I have no background in programming or coding experience so that's the biggest thing working against me. None the less I'm getting there.  OK with that preamble out of the way, I'm trying to create an initiative check that will send the results to the Turn Tracker. This is for the Star Wars SAGA sheet and as such I can't just import things from the SRD. I have to build things by hand but this is driving me up a well. Any help would be appreciated bud.  Here is what I've got so far any direction would be darn useful.  Peace --Mike !group-check-config --add { "Initiative" : { "name" : "Initiative", "formula" : "[[d20 + %Initiative% &{InitiativeTurn}]]"} } PS I have tried the standard &{tracker} as well.  Hi Mike, I'm sorry you have been struggling with the script. Initiative is a very special case: you cannot send anything to the tracker with inline rolls via the API (essentially because you need to have tokens selected for that to work, and the API never has anything selected). So, while you could roll initiative via GroupCheck, it would not add anything to the tracker (and will probably just fail if you try to do it regardless). You can use GroupInitiative instead, it is meant for just that!
Well at least I can stop hitting my head against the desk and thank you very much for getting back to me so quickly. That is much appreciated.  I was playing with the GroupInit program initially but it seems to have a HUGE problem with non-dungeons and dragons sheets. But I thank you for your time and I'll see what I can accomplish with it.  Keep doing the good work my man.  Peace --Mike
1494228063
Jakob
Sheet Author
API Scripter
Kevin said: Just an FYI... the 12.x Shaped-Sheet has changed the formulas again.  The global bonuses have been removed and replaced by "modifiers".  "modifiers" don't seem applicable to NPC's (at least so far), but if anyone uses them for PC's the modifiers wouldn't take effect.    Hmm, I'll have to look into that (again).
1494441287

Edited 1494441322
Jakob
Sheet Author
API Scripter
1.4 Made some behind-the-scenes changes that make it easier to keep up with sheet changes from now on. Updated 5E-Shaped formula to use the sheet format for maximum compatibility; it will now work with 12.x+ (but should also still work with old versions).
1494509604
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks for the diligent updating, Jakob.
1494579712
Jakob
Sheet Author
API Scripter
keithcurtis said: Thanks for the diligent updating, Jakob. Doing what I can. FYI, there was a bug in the initial version of 1.4 such that characters set to roll2 would not work (GC would throw an error when attempting to roll for them). This should now be remedied (no version bump).
Thanks Jakob! In trying to setup some macros common macros, seems like it would be useful to be able to have the option applying no status markers while still having the "~status" as part of the command.  Here is my macro: !group-check {{ --?{Ability Save|Strength,Strength Save|Dexterity,Dexterity Save|Constitution,Constitution Save|Intelligence,Intelligence Save|Wisdom,Wisdom Save|Charisma,Charisma Save} --ro ?{Roll Type|Normal,roll1|Advantage,adv|Disadvantage,dis} --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage|0}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) ~status ?{Status| None,| Red,red| Blue,blue| Green,green| Orange,orange| Purple,purple| Pink,pink| Yellow,yellow| ―, | Concentrating,blue| Readying,stopwatch| ―, | Prone,back-pain| Restrained,fishing-net| Grappled,grab| ―, | Incapacitated,interdiction| Stunned,pummeled| Unconscious,sleepy| ―, | Charmed,chained-heart| Frightened,screaming| ―, | Poisoned,half-heart| Blinded,bleeding-eye| Deafened,lightning-helix| Paralyzed,padlock| Petrified,broken-skull| ―, | Dodging,bolt-shield| Cover (half),broken-shield:2| Cover (three-quarters),broken-shield:5| Cover (full),white-tower| Invisible,ninja-mask| ―, } }} This gives me an "all in one" macro that allows me to handle any save, however I don't necessarily need to apply a status marker in the event that there is no effect other than damage.  Because a "blank" status is invalid, it requires me to have two different macros (potentially 3), one that just applies damage, one that applies just status, and possibly one that applies damage and status.  Any possible workarounds?
1494700526
Jakob
Sheet Author
API Scripter
It's not hard to fix ApplyDamage to just ignore an empty status, but I suppose for now a solution would be to bake the ~status into the query options.
There is strange behavior when trying to embed the ~status into the query, because when you are trying to eliminate an option as part of the query the "None,|" portion of the query causes the command to fail because the apply damage command that gets built is: !apply-damage --dmg [[100]] --type half --DC 25 --saves 23,25,12 --ids -Kk19-kYepKp6f3Tfxjp,-Kj08tGEo5P1oWx67CB-,-Kk19TbSqArAvYRGUFju None Notice the "  None" gets added at the end of the command, which causes !apply-damage to incorrectly identify the last id.  I tried several variations to eliminate the "  None" but couldn't find something that would work. I have had similar problems in the past when using roll query dropdowns to decide whether or not to include an option and could never get it to work around.  I hacked something into the script short term that seems to be working, but it's probably not the "right" way to do it.
After posting, I thought to use "None,~|", this worked properly because it added the -- to the end of the command which ended up getting ignored.  So this final macro worked well without the script hack: !group-check {{ --?{Ability Save|Strength,Strength Save|Dexterity,Dexterity Save|Constitution,Constitution Save|Intelligence,Intelligence Save|Wisdom,Wisdom Save|Charisma,Charisma Save} --ro ?{Roll Type|Normal,roll1|Advantage,adv|Disadvantage,dis} --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage|0}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) ?{Status| None,~| Red,~status red| Blue,~status blue| Green,~status green| Orange,~status orange| Purple,~status purple| Pink,~status pink| Yellow,~status yellow| ―, | Concentrating,~status blue| Readying,~status stopwatch| ―, | Prone,~status back-pain| Restrained,~status fishing-net| Grappled,~status grab| ―, | Incapacitated,~status interdiction| Stunned,~status pummeled| Unconscious,~status sleepy| ―, | Charmed,~status chained-heart| Frightened,~status screaming| ―, | Poisoned,~status half-heart| Blinded,~status bleeding-eye| Deafened,~status lightning-helix| Paralyzed,~status padlock| Petrified,~status broken-skull| ―, | Dodging,~status bolt-shield| Cover (half),~status broken-shield:2| Cover (three-quarters),~status broken-shield:5| Cover (full),~status white-tower| Invisible,~status ninja-mask| ―, } }}
1495273399
Jakob
Sheet Author
API Scripter
I made a small update to ApplyDamage that allows "--status none" as an option (which will do the expected thing, nothing). This should make it possible to simplify the macros and you don't need to rely on hacky solutions.
Thanks Jakob, it's very helpful!
1497356350
PadRpg
Sheet Author
API Scripter
Hi, Your script is awesome, I use it on my Pathfinder games. But I try to use it on a different game but I have an issue. Here the roll I have in my sheet : [[1d100cs<[[(ceil(@{str}/5))]]cf>99]] How can I launch the same thing with your script? Or can your script launch directly the value of a roll button contains in a sheet? Thanks.
1497358476
Jakob
Sheet Author
API Scripter
You can add it like this !group-check-config --add { "YOURNAMEHERE": { "name": "YOURTITLEHERE", "formula": "\[1d100cs<\[(ceil(%str%/5))\]cf>99\]"} } To be clear, YOURNAMEHERE is the command you use to launch the roll, whereas YOURTITLEHERE is what is displayed in the title bar. Or can your script launch directly the value of a roll button contains in a sheet? That's not possible. I have a similar script around, GroupAbility, which can output the buttons directly from the sheet, but you will get them all separately, not neatly contained in a single box like with GroupCheck.
1497401846

Edited 1497401874
I personally don't use Character Sheets in the games I GM to make monsters, so it would be nice if the "--custom Name, formula" command would work even if the token is not associated with a character sheet. For example, selecting a bunch of tokens and then using "!group-check --custom Check, [[1d20]]" to have all of them roll 1d20 with their token names and pictures appear even if they are not linked to a character sheet. When I try to roll this at the moment, it just gives me a blank box.
1497417832

Edited 1497424351
Jakob
Sheet Author
API Scripter
Sayok said: I personally don't use Character Sheets in the games I GM to make monsters, so it would be nice if the "--custom Name, formula" command would work even if the token is not associated with a character sheet. For example, selecting a bunch of tokens and then using "!group-check --custom Check, [[1d20]]" to have all of them roll 1d20 with their token names and pictures appear even if they are not linked to a character sheet. When I try to roll this at the moment, it just gives me a blank box. That's actually already possible, try adding "--fallback 1" as an option. EDIT: More in-depth, the fallback option takes a comma-separated list of values, which it will plug into any attributes in the roll, in order (extending with zeroes if necessary). If there are no attributes in the formula (like with [[1d20]]), it doesn't have to plug in anything, of course, but you still need fallback for the script to not discard unlinked tokens.
1498462782
Jakob
Sheet Author
API Scripter
So if you've been using Shaped v14.x and GroupCheck produced a syntax error, you can try again with GroupCheck 1.4.1, which should fix the problem.