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

Is there a way to get a stat from a character after a query has happened in a macro?

I am trying to list attribute was rolled as I roll it through an ability roll like so:

Rolling @{?{Attribute|STR|DEX|INT|WIS}}d10 ?{Attribute} dice

to make something that's says in chat

"Rolling 4d10 WIS dice" 

I could go "?{Attribute|WIS, @{WIS}}" but I want to re-use the name of the stat later in the macro.

Is this possible?
January 31 (7 years ago)

Edited January 31 (7 years ago)
@{?{Attribute|STR|DEX|INT|WIS}}d10 [{?{Attribute|STR|DEX|INT|WIS}]    so this?  in order to get the 4 though u had u have 2 different queries as roll20  wont let u have minor changes to a query
January 31 (7 years ago)

Edited January 31 (7 years ago)
From what I gather, that isn't possible.
First off, a simpler solution: https://pastebin.com/raw/nPNBNAS2

Now if you really wanted to just reuse the queried value, you should know @{attributes} are converted directly into their relevant attribute entries before anything else happens, so if you try running a query on a portion of an attribute name you'll just break the attribute call entirely.
In order to get @{?{Stat}} to parse how you want you'll need to do some weird stuff and send it to an API command button, like so: https://pastebin.com/raw/iPekYY00

Have to escape the @ as @ in the first macro so it doesn't try to read it as an attribute yet, letting it get converted to a real @ on the API button that will reference the stat in question.