This is such a great tool Jakob. Major kudos to you for making it happen!
I am running into a minor problem while attempting to make a specific case scenario work though. I am attempting to use this script to toggle a boolean attribute by using a macro button. Here is the syntax I am attempting to use which is not functioning correctly:
!setattr --sel --replace --repeating_buff_$0_buff-enable_toggle|((`{selected#repeating_buff_$0_buff~enable_toggle} ~ 1) * (`{selected#repeating_buff_$0_buff~enable_toggle} ~ 1))
When I activate this text command it gives the following:
Setting repeating_buff_$0_buff-enable_toggle to
((`{selected>repeating_buff_$0_buff~enable_toggle} ~ 1) *
(`{selected>repeating_buff_$0_buff~enable_toggle} ~ 1)) for
characters (character name here) (replacing <,>,#,~,;,` by [,],|,-,?,@).
However, the attribute in question is not changing. Any chance I'm missing something? Basically I want to set a boolean attribute to the value (b-1)*(b-1) where b=the current value of the attribute.
EDIT: So I found my first problem. I needed to be parsing the math before passing it into the script. So I have adjusted the text command as follows:
!setattr --sel --nocreate --repeating_buff_$0_buff-enable_toggle|(@{selected|repeating_buff_$0_buff-enable_toggle} - 1) * (@{selected|repeating_buff_$0_buff-enable_toggle} - 1)
This still doesn't quite work as when the attribute is set to 0 the returned message is:
Setting repeating_buff_$0_buff-enable_toggle to (0 - 1) * (0 - 1) for characters (character name here).
How can I get the (0-1)*(0-1) to parse before sending to the script?
EDIT2:
SUCCESS! I found that this script apparently functions with inline rolls! Here was the final text command used to achieve the desired effect:
!setattr --sel --nocreate --repeating_buff_$0_buff-enable_toggle|[[(@{selected|repeating_buff_$0_buff-enable_toggle} - 1) * (@{selected|repeating_buff_$0_buff-enable_toggle} - 1)]]