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

How do I branch a macro based on a characters attribute?

I'm trying to ease my burden as a GM in The One Rine, by writing some token-specific macros. I would love it if there was a way for me to read an attribute on the token's character sheet (whether the character is weary in this case) and based on what the macro is, branch the logic. I was told I probably needed the API to do this. Here's the macro for good measure: /em @{selected|token_name} swings against @{target|token_name} vs TN [[@{selected|Stance}+@{target|bar3}]] /r 1t[feat] + @{selected|Attack}t[normal] > [[@{selected|Stance}+@{target|bar3}]]
1398649448
Lithl
Pro
Sheet Author
API Scripter
What exactly is it you're trying to achieve? I don't see anything wrong with your macro at a glance.
1398651404

Edited 1398651478
Michael H
Sheet Author
I want to check against the TN (Target Number), and whether I beat it or not, and display messages based on that, and then how many 6's the D6s roll (I've written the script for that part on its own). I guess I can find the `>` in the roll and check the TN in the script that way?
1398660530
Lithl
Pro
Sheet Author
API Scripter
Ah; if you're using a script, you can simply check the final result of the roll, which should be 1 if you beat the target number, or 0 if you didn't.
Yeah, except the `&gt;` doesn't work as expected in this macro. I ended up writing my first script to fix it though: <a href="https://gist.github.com/Heilemann/11360851" rel="nofollow">https://gist.github.com/Heilemann/11360851</a>