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

Trying to create a Macro that gives me quick access to a selected token's attribute.

Hey all, Using the Pathfinder sheet, I'm trying to make a macro that allows me to do a quick check of a selected token's AC, Touch and Flat Footed. I put this together: /w gm @{selected|character_name}'s AC is: @{selected|AC}, (Touch: @{selected|Touch}, and Flat Footed: @{selected|Flat-Footed} ) But that outputs this: (To GM): Thaine Morthos's AC is: (10 + (4 1) + (1 1) + (((((floor((14 + 0 + 0 +0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) + 9999) - abs(((floor((14 + 0 + 0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) - 9999)) / 2) + 0 + 0 + 2 + 0 + 0 + 0 + 0 - 0 - 0 - 0 - 0 - 0), (Touch: (10 + (((((floor((14 + 0 + 0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) + 9999) - abs(((floor((14 + 0 + 0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) - 9999)) / 2) + 0 + 0 + 0 + 0 + 0 + 0 - 0 - 0 - 0 - 0 - 0), and Flat Footed: (10 + (4 1) + (1 1) + (((((((floor((14 + 0 +0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) + 9999) - abs(((floor((14 + 0 + 0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) - 9999)) / 2) - abs((((((floor((14 + 0 + 0 +0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) + 9999) - abs(((floor((14 + 0 + 0 + 0)/2)-5) + floor(0/2) - (floor(abs(0)/2)) - (floor(abs(0)/2)) - 0 - 0 -0) - 9999)) / 2)))/2) + 0 + 2 + 0 + 0 + 0 + 0 - 0 - 0 - 0 - 0 - 0) ) How can I build the macro to display the value? I have PCs that use bucklers and shields, and sometimes unequip them, so using the macro is a quick way tto check it.
1436578273

Edited 1436578534
I think I figured out my issue, this way: /w gm @{selected|character_name}'s AC is: [[1d1-1+@{selected|AC}]], (Touch: [[1d1-1+@{selected|Touch]]}, and Flat Footed: [[1d1-1+@{selected|Flat-Footed}]] ) It's displaying the touch AC as 1, which isn't right. I should make sure I'm looking at the right character sheet before I say that.
You should be able to drop the 1d1-1 part from the macro entirely... roll20's roll system is capable of math-only rolls as well. /w gm @{selected|character_name}'s AC is: [[@{selected|AC}]], (Touch: [[@{selected|Touch]]}, and Flat Footed: [[@{selected|Flat-Footed}]] )
Ok. I guess my issue was that I wasn't including the brackets. Thanks.
1436619850
Ziechael
Forum Champion
Sheet Author
API Scripter
Chell said: You should be able to drop the 1d1-1 part from the macro entirely... roll20's roll system is capable of math-only rolls as well. /w gm @{selected|character_name}'s AC is: [[@{selected|AC}]], (Touch: [[@{selected|Touch]]}, and Flat Footed: [[@{selected|Flat-Footed}]] ) Just as a point of note (although i'm sure you've spotted it) your touch call has some brackets out of order, highlighted below: /w gm @{selected|character_name}'s AC is: [[@{selected|AC}]], (Touch: [[@{selected|Touch }]] , and Flat Footed: [[@{selected|Flat-Footed}]] )
LOL. I did after 20 minutes of debugging that last piece.
1436640117
Ziechael
Forum Champion
Sheet Author
API Scripter
Sorry I was late to the party, but at least you got there in the end... trust me, it's not a mistake you make twice ;) source: bitter experience!