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

Using the ruler in a macro?

I had an idea that it might be nice to be able to use the ruler in a macro, something like this: ~{<measurement title>, @{selected}, @{target}} And it would output the distance using your games ruler settings.  Is this possible?
March 02 (8 years ago)
Gen Kitty
Forum Champion
If something like this is possible, it would require the use of API, which is a Pro subscription level perk.  I'll bounce this over to API and see what the scriptomancers have to say on the subject :)
March 02 (8 years ago)
The Aaron
Pro
API Scripter
I have a measure script that does pretty much exactly that. 
shareable? :)
March 04 (8 years ago)
The Aaron
Pro
API Scripter
https://github.com/shdwjk/Roll20API/blob/master/Me...

Select 2 or more tokens and issue either of the following commands:
!wmeasure

!measure
(The w version whispers to the player issuing the command)

You'll get a list of distances (in map units) between the selected tokens.

Hey The Aaron, any chance this could be used by a "target" instead of "selected"?  It would love to implement this into my macros.  A player typically doesn't have the ability to select tokens except his own.  This works great for a DM by the way.  I like the output.

Thanks
March 04 (8 years ago)
The Aaron
Pro
API Scripter
It actually already does work with target. =D
!measure @{target|first|token_id} @{target|second|token_id} @{target|third|token_id}
Just supply all the token ids as arguments to the command. =D
March 04 (8 years ago)

Edited March 04 (8 years ago)
ohhh, I think my players would like that as well.  (I'm just posting this so that it shows in my list of following as I don't know how to find these posts later.)