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

Clear All Buffs?

January 23 (2 months ago)

Is there an API (or a macro) that allows you to Clear All Buffs?   I'm using the Pathfinder by Roll20 sheet.   I know you can click the function/button on the sheet (is says Clear All), but I can't seem to repeat the action in a macro.

I want to be able to have the macro, ask which token, and the select a token and clear all buffs that are toggled on, to off, associated with that token.

Is this possible?

I have one that does all conditions, but that seems static and connected to the sheet.

January 23 (2 months ago)

Edited January 23 (2 months ago)
vÍnce
Pro
Sheet Author

Hi Sean,
a quick look at the sheet shows that the Clear button is an action button. Fairly certain that sheetworkers fail to recognize an API triggering an action button as an event.  A workaround is to just make a chatsetattr macro that clears X amount of buffs.  --mute suppresses the normal error you would get if a repeating attribute/row didn't exist.
example that will clear the first 4 buffs of a selected token.  (add additional row if needed)

!setattr --sel {{
  --repeating_buff_$0_toggle|0 --mute
  --repeating_buff_$1_toggle|0 --mute
  --repeating_buff_$2_toggle|0 --mute
  --repeating_buff_$3_toggle|0 --mute
  }}


January 23 (2 months ago)


vÍnce said:

Hi Sean,
a quick look at the sheet shows that the Clear button is an action button. Fairly certain that sheetworkers fail to recognize an API triggering an action button as an event.  A workaround is to just make a chatsetattr macro that clears X amount of buffs.  --mute suppresses the normal error you would get if a repeating attribute/row didn't exist.
example that will clear the first 4 buffs of a selected token.  (add additional row if needed)

!setattr --sel {{
  --repeating_buff_$0_toggle|0 --mute
  --repeating_buff_$1_toggle|0 --mute
  --repeating_buff_$2_toggle|0 --mute
  --repeating_buff_$3_toggle|0 --mute
  }}



Excellent.  Great idea.  Thank you.