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

SpinToken - Clock Function

1609388827

Edited 1609388907
Styx
Pro
Hello, First off, I'm trying to implement a neat trick suggested by The Aaron using his SpinToken API - his work is amazing! Second, I could be reaching too far or just missing a step, but I'm trying to create a couple of macros that Start/Pause the clock. My clock uses 4 tokens linked to character sheets. The Clock face is on the Map layer. Each of the Second/Minute/Hour hands are on the Token layer. If it works, I'll likely move all tokens to the map layer. I've set up macros to start each hand spinning using The Aaron's code:  Found Here . However, I'm trying to always call the same Token/Character (tried both token_id and character_id) to ensure I don't need to try and select overlapping tokens on the map.  Example, where MPqkjgydHgmfsRbzFv2 is the character_id of the Hour Hand token: I've then got a nested macro for calling all of these as a way to "Start Clock". While I can seem to activate the spinning of a single token on a click, it applies to the selected token as if I've used @{selected|token_id} and not a specific token_id or character_id. Again, I may be reaching, but I thought I'd ask if I'm missing something critical to make this work or if it's not possible without physically selecting/targeting each token.
1609392293

Edited 1609392632
Oosh
Sheet Author
API Scripter
Those id's should start with a - Without inspecting Aaron's code, it looks like it might default to the selected token if it doesn't find a valid --id .... unless his command line does actually compensate for the missing "-" that is. Anyways, try again with - MPqkjgydHgmfsRbzFv2 and see if you have any luck. Side note - double clicking on a UUID in the chat log won't select the hyphen, which is upsetting. The different behaviour of the double-click between Roll20, Notepad and VS Code drives me bananas at times (does the Aaron have a script for that?)
1609397296
The Aaron
Roll20 Production Team
API Scripter
If I remember correctly, SpinTokens only operates on selected tokens, but it wouldn't be too hard to change that. Another issue is that it based the current rotation off the time, so unpausing just would make it jump ahead to where it would have been if it kept running. That's a bit harder to fix. 
Oosh said: Those id's should start with a - Without inspecting Aaron's code, it looks like it might default to the selected token if it doesn't find a valid --id .... unless his command line does actually compensate for the missing "-" that is. Anyways, try again with - MPqkjgydHgmfsRbzFv2 and see if you have any luck. Side note - double clicking on a UUID in the chat log won't select the hyphen, which is upsetting. The different behaviour of the double-click between Roll20, Notepad and VS Code drives me bananas at times (does the Aaron have a script for that?) Just tried the "-" prefix but sadly no. The Aaron said: If I remember correctly, SpinTokens only operates on selected tokens, but it wouldn't be too hard to change that. Another issue is that it based the current rotation off the time, so unpausing just would make it jump ahead to where it would have been if it kept running. That's a bit harder to fix.  Ah, makes sense. The pausing side wasn't a big deal, can still take note of the in-game "clock time" when a session starts to determine day rotation (especially given no sunlight in ROTF). I was probably going to increase the spin rotation to a 6th of the current setup, basically to try and simulate our 4hr session into in-game time.
And here is the working clock on my Map Layer. At stated before, I've used a 6th of the previous spin length's to simulate 4hrs of an IRL day SpinToken Clock in Action GIF version