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

Toggling buffs on and off with CharSetAttr. Help needed.

So I'm looking to have a macro button, for one of my players for accessibility reasons, to toggle buffs on and off. I found <a href="https://app.roll20.net/forum/post/6600984/toggling-buffs/?pageforid=6600984#post-6600984" rel="nofollow">https://app.roll20.net/forum/post/6600984/toggling-buffs/?pageforid=6600984#post-6600984</a> which gives me the code: !setattr --charid -LHdrgIQKtoO-4rrAgMi --repeating_buff2_$0_enable_toggle|1 Now I have the API CharSetAttr activated and I have the CharID corrected. However the next part of the Script doesn't make any sense or gives errors. If anyone can help me here to explain what I can and cant change and what the changes do. My aim is to have a simple button to turn on the buff and turn it off. The macro buttons are larger. Please let me know if Im posting in the right area.
1606445423

Edited 1606447615
vÍnce
Pro
Sheet Author
I added this to the PF Community sheet wiki FAQ a while back.&nbsp; I believe it's relevant to your request. Here's an example of using the chatSetAttr script to toggle a Buff. This would toggle the buff found on the first row !setattr --sel --repeating_buff2_$0_enable_toggle|[[1-@{selected|repeating_buff2_$0_enable_toggle}]] even better is to use the rowID from the actual repeating buff&nbsp; !setattr --sel --repeating_buff2_ka2abgz9u85y56brghu_enable_toggle|[[1-@{selected|repeating_buff2_ka2abgz9u85y56brghu_enable_toggle}]] (be sure to use the rowID for your buff) EDIT : If you need a buff toggle for the PF by roll20 sheet, see further down. Hope that helps. Cheers
this is looking better, but how can i find the row ID?
i should also clarify this the official pathfinder for roll20 sheet
1606447473

Edited 1606447974
vÍnce
Pro
Sheet Author
Sorry, wasn't sure on the sheet.&nbsp; I saw the buff2 in your macro and I'm fairly certain that attribute is from the Community sheet. ;-) Regardless, you'll need to adjust the macro example above to match the PF Official sheet's attribute names.&nbsp; I'm not sure if the official sheet posts the rowid on the sheet.&nbsp; I don't think it does... You should be able use the browsers Inspect element on the buff and look at the html. Look for the&nbsp;data-reprowid value. &lt;div class="repitem" data-reprowid="-LVZZswF5Zhcn0nGjcRx"&gt; You can also enable the macro quickbar from the sidebar&gt;collection tab, drag and drop the buff's button(eye icon) to the quickbar, execute it from the quickbar, go into the chat input window and hit the UP arrow to get the rowID. copy/paste into your macro as needed. Try this (adjusted for the PF by roll20 sheet) Be sure to substitute your buff's rowID. !setattr --sel --repeating_buff_-LVZZswF5Zhcn0nGjcRx_toggle|[[1-@{selected|repeating_buff_-LVZZswF5Zhcn0nGjcRx_toggle}]]
Great It works for toggling on but im having issues toggling off
Ok i think i got it working
1606499445
vÍnce
Pro
Sheet Author
Chamoky said: Great It works for toggling on but im having issues toggling off The same macro should work for on or off.&nbsp; Issues?
yeah only toggles on but i can make a second macro to toggle off
1606505512

Edited 1606505619
vÍnce
Pro
Sheet Author
Chamoky said: yeah only toggles on but i can make a second macro to toggle off Strange, it seems to work for me using&nbsp; !setattr --sel --repeating_buff_-LVZZswF5Zhcn0nGjcRx_toggle|[[ 1 - @{selected|repeating_buff_-LVZZswF5Zhcn0nGjcRx_toggle} ]]
Ah perfect now working with the correct spacing :)
1606523472
vÍnce
Pro
Sheet Author
cool beans