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

Need help with API Buttons in Chat

1608229946

Edited 1608230267
I was making Some Abilities Macros and I was adding some API button to roll Dice, but I don't like how it all a mass, and it not in a Template. this is my API Butten Code: [Hidden Roll](!
[[[1d8+@{wisdom_mod}[WIS]]] Force) is there a way to put this in a template or make it where it only gives me the total?
1608230605

Edited 1608231463
Jordan C.
Pro
API Scripter
Zachary G. said: I was making Some Abilities Macros and I was adding some API button to roll Dice, but I don't like how it all a mass, and it not in a Template. this is my API Butten Code: [Hidden Roll](!
[[[1d8+@{wisdom_mod}[WIS]]] Force) is there a way to put this in a template or make it where it only gives me the total? What is the desired look/contents?  This will create a generic damage output: [Hidden Roll](!
You deal [[1d8+@{wisdom_mod}[WIS]]] force damage)
Jordan C.  said: What is the desired look/contents?  This will create a generic damage output: [Hidden Roll](!
You deal [[1d8+@{wisdom_mod}[WIS]]] force damage) that looks better. the desired look would be using the default template. &{template:default} if possible
1608231643
Jordan C.
Pro
API Scripter
Here's one: [Hidden Roll](!
##&{template:default} {{name=Result}} {{[[1d8+@{wisdom_mod}]] force damage}}) There's also something like this for the standard 5e sheet: [Hidden Roll](!
##&{template:npcaction} {{rname=Spiritual Weapon}} {{name=Player Name}} {{description=[[1d8+@{wisdom_mod}]] force damage}})
thank you so much  Jordan C. 
1608232016
Jordan C.
Pro
API Scripter
No problem! Glad to help
1608297688

Edited 1608298092
I need help I edit the code that  Jordan C.  saw me and I can't get this one to work [Roll for damage](!
##&{template:default} {{name=Spear}}{{Lance's wielding the spear with ?{One handed or Two Handed?|1|2} Hands}}{{@{target|1|token_name} takes=[[1d[[(?{One handed or Two Handed?}+2)*2]]+@{strength_mod}[STR]]] piercing}}) also the header  {{name=headerName}} seem to brack if i put it in another template. here a ex: &{template:default}{{name=header1}}{{[Hidden Roll](!
##&{template:default} {{name=Result}} {{[[1d8+@{wisdom_mod}]] force damage}})}}
1608302353
Jordan C.
Pro
API Scripter
The paramaters for the template are different based on which one you use. If you have one you want to use I can help you determine what they are. I believe this fixes the first macro: [Roll for damage](!
##&{template:default} {{name=Spear}} {{Lance is wielding the spear with ?{One or Two Handed?|1|2} hands}} {{@{target|1|token_name} takes [[[[1d?{One or Two Handed?}*2]] + [[1d8+@{strength_mod}]] ]] force damage}})
1608305547

Edited 1608305801
this is is one I'm using for my Spiritual Weapon &{template:default}{{name=Spiritual Weapon Attack}}{{?{Has Advantage or Disadvantage?|No, Roll to Hit=[[1d20+@{spell_attack_bonus}[SpellAttackBonus]]]|Yes, Roll to Hit With Adv/Dis= [[1d20+@{spell_attack_bonus}[SpellAttackBonus]]] or [[1d20+@{spell_attack_bonus}[SpellAttackBonus]]]}}}{{Cast at Level=@{repeating_resource_$0_resource_left}}}{{[roll for damage](!
##&{template:default}{{name=Spirtual Weapon Attack}}{{@{target|1|token_name} take=[[[[@{repeating_resource_$0_resource_left}/2]]d8+@{wisdom_mod}]] force damage}}{{If Crit add=[[[[@{repeating_resource_$0_resource_left}/2]]*8]]}})}}{{*Casting Time:=1 bonus action*}}{{*Attack Range:=5ft*}}{{*Moving Speed:=20ft*}}{{*Components:=V,S*}}{{*Duration:=1 minute*}} and one for magic missile ?{What Level Magic Missile?[Magic Missile lvl1](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=1}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{Spell Cost=[[2]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}#123;{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl2](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=2}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{Spell Cost=[[3]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl3](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=3}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{Spell Cost=[[5]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl4](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=4}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{Spell Cost=[[6]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl5](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=5}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{@{target|7|token_name} Gets hits with Missile 7=[[1d4+1]] force}}{{Spell Cost=[[7]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl6](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=6}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{@{target|7|token_name} Gets hits with Missile 7=[[1d4+1]] force}}{{@{target|8|token_name} Gets hits with Missile 8=[[1d4+1]] force}}{{Spell Cost=[[9]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl7](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=7}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{@{target|7|token_name} Gets hits with Missile 7=[[1d4+1]] force}}{{@{target|8|token_name} Gets hits with Missile 8=[[1d4+1]] force}}{{@{target|9|token_name} Gets hits with Missile 9=[[1d4+1]] force}}{{Spell Cost=[[10]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl8](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=8}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{@{target|7|token_name} Gets hits with Missile 7=[[1d4+1]] force}}{{@{target|8|token_name} Gets hits with Missile 8=[[1d4+1]] force}}{{@{target|9|token_name} Gets hits with Missile 9=[[1d4+1]] force}}{{@{target|10|token_name} Gets hits with Missile 10=[[1d4+1]] force}}{{Spell Cost=[[11]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})[Magic Missile lvl9](!
##&{template:default}{{name=Magic Missile}}{{Magic Missile Cast at Lvl=9}}{{@{target|1|token_name} Gets hits with Missile 1=[[1d4+1]] force}}{{@{target|2|token_name} Gets hits with Missile 2=[[1d4+1]] force}}{{@{target|3|token_name} Gets hits with Missile 3=[[1d4+1]] force}}{{@{target|4|token_name} Gets hits with Missile 4=[[1d4+1]] force}}{{@{target|5|token_name} Gets hits with Missile 5=[[1d4+1]] force}}{{@{target|6|token_name} Gets hits with Missile 6=[[1d4+1]] force}}{{@{target|7|token_name} Gets hits with Missile 7=[[1d4+1]] force}}{{@{target|8|token_name} Gets hits with Missile 8=[[1d4+1]] force}}{{@{target|9|token_name} Gets hits with Missile 9=[[1d4+1]] force}}{{@{target|10|token_name} Gets hits with Missile 10=[[1d4+1]] force}}{{@{target|11|token_name} Gets hits with Missile 11=[[1d4+1]] force}}{{Spell Cost=[[13]] mana}}{{*Casting Time:=1 action*}}{{*Range:=120ft*}}{{*Components:=V,S*}}{{*Duration:=Instantaneous*}})
1608311428

Edited 1608314491
Jordan C.
Pro
API Scripter
Still working on a fix for the second one, but the first one should be fixed by simply adding another equal sign ("="). I have no clue why it gets lost in the macro but it does: &{template:default}{{name=Spiritual Weapon Attack}}{{?{Has Advantage or Disadvantage?|No, Roll to Hit=[[1d20+@{spell_attack_bonus}[SpellAttackBonus]]]|Yes, Roll to Hit With Adv/Dis= [[1d20+@{spell_attack_bonus}[SpellAttackBonus]]] or [[1d20+@{spell_attack_bonus}[SpellAttackBonus]]]}}}{{Cast at Level=@{repeating_resource_$0_resource_left}}}{{[roll for damage](!
##&{template:default}{{name==Spirtual Weapon Attack}}{{@{target|1|token_name} take=[[[[@{repeating_resource_$0_resource_left}/2]]d8+@{wisdom_mod}]] force damage}}{{If Crit add=[[[[@{repeating_resource_$0_resource_left}/2]]*8]]}})}}{{*Casting Time:=1 bonus action*}}{{*Attack Range:=5ft*}}{{*Moving Speed:=20ft*}}{{*Components:=V,S*}}{{*Duration:=1 minute*}} Okay so first off, the second one is missing a lot - you need "|" characters to separate answers for queries and the "template:defaults" I believe need the "}" at the end instead of "}". I did a lot of trial and error and it seems that the colon is once again the culprit. I don't have a solution at the moment and don't know if it's exactly possible.
thx a lot for the help, the second one I can do without the Question, I just click the button for the lvl i need
1608321917
Jordan C.
Pro
API Scripter
No problem! I'm likely saving these as templates for later - I really like the ideas behind them.
I got another one I need help fixing &{template:default}{{name=Spear}}{{?{Has Advantage or Disadvantage?|No, Roll to Hit=[[1d20+@{strength_mod}[STR]+@{pb}[Proficiency]]]|Yes, Roll to Hit With Adv/Dis=[[1d20+@{strength_mod}[STR]+@{pb}[Proficiency]]] or [[1d20+@{strength_mod}[STR]+@{pb}[Proficiency]]]}}}?{One handed or Two Handed?|1|2}?{Thrown?|No, {{Range=5ft}}{{?{One handed or Two Handed?} Handed Attack=[roll for damage](!
##&{template:default}{{name==Spear}}{{[[1d[[(?{One handed or Two Handed?}+2)*2]]+@{strength_mod}[STR]]] piercing}})|Yes, {{Range:=20/60ft (Thrown)}} {{Damage=[roll for damage](!
##&{template:default}{{name==Spear}}{{Damage=[[1d6+@{strength_mod}[STR]]] piercing}})}?{Add Divine strike?|Yes, {{Divine strike=[roll for damage](!
##&{template:default}{{name==Divine strike}}{{Damage=[[1d8]] radiant}})|No}?{Cast Booming Blade?|No|Yes, {{Booming Blade=[roll for damage](!
##&{template:default}{{name==Booming Blade}}{{Damage=[[[[floor((@{level}+1)/6)]]d8]] thunder}}){{if target move 5ft takes=[roll for damage](!
##&{template:default}{{name==Booming Blade}}{{Damage=[[[[[[floor((@{level}+1)/6)]]+1]]d8]] thunder}})}?{Cast Blue-Flame Blade?|No|Yes, {{Blue-Flame Blade=[roll for damage](!
##&{template:default}{{name==Blue-Flame Blade}}{{Damage=[[[[floor((@{level}+1)/6)]]d8]] fire}}){{Target 2=[roll for damage](!
##&{template:default}{{name==Blue-Flame Blade}}{{Damage=[[[[[[floor((@{level}+1)/6)]]+1]]d8+@{intelligence_mod}+@{pb}]] fire}})}