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

Macro with Query for Skill Checks adv/dis

Good morning, I'm looking to build a macro up with a query asking which Skill to be checked in a drop down list, and if the dice rolls should be made with Always Adv/Dis. So far I found something like this, by MarkOfTheDragon  user, but I cannot manage to make it work.  &{template:simple} ?{Select a Skill | Acrobatics, {{rname=Acrobatics}} {{mod=@{acrobatics_bonus} }} {{r1=[[1d20 + @{acrobatics_bonus} ]]}} {{r2=[[1d20 + @{acrobatics_bonus} ]] }} {{?{Type of Roll|Normal,normal=1|Always Roll Both,always=1|Advantage,advantage=1|Disadvantage,disadvantage=1} }} | Animal Handling, {{rname=Animal Handling}} {{mod=@{animal_handling_bonus} }} {{r1=[[1d20 + @{animal_handling_bonus} ]]}} {{r2=[[1d20 + @{animal_handling_bonus} ]]}} {{?{Type of Roll|Normal,normal=1|Always Roll Both,always=1|Advantage,advantage=1|Disadvantage,disadvantage=1} }} | etc,etc } First question: how should I take Skill Proficiency into account? Second question: how does HTML fit into this? Any help would be greatly appreciated.
1605364886
Andreas J.
Forum Champion
Sheet Author
Translator
frons79 said: Good morning, I'm looking to build a macro up with a query asking which Skill to be checked in a drop down list, and if the dice rolls should be made with Always Adv/Dis. So far I found something like this, by MarkOfTheDragon  user, but I cannot manage to make it work. What character sheet/system are you wanting to create this for, and is that macro made for that character sheet? For Roll Templates to work, you need to have the associated character sheet to be able to work. First question: how should I take Skill Proficiency into account? Hard to tell without more info on what sheet/game you're talking about. Second question: how does HTML fit into this? It's irrelevant, most likely. Character sheets and their Roll templates are created using HTML/CSS, but that is seldomly relevant unless you're starting to modify the character sheet(which you can't currently, as it's a Pro subscriber feature).
1605372158

Edited 1605373724
David M.
Pro
API Scripter
If you are using the 5E by Roll20 sheet, check out the two macros in this thread  (credit: derived from a script written by Oosh). Works best if entered as an Ability, rather than a collections macro, as the html replacements will not revert back to problem characters when you re-open the macro. I add these as abilities, and enable them as token actions. The first is for all saves, and the second is for all skills (& basic ability checks - at the bottom of the drop-down list). Allows for adv/disadv, as well as global modifiers such as Bless and Guidance spells.  EDIT - I should clarify that these use the roll type determined by the character's sheet setting tab. Set roll type to "Query" to get what you are looking for.  
1605374008

Edited 1605374097
ᐰndreas J. said: frons79 said: Good morning, I'm looking to build a macro up with a query asking which Skill to be checked in a drop down list, and if the dice rolls should be made with Always Adv/Dis. So far I found something like this, by MarkOfTheDragon  user, but I cannot manage to make it work. What character sheet/system are you wanting to create this for, and is that macro made for that character sheet? For Roll Templates to work, you need to have the associated character sheet to be able to work. It's D&D 5e Default Template ... David M.  said: If you are using the 5E by Roll20 sheet, check out the two macros in  this thread  (credit: derived from a script written by Oosh).  Cannot reach the link, it forwards me to my game list.
That thread is in the Pro forum, which is only available to Pro members. Here is David's post of Oosh's macros: Try this one (credit to Oosh): @{selected|wtype}&{template:simple} @{selected|rtype}?{Saving Throw|Strength, +@{selected|Strength_save_bonus}@{selected|pbd_safe}[STR SAVE]]]}} {{rname=Strength Save}&#125 {{mod=@{selected|Strength_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Strength_save_bonus}@{selected|pbd_safe}[STR SAVE]]]|Dexterity, +@{selected|Dexterity_save_bonus}@{selected|pbd_safe}[DEX SAVE]]]}} {{rname=Dexterity Save}&#125 {{mod=@{selected|Dexterity_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Dexterity_save_bonus}@{selected|pbd_safe}[DEX SAVE]]]|Constitution, +@{selected|Constitution_save_bonus}@{selected|pbd_safe}[CON SAVE]]]}} {{rname=Constitution Save}&#125 {{mod=@{selected|Constitution_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Constitution_save_bonus}@{selected|pbd_safe}[CON SAVE]]]|Intelligence, +@{selected|Intelligence_save_bonus}@{selected|pbd_safe}[INT SAVE]]]}} {{rname=Intelligence Save}&#125 {{mod=@{selected|Intelligence_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Intelligence_save_bonus}@{selected|pbd_safe}[INT SAVE]]]|Wisdom, +@{selected|Wisdom_save_bonus}@{selected|pbd_safe}[WIS SAVE]]]}} {{rname=Wisdom Save}&#125 {{mod=@{selected|Wisdom_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Wisdom_save_bonus}@{selected|pbd_safe}[WIS SAVE]]]|Charisma, +@{selected|Charisma_save_bonus}@{selected|pbd_safe}[CHA SAVE]]]}} {{rname=Charisma Save}&#125 {{mod=@{selected|Charisma_save_bonus}}} {{r1=[[@{selected|d20}+@{selected|Charisma_save_bonus}@{selected|pbd_safe}[CHA SAVE]]]}}} {{global=@{selected|global_save_mod}}} @{selected|charname_output} While you're at it, here a similar Skills and base ability checks query macro @{selected|wtype}&{template:simple} @{selected|rtype}?{Ability|Acrobatics, +@{selected|Acrobatics_bonus}@{selected|pbd_safe}[Acrobatics]]]}} {{rname=Acrobatics}} {{mod=@{selected|Acrobatics_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Acrobatics_bonus}@{selected|pbd_safe}[Acrobatics]]]|Animal Handling, +@{selected|Animal_Handling_bonus}@{selected|pbd_safe}[Animal]]]}} {{rname=Animal Handling}} {{mod=@{selected|Animal_Handling_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Animal_Handling_bonus}@{selected|pbd_safe}[Animal]]]|Arcana, +@{selected|Arcana_bonus}@{selected|pbd_safe}[Arcana]]]}} {{rname=Arcana}} {{mod=@{selected|Arcana_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Arcana_bonus}@{selected|pbd_safe}[Arcana]]]|Athletics, +@{selected|Athletics_bonus}@{selected|pbd_safe}[Athletics]]]}} {{rname=Athletics}} {{mod=@{selected|Athletics_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Athletics_bonus}@{selected|pbd_safe}[Athletics]]]|Deception, +@{selected|Deception_bonus}@{selected|pbd_safe}[Deception]]]}} {{rname=Deception}} {{mod=@{selected|Deception_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Deception_bonus}@{selected|pbd_safe}[Deception]]]|History, +@{selected|History_bonus}@{selected|pbd_safe}[History]]]}} {{rname=History}} {{mod=@{selected|History_bonus}}} {{r1=[[ @{selected|d20} + @{selected|History_bonus}@{selected|pbd_safe}[History]]]|Insight, +@{selected|Insight_bonus}@{selected|pbd_safe}[Insight]]]}} {{rname=Insight}} {{mod=@{selected|Insight_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Insight_bonus}@{selected|pbd_safe}[Insight]]]|Intimidation, +@{selected|Intimidation_bonus}@{selected|pbd_safe}[Intimidation]]]}} {{rname=Intimidation}} {{mod=@{selected|Intimidation_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Intimidation_bonus}@{selected|pbd_safe}[Intimidation]]]|Investigation, +@{selected|Investigation_bonus}@{selected|pbd_safe}[Investigation]]]}} {{rname=Investigation}} {{mod=@{selected|Investigation_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Investigation_bonus}@{selected|pbd_safe}[Investigation]]]|Medicine, +@{selected|Medicine_bonus}@{selected|pbd_safe}[Medicine]]]}} {{rname=Medicine}} {{mod=@{selected|Medicine_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Medicine_bonus}@{selected|pbd_safe}[Medicine]]]|Nature, +@{selected|Nature_bonus}@{selected|pbd_safe}[Nature]]]}} {{rname=Nature}} {{mod=@{selected|Nature_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Nature_bonus}@{selected|pbd_safe}[Nature]]]|Perception, +@{selected|Perception_bonus}@{selected|pbd_safe}[Perception]]]}} {{rname=Perception}} {{mod=@{selected|Perception_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Perception_bonus}@{selected|pbd_safe}[Perception]]]|Performance, +@{selected|Performance_bonus}@{selected|pbd_safe}[Performance]]]}} {{rname=Performance}} {{mod=@{selected|Performance_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Performance_bonus}@{selected|pbd_safe}[Performance]]]|Persuasion, +@{selected|Persuasion_bonus}@{selected|pbd_safe}[Persuasion]]]}} {{rname=Persuasion}} {{mod=@{selected|Persuasion_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Persuasion_bonus}@{selected|pbd_safe}[Persuasion]]]|Religion, +@{selected|Religion_bonus}@{selected|pbd_safe}[Religion]]]}} {{rname=Religion}} {{mod=@{selected|Religion_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Religion_bonus}@{selected|pbd_safe}[Religion]]]|Sleight Of Hand, +@{selected|Sleight_Of_Hand_bonus}@{selected|pbd_safe}[Sleight]]]}} {{rname=Sleight Of Hand}} {{mod=@{selected|Sleight_Of_Hand_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Sleight_Of_Hand_bonus}@{selected|pbd_safe}[Sleight]]]|Stealth, +@{selected|Stealth_bonus}@{selected|pbd_safe}[Stealth]]]}} {{rname=Stealth}} {{mod=@{selected|Stealth_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Stealth_bonus}@{selected|pbd_safe}[Stealth]]]|Survival, +@{selected|Survival_bonus}@{selected|pbd_safe}[Survival]]]}} {{rname=Survival}} {{mod=@{selected|Survival_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Survival_bonus}@{selected|pbd_safe}[Survival]]]|Strength, +@{selected|Strength_mod}@{selected|jack_attr}[STR]]]}} {{rname=Strength}} {{mod=@{selected|Strength_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Strength_mod}@{selected|jack_attr}[STR]]]|Dexterity, +@{selected|Dexterity_mod}@{selected|jack_attr}[DEX]]]}} {{rname=Dexterity}} {{mod=@{selected|Dexterity_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Dexterity_mod}@{selected|jack_attr}[DEX]]]|Constitution, +@{selected|Constitution_mod}@{selected|jack_attr}[CON]]]}} {{rname=Constitution}} {{mod=@{selected|Constitution_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Constitution_mod}@{selected|jack_attr}[CON]]]|Intelligence, +@{selected|Intelligence_mod}@{selected|jack_attr}[INT]]]}} {{rname=Intelligence}} {{mod=@{selected|Intelligence_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Intelligence_mod}@{selected|jack_attr}[INT]]]|Wisdom, +@{selected|Wisdom_mod}@{selected|jack_attr}[WIS]]]}} {{rname=Wisdom}} {{mod=@{selected|Wisdom_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Wisdom_mod}@{selected|jack_attr}[WIS]]]|Charisma, +@{selected|Charisma_mod}@{selected|jack_attr}[CHA]]]}} {{rname=Charisma}} {{mod=@{selected|Charisma_mod}@{selected|jack_bonus}}} {{r1=[[ @{selected|d20} + @{selected|Charisma_mod}@{selected|jack_attr}[CHA]]]}}} {{global=@{selected|global_skill_mod}}} @{selected|charname_output}
Thanks, that's exactly what I was looking for. Now Let's dive it deeply to try and understand it.
1605391850

Edited 1605391914
David M.
Pro
API Scripter
Ah, oops sorry about that. I had just done a quick search on my replies list and didn't noticed it was on the Pro thread. Thanks for copying, Rabulias! The simple template categories are detailed here . The html substitutions  }  are used for the closing double brackets that are within the query sections. The attribute @{selected|pbd_safe} is included in case you are using the optional rule for proficiency dice, but is ignored if you don't as the attribute will be blank.  The attributes @{selected|SkillName_bonus} automatically include base stats and bonuses. This is usually the same as using @{selected|RelevantAttributeName} + @{selected|pb}, but I think it may also include any hardcoded skill bonuses you could add from the sheet settings page. The @{selected|rtype} attribute will contain some convoluted string based on your sheet settings that will get substituted into your macro when the attributes are expanded prior to running. For example, setting to "Query Advantage" expands rtype to this before the rolls happen: {{query=1}} ?{Advantage?|Normal Roll,&#123&#123normal=1&#125&#125 &#123&#123r2=[[0d20|Advantage,&#123&#123advantage=1&#125&#125 &#123&#123r2=[[@{d20}|Disadvantage,&#123&#123disadvantage=1&#125&#125 &#123&#123r2=[[@{d20}} The @{selected|d20} attribute is pretty much always "1d20", but people could in theory modify to something else if they wanted to use something else as the base roll. Other than that, it's "just" a matter of keeping track of the syntax. This would have been super tedious if done manually. Like I said, these macros were generated by an api scriptlet that Oosh created. I would have never attempted to do it manually on my own!