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

[Help] [Official Roll20 PF] Toggle Unchained Rage Buff Macro using ChatSetAttr?

I've been experimenting with the ChatSettAttr script in an attempt to write out a macro for one of my player's Unchained Barbarian, trying to make the toggle button in the buff section of the Official Pathfinder Roll20 sheet, but I've had no luck. The button to toggle is a simple @{repeating_buff_$id_toggle}, if only I could isolate it to the Unchained Rage as a macro into selective token action, but I have no idea how. All I need is the base and then I could add the flavor and template. Thank you for the help!
1593298944
vÍnce
Pro
Sheet Author
Hi Lucas, You'll need to learn the rowID for the buff you want to toggle.  You can use the browser's inspect element tool(right-click>inspect on the toggle checkbox) to peek at the html and learn the rowID of a particular toggle checkbox.  Look for the data-reprowid value (located in the parent div) see image below; Once you have the rowID, you should be able to make a chatsetattr macro like so !setattr --sel --repeating_buff_-LoJT3kHLFTR5X8ZImIC_toggle|[[1-@{selected|repeating_buff_-LoJT3kHLFTR5X8ZImIC_toggle}]] Hope that helps.
Perfect, works like a charm! Thanks for the help.
Huh, that's odd. As I was adding template modifiers to the macro (like &{template:pf} and --silent so all the script garble won't show on the chat window), it started to malfunction. Now, its acting almost like it is stacking the same macro on itself, giving me repeating numbers, while the actual sheet won't change and stays in its vanilla form. I tried erasing the macro and writing it in before adding the modifiers and it's still stuck in its repetition. Any ideas as to why and how this is happening?
1593306027
vÍnce
Pro
Sheet Author
Not sure. Maybe post your full macro to get a few more eyes on it.
1593306599

Edited 1593306740
Alright, so this was the macro I wrote verbatim alongside yours: !setattr --sel --repeating_buff_-M8TcEpH4TY7lXPjt5au_toggle|[[1-@{selected|repeating_buff_-M8TcEpH4TY7lXPjt5au_toggle}]] Then I tried to add some modifiers (bear with me, I'm still getting the hang of this): &{template:pf} {{name=Rage}} !setattr --silent --sel --repeating_buff_-M8TcEpH4TY7lXPjt5au_toggle|[[1-@{selected|repeating_buff_-M8TcEpH4TY7lXPjt5au_toggle}]]!!! {{description=Name enters an invigorating rage!}} And this is the message that pops up as I toggle the macro button:
1593312645
vÍnce
Pro
Sheet Author
Just a quick guess; what happens if you remove the extra exclamation points?  API commands are called by using "!".  The extra exclamations might be causing some issues.  Just a guess.  Also, the roll template itself could be causing a conflict.  Why include the roll template?
1593313205
GiGs
Pro
Sheet Author
API Scripter
Those exclamation marks are needed for chatSetAttrs syntax.
1593313628

Edited 1593313695
vÍnce
Pro
Sheet Author
GiGs said: Those exclamation marks are needed for chatSetAttrs syntax. Sorry, I didn't mean the ones for the API commands. I meant the other "!!!".
I tried removing everything, including the !!! (which was included for the syntax as GiGs mentioned) and the template (honestly, I am not even sure why I included it in the first place, probably because I saw that it was outputting a message on the chat, but I could easily do a --silent modifier on the macro), but the original (or any updated version) fails to work. It worked as quickly as it stopped, it probably went through 5 toggles before it broke somehow. Exiting and reentering the game, copying and pasting into a new macro, or manually rewriting the macro; nothing works for some reason. I've never experienced this kind of issue before.
Okay, so I did some poking around and I manually activated the buff through the sheet rather than through the macro. After I manually activated it, the macro began to work again. I'm going to try to fiddle around with it a bit more to make sure it stays working, but I still don't know what caused the issue. Maybe the path with the rowID got messed up somehow as it was executed?
1593315274
GiGs
Pro
Sheet Author
API Scripter
Vince said: GiGs said: Those exclamation marks are needed for chatSetAttrs syntax. Sorry, I didn't mean the ones for the API commands. I meant the other "!!!". The triple !!! is part of a feature added to chatSetAttr recently, to allow commands within a rolltemplate.
1593315496
Kraynic
Pro
Sheet Author
Since this is a buff being applied by sheetworkers throughout the sheet to various fields, is this being impacted by that bug (I assume it is a bug?) where the api doesn't always trigger sheetworkers? 
1593316309

Edited 1593316894
Kraynic said: Since this is a buff being applied by sheetworkers throughout the sheet to various fields, is this being impacted by that bug (I assume it is a bug?) where the api doesn't always trigger sheetworkers?  What's sheetworkers, if I may ask? Update: The bug started to occur once more, but now the manual activation doesn't seem to fix it anymore either.
1593317637
vÍnce
Pro
Sheet Author
GiGs said: Vince said: GiGs said: Those exclamation marks are needed for chatSetAttrs syntax. Sorry, I didn't mean the ones for the API commands. I meant the other "!!!". The triple !!! is part of a feature added to chatSetAttr recently, to allow commands within a rolltemplate. Sorry part deux.  I didn't know about the "!!!"   Maybe the API is having issues again?  I've used the macro I posted(only an adjustment to attribute names) without issue on the pf community shhet.  I haven't used it within a template though.
Sorry part deux.  I didn't know about the "!!!"   Maybe the API is having issues again?  I've used the macro I posted(only an adjustment to attribute names) without issue on the pf community shhet.  I haven't used it within a template though. I'm using the Roll20 Official Pathfinder Sheet, maybe that's where the issue is?
1593317797
vÍnce
Pro
Sheet Author
I tested on the official to make the proper attribute changes...
Oops sorry. I'm going to continue troubleshooting.
1593318895
vÍnce
Pro
Sheet Author
Do you see any errors in the API console when you execute your macro?
I did, but it was unrelated to ChatSetAttr as far as I know. It was a TokenCollision error regarding some scripts, like AreasOfEffect.
1593367381
vÍnce
Pro
Sheet Author
I'm not sure what to suggest at this point Lucas. ;-(  For what it's worth, I can get the toggle macro working without error as written, but if I try and insert it within a roll template (!!!) I also have issues/errors.  Admittedly this may be due to my lack of knowing all the features of chatsetattr. Maybe there is a conflict between API scripts.  Have you tried isolating the chatsetattr script?
Yup, I've isolated the script, too. I think I'm going to try my best and hope everything works out and if I ever find any solution for my bug, I'll post it.