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

Question about ChatSetAttr

Hey all, if I wanted to set a value of Spell1Macro with #Z1-DD, the standard command line would be !setattr --sel --spell1macro|#z1-DD But it keeps triggering the macro instead of updating the attribute. If I do it in a game without that macro its fine, but it would be great if I understood the proper way of coding it so it didn't trigger the macro when I wanted to change spell1macro in a live game. Thanks!
1653229221

Edited 1653229324
Andreas J.
Forum Champion
Sheet Author
Translator
To stop ChatSetAttr from evaluating # or | in an attribute, you can place a \ in front of them. (This was new to me as well.) This is mentioned in the documentation: <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/ChatSetAttr#attribute-syntax" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/ChatSetAttr#attribute-syntax</a> Example: !setattr --sel --spell1macro|\#test2 It also has the --replace option to handle a couple of character substitutes, but # wasn't included in the list. Btw,&nbsp; what are you using the stored macro for, do you reference it in some other macro?