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

Setting Iterative attacks in PF sheet with Chat Attribute

I'm trying to come up with a macro to toggle both the Haste buff, and iterative attack I have set up for haste.  Disabling it is fine, but enabling the toggle has thus far proved ineffective.  I am using SetChatAttr to attempt this.  Does anyone have any sugestions? ?{Toggle Haste:|On,!setattr {{ --silent --name Magnus --repeating_buff2_$3_enable_toggle|1 --repeating_weapon_$1_toggle_iterative_attack2|1 }}|Off,!setattr {{ --silent --name Magnus --repeating_buff2_$3_enable_toggle|0 --repeating_weapon_$1_toggle_iterative_attack2|0 }}}}}
1507263953

Edited 1507264046
My first guess is the roll query is ending on the first } that you have used in ChatSetAttr. I would recommend removing the double curly brackets as they're not needed if the options and attributes are all on the same line like you have here. You can also remove the roll query entirely if you'd like and just have a 1 button on/off toggle by setting the attribute changes like so --attribute|[[1-@{attribute}]] so that attribute value will switch between 1 and 0 each time the macro is called. If that doesn't fix the issue and no one has fixed it by then I'll have a look at the Pathfinder sheet HTML tomorrow.
1507264779

Edited 1507265320
Trying to do --attribute|[[1-@{attribute}]] keeps returning a message that says that the attribute has been set to 1, which seems to suggest that 1 isn't the correct value for the toggle switch? Edit: correction, It toggles between 1 and 0, but doesn't actually change the checkbox, or include the attack.
1507267067
vÍnce
Pro
Sheet Author
I think there may be a bug in the sheet.  I've used  !setattr --sel --repeating_buff2_$0_buff-enable_toggle|[[1-@{selected|repeating_buff2_$0_buff-enable_toggle}]] in the past to toggle buffs, but as you have experienced, it no longer seems to trigger the sheet worker script.  I'll post it on our dev site and we'll see if it's something in the sheet's code or perhaps a recent change on roll20.
1507279516
Ziechael
Forum Champion
Sheet Author
API Scripter
Also, to save future headaches you can remove the {{ }} from the ChatSetAttr results, you only need them surrounding the commands when you are wanting to have line breaks for easier reading but since you are doing it as a single line command: !setattr {{ --silent --name Magnus --repeating_buff2_$3_enable_toggle|1 --repeating_weapon_$1_toggle_iterative_attack2|1 }} Is the same as: !setattr --silent --name Magnus --repeating_buff2_$3_enable_toggle|1 --repeating_weapon_$1_toggle_iterative_attack2|1