https://wiki.roll20.net/index.php?title=Script:TokenSync&feed=atom&action=historyScript:TokenSync - Revision history2024-03-28T11:17:58ZRevision history for this page on the wikiMediaWiki 1.20.3https://wiki.roll20.net/index.php?title=Script:TokenSync&diff=23422&oldid=prev1223200 at 14:45, 19 February 20212021-02-19T14:45:24Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 14:45, 19 February 2021</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 79:</td>
<td colspan="2" class="diff-lineno">Line 79:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.0|2016-03-16|* Release}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.0|2016-03-16|* Release}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">[[Category:API]]</del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Discontinued API Scripts]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:Discontinued API Scripts]]</div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=Script:TokenSync&diff=20706&oldid=prev1223200: tagged as "discontinued API"2020-06-17T14:14:21Z<p>tagged as "discontinued API"</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 14:14, 17 June 2020</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 80:</td>
<td colspan="2" class="diff-lineno">Line 80:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><br></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:API]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[Category:API]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:Discontinued API Scripts]]</ins></div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=Script:TokenSync&diff=16204&oldid=prev1223200: /* Changelog */2018-03-26T17:37:31Z<p><span dir="auto"><span class="autocomment">Changelog</span></span></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 17:37, 26 March 2018</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 78:</td>
<td colspan="2" class="diff-lineno">Line 78:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.1|2016-03-17|* Added syncing new tokens, sync on represents change, remove deleted characters}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.1|2016-03-17|* Added syncing new tokens, sync on represents change, remove deleted characters}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.0|2016-03-16|* Release}}</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>{{changelog version|1.0|2016-03-16|* Release}}</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><br></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:API]]</ins></div></td></tr>
</table>1223200https://wiki.roll20.net/index.php?title=Script:TokenSync&diff=10868&oldid=prev92730: Created page with "<div style="float: {{{1|right}}}; width: 200px; padding: 5px; border: 1px solid #777; margin: 0 15px 15px 15px; background-color: #efefef;"> <span style="text-align:center;dis..."2016-03-20T22:21:40Z<p>Created page with "<div style="float: {{{1|right}}}; width: 200px; padding: 5px; border: 1px solid #777; margin: 0 15px 15px 15px; background-color: #efefef;"> <span style="text-align:center;dis..."</p>
<p><b>New page</b></p><div><div style="float: {{{1|right}}}; width: 200px; padding: 5px; border: 1px solid #777; margin: 0 15px 15px 15px; background-color: #efefef;"><br />
<span style="text-align:center;display:block;font-size:1.4em">API Script</span><br />
<span style="font-variant:small-caps">'''Author:''' {{user profile|92730|James W.}}, {{user profile|104025|The Aaron}} </span><br><br />
{{script version|1.60}}<br><br />
{{script lastmodified date| 2016-3-13}}<br><br />
<span style="font-variant:small-caps">'''Code:''' [https://github.com/SCPRedMage/roll20-api-scripts/blob/master/TokenSync/TokenSync.js TokenSync] </span><br><br />
<span style="font-variant:small-caps">'''Dependencies:''' None </span><br><br />
<span style="font-variant:small-caps">'''Conflicts:''' Unknown </span><br />
</div><br />
TokenSync is a script to synchronize changes to a token to all other tokens that represent the same character. Now you can set the tokens representing your PCs to always have the same status markers, for example. Just tell TokenSync which property (or properties) to synchronize, and any time that property changes on any token that represents that character changes, TokenSync will propagate that change to all other tokens that represent that character.<br />
<br />
=== Usage ===<br />
:'''!tokensync''' -- This is the interface command, with the following options:<br />
::{| class="wikitable"<br />
|-<br />
! Parameter !! Description<br />
|-<br />
| --help || Displays the help script.<br />
|-<br />
| --add property|| Adds the specified property to the list of properties that TokenSync will synchronize for the character the selected token represents; if you want to specify multiple properties, just separate them with a vertical bar ("&#124;").<br />
|-<br />
| --remove property|| Removes the specified property from the list of properties that TokenSync will synchronize for the character the selected token represents; if you want to specify multiple properties, just separate them with a vertical bar ("&#124;").<br />
|-<br />
| --removeall|| Removes all properties for the selected character from the sync list.<br />
|-<br />
| --forcesync|| Forces a synchronizes event to update all properties to match selected token; useful for forcing updates after calling an API script to change token properties.<br />
|}<br />
<br />
=== Properties that can be syncrhonized ===<br />
* imgsrc<br />
* bar1_link<br />
* bar2_link<br />
* bar3_link<br />
* width<br />
* height<br />
* rotation<br />
* layer<br />
* isdrawing<br />
* flipv<br />
* fliph<br />
* name<br />
* aura1_radius<br />
* aura2_radius<br />
* aura1_color<br />
* aura2_color<br />
* aura1_square<br />
* aura2_square<br />
* tint_color<br />
* statusmarkers<br />
* showname<br />
* showplayers_name<br />
* showplayers_bar1<br />
* showplayers_bar2<br />
* showplayers_bar3<br />
* showplayers_aura1<br />
* showplayers_aura2<br />
* light_radius<br />
* light_dimradius<br />
* light_otherplayers<br />
* light_hassight<br />
* light_angle<br />
* light_losangle<br />
* light_multiplier<br />
<br />
Note: imgsrc will only sync if the token was created from your library; basically, if [https://wiki.roll20.net/Script:Change_Token_Image ChangeTokenImage.js] can change the image, TokenSync can synchronize the change.<br />
<br />
=== API scripts ===<br />
Because API scripts making changes to a token doesn't result in change events, TokenSync won't automatically synchronize any token changes caused by an API script. To get around this, there are two options.<br />
* Manually force a sync event by calling "!tokensync --forcesync".<br />
* Update the API script to call an update ("tok" is token object with the updated properties, "property" is the property to synchronize; you can synchronize multiple properties by separating them with vertical bars):<br /><br /><br />
:if (!_.isUndefined(TokenSync))<br /><br />
::TokenSync.syncProperty(tok, property);<br /><br />
Since this checks to see if TokenSync is defined, it's safe to call this in other scripts, even if the user isn't using TokenSync.<br />
<br />
=== Changelog ===<br />
{{changelog version|1.6|2016-03-20|* More optimizations, courtesy of The Aaron}}<br />
{{changelog version|1.5|2016-03-17|* Refactored schema to simplify code}}<br />
{{changelog version|1.1|2016-03-17|* Added syncing new tokens, sync on represents change, remove deleted characters}}<br />
{{changelog version|1.0|2016-03-16|* Release}}</div>92730