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

Query macro (don't show in the chat on NO option)

1613600158

Edited 1613601483
I have a macro for Divine Smite, is there any way to not show "the query option" it in the chat window when you choose the NO option? Let me explain.....  I wish that:  Divine Smite (when choose NO  Divine Smite: don't show anything on the chat) Divine Smite  (when choose  YES  Divine Smite: normal damage resolution) Currently as the macro is, when NO Divine Strike is chosen, in the chat it is resolved and the window is shown as 0 damage. I just need nothing to be displayed in NO Divine Smite. I don't know if there is any way to do it :P, I've been looking and I can't find any way to do it.  here is the macro that i use %{selected|repeating_attack_$0_attack} &{template:simple} {{rname=Divine Smite}} {{r1=[[?{Divine Smite?| No, 0| 1st,2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}| 2nd,3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}| 3rd,4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}}]]}} {{normal=1}} {{charname=Radiant}}
1613602026

Edited 1613602086
GiGs
Pro
Sheet Author
API Scripter
Can you replace this part No, 0| with No, | ? (on reflection, no you probably cant if you are using a sheet's roll template. The only solution is likely a custom script.)
GiGs said: Can you replace this part No, 0| with No, | ? (on reflection, no you probably cant if you are using a sheet's roll template. The only solution is likely a custom script.) Unfortunately it does not work. This option does not play the macro, and nothing appears in the chat. The attack is not executed. 
You'll have to adjust the macro, and it might not be possible to do. You'd need to move all of the template information into each output of the query, then get all of the html replacements in place as well... which may not be possible depending on the order of operations. (My arrows on the left should be to the right of the commas) It will be something like this, but with corrected html replacements: %{selected|repeating_attack_$0_attack} No, 0| 1st,&{template:simple} {{rname=Divine Smite}} {{r1=[[?{Divine Smite?|2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8} }]]}} {{normal=1}} {{charname=Radiant}} | 2nd,&{template:simple} {{rname=Divine Smite}} {{r1=[[?{Divine Smite?|3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8} }]]}} {{normal=1}} {{charname=Radiant}} | 3rd,&{template:simple} {{rname=Divine Smite}} {{r1=[[?{Divine Smite?|4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}}]]}} {{normal=1}} {{charname=Radiant}} The problem is when you select 'No', what is being output into chat is: %{selected|repeating_attack_$0_attack} &{template:simple} {{rname=Divine Smite}} {{r1=[[ 0]]}} {{normal=1}} {{charname=Radiant}} That's because the  &{template:simple} {{rname=Divine Smite}} {{r1=[[ ]]}} {{normal=1}} {{charname=Radiant}}  information is all outside of the query. The only way to prevent it from being entered into chat is to keep it inside  the query. But then you run into order of operations issues needing html replacements.
By putting the query at the beginning and common template fields at the end of the line you can use the fact that lines starting with a ! get suppressed. Try this - %{selected|repeating_attack_$0_attack} ?{Divine Smite?| No,! | 1st,{{r1=[[2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 2nd,{{r1=[[3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 3rd,{{r1=[[4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}} &{template:simple} {{rname=Divine Smite}} {{normal=1}} {{charname=Radiant}}
RainbowEncoder said: By putting the query at the beginning and common template fields at the end of the line you can use the fact that lines starting with a ! get suppressed. Try this - %{selected|repeating_attack_$0_attack} ?{Divine Smite?| No,! | 1st,{{r1=[[2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 2nd,{{r1=[[3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 3rd,{{r1=[[4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}} &{template:simple} {{rname=Divine Smite}} {{normal=1}} {{charname=Radiant}} Hah well damn there you go.  Nice.
RainbowEncoder said: By putting the query at the beginning and common template fields at the end of the line you can use the fact that lines starting with a ! get suppressed. Try this - %{selected|repeating_attack_$0_attack} ?{Divine Smite?| No,! | 1st,{{r1=[[2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 2nd,{{r1=[[3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 3rd,{{r1=[[4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}} &{template:simple} {{rname=Divine Smite}} {{normal=1}} {{charname=Radiant}} Great works like a charm :) Thx to all..... for the help :)
1613609817
David M.
Pro
API Scripter
Nice one, RainbowEncoder! I'll have to remember that (who am I kidding, I won't remember...)
1613620866
vÍnce
Pro
Sheet Author
Stupid trick worthy IMO. ;-) Jarren K. said: RainbowEncoder said: By putting the query at the beginning and common template fields at the end of the line you can use the fact that lines starting with a ! get suppressed. Try this - %{selected|repeating_attack_$0_attack} ?{Divine Smite?| No,! | 1st,{{r1=[[2d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 2nd,{{r1=[[3d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}| 3rd,{{r1=[[4d8 + ?{Fiend or Undead?|No, 0|Yes, 1d8}]]}}} &{template:simple} {{rname=Divine Smite}} {{normal=1}} {{charname=Radiant}} Hah well damn there you go.  Nice.
1613665845

Edited 1613666285
Very useful to save space in the chat when you don't use a feature.  RainbowEncoder you should upload it to stupid tricks thread.