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

API Script Help Request: Monitor a token bar and alert via chat on changes

I have my PC and NPC sheets set to calculate encumbrance and set their speed in the @{speed} attribute. @{speed} is then linked to Bar 1 on tokens. I was wondering if there is an existing API script that can do the following (or something close to it): Monitor selected tokens and if Bar 1 changes, send a whisper to the GM, and to the owning player (if any) that says something like "Speed for @{token_name} has changed to X" If there is no existing script, any pointers to how I would do this? Thanks in advance for any advice or suggestions!
1509005458

Edited 1509005692
Bast L.
API Scripter
Heya. I didn't test this much, but it used something from my rooftop script, so it seemed like it would be easy. However, due to my inability to understand error logs, it was slightly difficult. Anyways, the way it works is, if bar 1 (green bar) changes value on a token, then if that token is directly assigned, or if it represents a character which is assigned, the script will report the change to the token owners and to the gm.&nbsp; I haven't tested: multiple owners of the token. I'd need someone else in the game to check, or maybe just modify the script, but that sounds like too much effort for me. Here's the gist:&nbsp; <a href="https://gist.github.com/Bastlifa/5ce152f54c899c639" rel="nofollow">https://gist.github.com/Bastlifa/5ce152f54c899c639</a>...
Works like a charm! And I don't even have to select the tokens - it just automatically monitors them all.&nbsp;Wonderful! Many, many thanks, Bast! :-)
Glad it works :)&nbsp;