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

use chatsetattr inside a scriptcard?

Hi there, I would like to use the following inside a scriptcard. !modattr --sel --Daily|-1 I have tried this way: --@modattr|_sel|_Daily|-1 That is the answer (From ChatSetAttr): Errors No target characters. You need to supply one of --all, --allgm, --sel, --allplayers, --charid, or --name. Can someone help me,please?
1613825794
David M.
Pro
API Scripter
Try this? I believe the first bar tells scriptcards the arguments are coming, then all you do after that is replace the double dashes. Looks like you have an extra bar added in yours. --@!modattr|_sel _Daily|-1
1613834081
Andreas J.
Forum Champion
Sheet Author
Translator
I think the problem is that whatever "scriptcard" APi you're using, it doesn't hand over the selection to ChatSetAttr, which is the reason behind this error. This happens with a good number of APIs. SelectManager is an API that is meant to help fix this issue when having separate API interacting with eachother.
The _sel option doesn't work when calling ChatSetAttr from within a scriptcard. I don't know why. You have to specify token_id instead.
1613837019

Edited 1613837033
timmaugh
Pro
API Scripter
ᐰndreas is right... for the OP and for anyone else wondering: When ScriptCards launches ChatSetAttr, that is one script launching another script (or what we call an API-generated script call), and those don't come with selected tokens. That's where SelectManager helps. You can configure SelectManager to auto-insert the selected tokens globally, or use a forselected handle to insert them in this one instance, or alter ChatSetAttr as mentioned in the linked thread to passively use the data SelectManager provides. Those options are detailed on the linked thread so I won't expand on them here besides just mentioning them. Feel free to post back if you can't figure it out.
First of all thanks for your advices. I will give it a try.
1613905473
David M.
Pro
API Scripter
Ah yes, timmaugh speaks truth. I was only looking at it from a basic scriptcards syntax point of view, and wasn't paying attention to what the modattr commands were actually asking! I'm one of those weird people that never really uses ChatSetAttr :)