Script:Slide Tokens
From Roll20 Wiki
Version: 1.0
Last Modified: 2015-02-21
Code: Slide Tokens
Dependencies: IsGM, splitArgs
Conflicts: None
Slide Tokens allows for moving tokens around the map with an API command, hitting waypoints as though the token had been dragged and the spacebar had been hit during the movement.
Syntax
!movetok <args>
!mode [mode]Formally:
S
→ !movetokmovelist
S
→ !modemode
mode
→ ε
mode
→ string
movelist
→ ε
movelist
→move
movelist
move
→direction
coordinates
direction
→ ε
direction
→ string:
coordinates
→ float
coordinates
→ float,float
Parameter | Values |
---|---|
mode | Optional. Set the coordinate mode for the !movetok command. If this parameter is an invalid value or omitted, the current mode will be whispered back. There are three valid values, each of which has several aliases (all case insensitive):
|
args | A space-separated list of position arguments. Each argument is in the form [direction:]coordinate[,coordinate] .
The directions "top", "right", "bottom", and "left" will all ignore the second coordinate if it is supplied. All of the other directions will treat the second coordinate as 0 if it is not supplied. A positive coordinate given for left directions will move the token to the right, and a positive coordinate given for top directions will move the token down; this may be unintuitive, and so using the "x" and "y" aliases is recommended. The right and bottom directions will move the token in the opposite direction to left and top if given the same coordinate values. |
The !mode
command may only be executed by a GM, but !movetok
may be used by anyone. However, !movetok
will only work with tokens you can select, meaning you must have control over it or be a GM.
Notes
As of version 1.0, the path displayed to everyone showing the waypoints the token moves is shrunk to the size of one unit (70x70 px, or one grid square with default settings) and move to the top-left corner of the GM layer for manual cleanup. A future version will remove these leftover paths automatically, as that ability is currently in testing on the development server.
Changelog
v1.0 (2015-01-08)
- Release