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

ChatSetAttr Question

1620270943

Edited 1620270992
I am trying to set the initiative bonus on a character !setattr --sel -replace --initiative_bonus|/at{selected|dexterity_mod} + (/at{selected|dexterity_base}/100) But all I am getting is this (From ChatSetAttr): Errors No target characters. You need to supply one of --all, --allgm, --sel, --allplayers, --charid, or --name. Any thoughts?  I have gotten other ones to work, but this one has me stumped (and yes I am clicking on a token before I run this :) )
1620274460
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It looks like there are a few issues with spaces and missing hyphens. Try this: !setattr --sel --replace --initiative_bonus|/at{selected|dexterity_mod}+(/at{selected|dexterity_base}/100)
1620275136

Edited 1620275237
I believe you have 4 issues: 1. You need two hyphens before 'replace' instead of one 2. You should use single quotes around the entire attribute text (this is not totally necessary but good to be in the habit for cases where it is needed) 3. You need to use a backslash instead of a forwardslash in front of the 'at' 4. You need to escape the vertical pipes with a backslash I think this should do it: !setattr --sel --replace --initiative_bonus|'\at{selected\|dexterity_mod} + (\at{selected\|dexterity_base}/100)' Here is the readme page.