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

Problem with "buff-enable_toggle"

I use the pathfinder character sheet I am trying to use [[@{repeating_buff_$1-enable_toggle}]] to check if I have an active buff, but it keeps returning me a 0. I also tried with [[@{repeating_buff_-l7eji7pzzprhpnsunpb_buff-enable_toggle}]], and still it does not work. What am I doing wrong?
1524233295
vÍnce
Pro
Sheet Author
Macros are read only.  You would need to use an API script (pro perk) like chatsetattr to change the value of the attribute. example of using chatsetattr to toggle a checkbox input !setattr --sel --repeating_buff_-l7eji7pzzprhpnsunpb_buff-enable_toggle|[[1-@{repeating_buff_-l7eji7pzzprhpnsunpb_buff-enable_toggle}]]
1524297750

Edited 1524299713
Vince said: Macros are read only.  You would need to use an API script (pro perk) like chatsetattr to change the value of the attribute. example of using chatsetattr to toggle a checkbox input !setattr --sel --repeating_buff_-l7eji7pzzprhpnsunpb_buff-enable_toggle|[[1-@{repeating_buff_-l7eji7pzzprhpnsunpb_buff-enable_toggle}]] Mmh, I am not sure I have fully understood your reply. I don't want to modify the value, I want to read it. If I am not wrong, it should return 1 if the buff is active, and 0 if it is not, while it keeps returning always 0 no matter what I do.  Edit: Ok, I've managed to solve it. The problem was the name of the attribute, the correct one is @{repeating_buff2_$1_enable_toggle} Now it seems to work. Do you know if I can dinamically modify it via the token's bar, as we can do for the HPs?
1524327286
vÍnce
Pro
Sheet Author
Sorry for any confusion.  Most people want to toggle a checkbox on/off so that it can trigger something on the sheet.  check/un-check changes the value of the attribute, but since macros are read-only, this isn't possible without using the API.  Unfortunately you cannot link bars to repeating attributes or hidden attributes, because they don't show up in the drop-down selector. ;-(