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

Help with inline roll query

1375564707
Keith
Pro
Marketplace Creator
I have a pretty complicated roll that uses rollable tables that I want to send to the chat from the API. Bracketing Fire [[{?{Guns|2}t[?{Color|B}] }k2 + {?{Crew|2}t[?{Color|G}] }k1]] at Location [[1d6]] If I type this into the chat window, it works just fine.  If I pass this exact string using sendChat in the API I get the following error... SyntaxError: Expected "(", ".", "[", "ceil(", "d", "floor(", "t", "{", [ |\t], [+|\-] or [0-9] but "?" found. I imagine that there are some characters that I need to be escaping when using the string in the API, but for the life of me I cannot figure out which ones. Any help would be appreciated
Sorry about that, I should have specified in the information on the Mentor post, but the roll queries don't work API-side. I'm not sure that they ever will, honestly, since roll queries are a client-side thing that is parsed before anything is ever sent to the API (both for chat messages/rolls and API commands). What you could do is create a global macro fro the game, where you use Roll Queries to accept arguments for an API command. For example, your macro could be: !command ?{Guns|2} ?{Color|B} ?{Crew|2} ...and then on the API side you would get those arguments and make the roll as needed, using sendChat.
1375586525
Keith
Pro
Marketplace Creator
Thanks, Riley.  I'll give it a shot... Tried it and it works great.  Thanks again for your guidance.