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

Can someone Help with a SpinTokens Macro for a token on the map layer?

1663273851
Adam F.
Pro
Marketplace Creator
Hello, I'm trying to use TheAron's SpinTokens script to rotate a token on my map layer. I wanted to have a macro button to start and stop the spinning as needed, but it doesn't seem to be working for me. I got the token ID and created my macro like this: !spin-start [90] [--ids | -NC1fn0uJjrC1PD6HPYG] But when I click the macro, I only see the help in the chatlog and the token doesn't spin. It works fine for a selected token, but I designed a map where the spinning token is behind another token so I can't select the token directly easily I'm sure I made a dumb mistake somewhere
1663288097
Pad the spinning token out with transparent space and you will be able to select it around the token stacked above it.
1663292549
timmaugh
Pro
API Scripter
Without looking at the code (just going off what I know of Aaron's style), I would bet that the space after --ids is the problem. The script is likely looking for "ids|foo" and splitting on the '|', then comparing what's on the left. It knows what to do with "ids", but would treat "ids " as something else.
1663293416

Edited 1663294061
Oosh
Sheet Author
Where did you get that command line from? If it's this script , you just want !spin-start 90 as per the examples in the thread. Square brackets are generally used in documentation to indicate an optional parameter or something to be inserted, much like <insert text here> means you replace that who thing, including the "<" and ">". So get rid of those. It doesn't look like the script supports supplying ids either, it just runs on the selected tokens. so get rid of the whole --ids thing as well, that's a TokenMod command.
1663297801
timmaugh
Pro
API Scripter
Oosh said: Where did you get that command line from? If it's this script , you just want !spin-start 90 as per the examples in the thread. Square brackets are generally used in documentation to indicate an optional parameter or something to be inserted, much like <insert text here> means you replace that who thing, including the "<" and ">". So get rid of those. It doesn't look like the script supports supplying ids either, it just runs on the selected tokens. so get rid of the whole --ids thing as well, that's a TokenMod command. Or that. Let's go with that. Helps if we read the documentation, apparently.
1663331414
Adam F.
Pro
Marketplace Creator
I was trying to hit the specific token using it's Token ID, but I was just making it too complicated. I think once the token starts spinning it never stops, haha. I ended up just starting the token spinning and then moving the scenery on top of it before bringing the players over. Was much simpler that way. Check out my resulting map, I think it's pretty great. It's the Well of Dragons where my campaign is fighting Tiamat for the finale <a href="https://www.screencast.com/t/K1p0ujrRqVs" rel="nofollow">https://www.screencast.com/t/K1p0ujrRqVs</a>
1663334430
David M.
Pro
API Scripter
Oosh said: &lt;snip&gt; It doesn't look like the script supports supplying ids either, it just runs on the selected tokens. so get rid of the whole --ids thing as well, that's a TokenMod command. I know it's too late, but for future reference it looks like --ids **is** supported, though? &nbsp;I'd try removing the vertical pipe as Tim suggested. Here's the part that parses the ids. Splitting on spaces, not pipes. let cmds = a.split(/\s+/); switch(cmds[0]){ case 'ids': ids = [...new Set([ ...ids, ...cmds.slice(1) ])]; break; ...etc
1663338400

Edited 1663338486
timmaugh
Pro
API Scripter
Also, for future-future reference, if a script doesn't support an --ids &nbsp; -type argument and only works on the tokens you have selected, that's exactly where SelectManager can come in handy... letting you virtually select the tokens without having to actually locate them on the board: !spin-start 90 {&amp;select -NC1fn0uJjrC1PD6HPYG} !spin-start 90 {&amp;select Hank} !spin-start 90 {&amp;select Bahbee} !spin-start 90 {&amp;select @{target|Target|token_id}}