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

[HELP] API questions after site update

!power --tokenid|@{selected|token_id} --emote|You can dig into your resolve and endurance to find an extra burst of vitality.  {{ --format|encounter --name|Second Wind --leftsub|Encounter --rightsub|Standard Action --Effect|Regain [[floor(@{hp|max}/4)]] hit points. Gain [[2]] to all defenses until the start of my next turn }} After using the above powercard. I get this error /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v                                                                     ^ SyntaxError: Expected "[" or [ |\t] but "f" found. It worked before the site update but now only get this error. I also get the same error when I try these two powercards !power --tokenid|@{selected|token_id} --emote|Sacred light shines from above, searing a single enemy with its radiance while at the same time aiding an ally with its beneficent power {{ --format|atwill --name|Sacred Flame --leftsub|At-Will --rightsub|Standard Action ^^Ranged 5 --Attack|[[ [$Atk] 1d20 + @{wisdom-mod} [Wisdom Mod] + @{weapon-1-total-attack} + ?{Other Bonuses to Hit|0}]] vs  @{target|token_name} Reflex --?? $Atk.base == 1 ?? !CritFail:|Critical Failure --?? $Atk.total < [[@{target|Ref}]] ?? !Miss:|You miss --?? $Atk.total >= [[@{target|Ref}]] AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [NH] 1d6 + @{weapon-1-total-damage} + @{wisdom-mod} + ?{Add Bonus Damage|0}]] radiant damage --?? $Atk.base == 20 ?? Critical Hit:|[[1d6 + @{weapon-1-total-damage} + @{wisdom-mod} + ?{Add Bonus Damage|0}]] radiant damage --Effect|One ally you can see chooses either to gain [[floor(@{wisdom-mod} + @{level}/2)]] temporary hit points or to make a saving throw. }} AND !power --tokenid|@{selected|token_id} --emote|When an enemy drops its guard, your spirit companion leaps on it, claws and fangs bared. {{ --format|atwill --name|Protecting Strike --leftsub|At-Will --rightsub|Opportunity Attack ^^Spirit Melee^^Spirit, Primal --Attack|[[ [$Atk] 1d20 + @{wisdom-mod} [Wisdom Mod] + @{weapon-3-total-attack} + ?{Add Bonus Attack|0}]] vs **@{target|token_name}** Will --?? $Atk.base == 1 ?? !CritFail:|Critical Failure --?? $Atk.total < [[@{target|Will}]] ?? !Miss:|You missed. --?? $Atk.total >= [[@{target|Will}]] AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[d@{weapon-3-dice} + @{wisdom-mod} + @{weapon-3-total-damage} + ?{Add Bonus Damage|0}]] damage. Each ally adjacent to your spirit companion gains [[@{constitution-mod}]] temporary hit points --?? $Atk.base == 20 ?? Critical Hit:|[[1*@{weapon-3-dice} + @{weapon-3-total-damage} + @{dexterity-mod}]] damage. Each ally adjacent to your spirit companion gains [[@{constitution-mod}]] temporary hit points }} If I get rid of the inline roll that calls to a stat, then the power card works. I don't know whats going on. My other old powercards work but not these two. That don't call to a stat that is not in an $Atk part of the powercard. Any help or suggestions would be awesome. Thanks Ryeaa
1437932104

Edited 1437932146
This was fixed with the most recent update to PowerCards, ver 3.2.8 that you can find here: gist.github.com/Sky-Captain-13/452330a3d926b32da49c Although there is an error with emotes that TheAaron found a fix for. I just need to plug it in and update the gist later.
1437937813
The Aaron
Pro
API Scripter
BTW, the emote error is purely display related and won't crash the API.
I updated the powercards again. Just logged in and used this macro !power --tokenid|@{selected|token_id} --emote|Sacred light shines from above, searing a single enemy with its radiance while at the same time aiding an ally with its beneficent power {{ --format|atwill --name|Sacred Flame --leftsub|At-Will --rightsub|Standard Action ^^Ranged 5 --Attack|[[ [$Atk] 1d20 + @{wisdom-mod} [Wisdom Mod] + @{weapon-1-total-attack} + ?{Other Bonuses to Hit|0}]] vs  @{target|token_name} Reflex --?? $Atk.base == 1 ?? !CritFail:|Critical Failure --?? $Atk.total < [[@{target|Ref}]] ?? !Miss:|You miss --?? $Atk.total >= [[@{target|Ref}]] AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [NH] 1d6 + @{weapon-1-total-damage} + @{wisdom-mod} + ?{Add Bonus Damage|0}]] radiant damage --?? $Atk.base == 20 ?? Critical Hit:|[[1d6 + @{weapon-1-total-damage} + @{wisdom-mod} + ?{Add Bonus Damage|0}]] radiant damage --Effect|One ally you can see chooses either to gain [[floor(@{wisdom-mod} + @{level}/2)]] temporary hit points or to make a saving throw. }} I got this error API sandbox shutdown due to campaign inactivity. Restarting sandbox due to script changes... Spinning up new sandbox... Spinning up new sandbox... "-=> TokenNameNumber v0.5.2 <=-  [Tue May 05 2015 18:57:44 GMT-0500 (CDT)]" "(16:10) PowerCards version 3.2.8 loaded. Last updated: July 23rd, 2015 ~ 12:45 am" "-=> TokenMod v0.8.8 <=-  [Wed Jul 01 2015 00:22:49 GMT-0500 (CDT)]" "-=> Torch v0.8.3 <=-  [Tue May 05 2015 07:41:50 GMT-0500 (CDT)]" /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v                                                                     ^ SyntaxError: Expected "[" or [ |\t] but "f" found. If I delete [[floor(@{wisdom-mod} + @{level}/2)]] out of the macro, it works. Why would [[floor(@{wisdom-mod} + @{level}/2)]] crash the API? Thanks Ryeaa
1437941931

Edited 1437942307
I just tried putting just [[@{wisdom-mod}]] in and got the same error, so I tried putting this instead [[1d0 + @{wisdom-mod}]] and it worked......???? Edit: I also noticed that when I mouse over the roll result in the chat window. It is auto "floor" the roll.
1437946131
The Aaron
Pro
API Scripter
There is a bug in sendChat where it doesn't like a space after the [[ except for when the next character is a [.  I'll update the line 63 to fix this one too.
1437946463
The Aaron
Pro
API Scripter
If you change line 63 to this it should work for everything: msg.content = msg.content.replace("$[[" + Count + "]]", ("[[" + msg.inlinerolls[Count].expression + " ]]").replace(/\[\[\[/g, "[[ ["));
Thank you Aaron. Your the man. Ryeaa