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

API scripts crossover

So I just started using the Extended Expressions script to read the selected tokens "bar 2" which is linked to the AC on a connected character sheet. This way I don't have to constantly ask my players their AC. Its great for rolling single attacks and the such. But I was wondering if it was possible to combine it with the Token Mod Script to let it automatically adjust the value of "bar 1" which is connected to the character's HP.
1466927709

Edited 1466927760
Silvyre
Forum Champion
TokenMod can certainly adjust the values of Token Bars. Could you elaborate on your use case? Maybe post an example of one of the macros you're using with Extended Expressions?
1466928218

Edited 1466948726
Right now I'm using a modified version of one of the examples !extend Attack Roll: `(1d20+?{hit|0})[tohit]`, `(${tohit}>=@{selected|bar2} ? "hits for [[?{dice|1}d?{size|6}+?{extra|0}]]" : "miss")` I want to use the value created after "hits for" and use it in a token mod command if it's possible at all.
1467013659
Silvyre
Forum Champion
I infer (after some testing) that TokenMod won't be able to be activated by another API Script without coding in such a capacity to TokenMod. As a workaround, I recommend having ExtendedExpressions construct API Command Buttons , e.g. !extend Attack Roll: `(1d20+?{tohit|0})[tohit]`, `(${tohit}>=@{selected|bar2} ? "hits for [" + (?{dice|1}d?{size|6}+?{extra|0})[dmg] + " damage" + "](!token-mod --set bar1|-" + ${dmg} + ")" : "miss")`
That's some pretty nifty stuff right there. Hopefully the creator of TokenMod sees this and can add the necessary stuff, but until then this will work well. 
1467058474
Lithl
Pro
Sheet Author
API Scripter
I vaguely recall that he's (The Aaron) in the process of a move, so that's probably diverting his attention from Roll20 for a little bit assuming I'm not remembering incorrectly. It looks like his last post was 3 days ago.
1467210346
The Aaron
Pro
API Scripter
You are correct.  It's a busy summer. =(   I'm hoping by august to be in a new home in Indiana.  This last couple of weeks I've scarcely even made it onto the site.  Don't be afraid to PM me though if you run into anything you need.  I'll try to work through the backlog of PMs as I get time (33 reduced to 4 this morning!).