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 access to Ruler Tool

Is there api access to the ruler tool? I'm trying to script a token macro for missile attacks and spells.  I want the button to be pressed and a query for a target, but while the player is selecting the target I want the ruler took UI to show distance from his token to the cursor. Ideally, I could pose a query to the ruler tool and confirm this distance and see what's a valid (in range) target.

March 17 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

The API has no access to the UI.

If you want an API that does measuring, I have this one: https://github.com/shdwjk/Roll20API/blob/master/Measure/Measure.js  It doesn't display a visual, just outputs a table of distances.

March 17 (5 years ago)

Edited March 17 (5 years ago)


The Aaron said:

The API has no access to the UI.

If you want an API that does measuring, I have this one: https://github.com/shdwjk/Roll20API/blob/master/Measure/Measure.js  It doesn't display a visual, just outputs a table of distances.


Ok. I figured out a work around. I'll just have the tokens in range display a small aura with a color to match their range classification. I saw somebody put out a script to make an aura gradually shrink so maybe I'll make it pulsate.   


Ty for the info.


Ty for being so active on the forums Aaron! Seeing your face on another thread just gave me an idea for an script to set max movement distances lol

March 17 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

nice!  Happy to help with my code or my visage. =D

March 17 (5 years ago)
The Aaron
Roll20 Production Team
API Scripter

Here's a few links that might spur some ideas: