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

ScriptCard Initiative Tracker

1657791147

Edited 1657796362
Shey L'Ours
Pro
Sheet Author
I'm tryging to get a tracker for initiative, but I don't really understand how the synthax work. Here&nbsp; [$Total]&nbsp; is the result of my Initiative roll, in the same ScriptCard's script [...] --~[TurnOrder]|@{character_name};[$Total] I'm using the wiki for that : <a href="https://wiki.roll20.net/Script:ScriptCards" rel="nofollow">https://wiki.roll20.net/Script:ScriptCards</a> It give that line as exemple --~[Variable Name]|&lt;Funtion&gt;;[parameter];[parameter]... turnorder clear none none Clears all entries from the&nbsp; t &nbsp; Turn Tracker /Initiative turnorder addtoken tokenid;trackervalue none Adds the token represented by "tokenid" to the initiative tracker with an initiative value of "trackervalue" turnorder replacetoken tokenid;trackervalue none Replaces the token represented by "tokenid" in the initiative tracker with an initiative value of "trackervalue". Will add the token if it doesn't exist in the tracker. turnorder removetoken tokenid none Removes the token represented by "tokenid" from the initiative tracker if it exists
1657806101
David M.
Pro
API Scripter
Which turnorder sub-function are you trying to use? Adding a turn? Example: !script {{ &nbsp; --#hidecard|1 &nbsp; --=total|1d20 &nbsp; --~|turnorder;addtoken;@{selected|token_id};[$total] }}&nbsp; Some functions return values to the scriptcard (which may be re-used later in the script) and will require --~varName|etc...&nbsp; But, since the turnorder functions don't return a value, you can skip that optional requirement and just use --~|etc... Note you could add a variable name (like --~dummy|etc...) if you wanted, but it would not contain a value. The [...] and &lt;...&gt; in the function documentation are not actually part of the syntax but are used to represent optional and required fields, respectively. If you look at the table of functions in the wiki, you will see that the "Parameters" column has a variable number of parameters depending on the subfunction. The subfunction is also always required. This is probably an oversight in the documentation. It should probably read: --~[Variable Name]|&lt;Function&gt;;&lt;subFunction&gt;;[parameter];[parameter]... Since "VariableName" and the parameters are in square brackets, they are optional from a generic sense, but may be required depending on which function/subfunction you are using. Hope that makes sense.&nbsp;
1657807103
Shey L'Ours
Pro
Sheet Author
It is, I put " [...]" &nbsp;for indicate that it wasn't the start of my script, my mistake. I was missing that part :&nbsp; @{selected|token_id} &nbsp;I miss my lessons about "tokens" I've not read yet the documentation... ! Thanks for the tips !