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

Can We Use @{Target...} with sendChat()?

1426206142

Edited 1426206195
Hey guys, I can't seem to find any documentation for this, and I'm hoping someone here knows the answer. For some reason, i'm getting an error with sendChat('','&{template:default} {{name= Hell Hound Attack }} {{ AC: [[ @{target|Target2|AC}]] }}'); SyntaxError: Expected "[" or [ |\t] but "t" found. Whereas when I type the same command directly into chat, it works fine. Does sendChat() preclude the use of @target?
1426221829
The Aaron
Pro
API Scripter
No, you can't use @{target} or @{selected} or ?{query|default} or &tracker with sendChat(). Such things are expanded by the user client. There isn't a way for the API to prompt a user for target selection, or to have something selected or prompt them for an answer, or know what token to set the tracker from. You can issue an API button to the chat, which a user can click, in which case those items will be expanded on the client side.
OK, I think I got it. Thanks for the explanation. :)
1426250246
The Aaron
Pro
API Scripter
No worries. :)