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

Macro - Roll attribute for active character

It's easy to see how I can create a macro that rolls the strength for a particular character: "/roll 2d6+@{Bob|Str} Str" But I would LOVE to be able to create a macro that rolls whatever character is currently active, or assigned to the player. Something like "/roll 2d6+@{Current|Str} Str" - Where "Current" is whatever player I as the GM have active, or the player is "assigned".  Is there any way to do this? Would it be hard to add? Heck I'll add it myself if you give me access to the source code. ;D
1368733404
Gauss
Forum Champion
Currently there is no way to do that. However, it might be able to be done in the API. I would ask the API forum about it.  - Gauss
1368739278
Konrad J.
Pro
API Scripter
At the moment there is no easy way to know what the currently selected token is via the API.  I wish we could.  THere are some work arounds, but a bit kludgie. But you could make an API command for the chat window that takes your dice roll plus a token character name.  So it would be something like... !roll dice command character name.  Then the API would fill in the proper character name and then roll that right dice in the chat window.  This way you sort of have the ability of a variable in a macro.  You can change the command to have any character name you type.