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

Targeting Token Bars

September 27 (4 years ago)

I'm trying to create a macro to reveal information.  These "clues" are stored in the item's token bars. Currently when I I target @{target|bar1} is successfully pulls the information in that bar and shows it in the macro. However I can't get it to do the same for @{target|bar1_max} or @{target|bar1|max}.

Any suggestions?

September 27 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

That is weird. @{selected|bar1|max} works but  @{target|bar1|max} doesn't.

September 27 (4 years ago)

Edited September 27 (4 years ago)

Is it having an issue with thinking that the bar1 in the second one is a label?

Like you can create a macro that works with the same target multiple times if you create a label for it and repeat the label.

@{target|attacked|ac}  @{target|attacked|token_name} is hit

and you only have to target the opponent once.


EDIT: Tested it, and yes, that's the problem. Add a label in there like @{target|info|bar1|max}

September 27 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

OK, that makes sense. I should have remembered.

September 27 (4 years ago)

Not sure what all the words meant,  but I'll give it a try. 

September 27 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

This wiki link explains it in a bit more detail.

September 28 (4 years ago)

Don't need detail or explanation lol. Just needed to know what to write.  It works now. Thanks everyone.