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

[Torch Script] Syntax Error?

Hey guys, I'm trying to use the Torch API Script, but when I use the format as written, it seems to return a syntax error. This is what I'm trying to enter on the chat: !torch [40 [20 [1 [@{target|token_id} | 360 ]]]] And this is the output: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "o" found. I've tried @{target|Target 1|token_id} and I've tried the three periods (...) after the angle, I've even tried using blanks in everything but the token request ( [[[[@{target|token_id} |]]]] ) and I'm still getting that Syntax Error. Is there something I'm doing wrong? Kind regards, Klaus
1495025723

Edited 1495025778
The Aaron
Pro
API Scripter
Right.. sorry.  I use a common notation for command line arguments when writing the help.  Anything in [ ] is an optional parameter, anything < > is a required parameter.  So the syntax you want is: !torch 40 20 1 @{target|token_id} That will give you a 40' diameter light, which gets dark starting at 20', is visible to all players and will put it on the targeted token. If you select the token, you could just do: !torch as 40 is the default diameter, the dim defaults to half the diameter, it defaults to on, and it will apply to the selected token(s). Hope that helps!
1495025819

Edited 1495025881
My guess is that you don't actually need the square brackets ([ ]). Also, IIRC you don't need to specify the 360 as it is assumed. You technically don't need to @{target|token_id} either if you would rather just have the token selected.
Ahh perfect! Thanks for the super fast reply, the lack of an exact example had me confused for like 3 hours last night haha. Thank you again for setting me straight!
1495026073
The Aaron
Pro
API Scripter
No worries.  I've been trying to add examples in newer scripts... I'll see about going back and adding some details to that one at some point....