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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 ~ Now contains logic!™

ERROR evalmachine. :490 if (_.isEmpty(Tok)) TrackerName = Char.get("name"); ^ TypeError: Cannot call method 'get' of undefined at evalmachine. :490:56 at Array.forEach (native) at buildInline (evalmachine. :477:30) at evalmachine. :419:66 at Array.forEach (native) at evalmachine. :416:43 at checkFinishedOps ( IN CHAT BOX ERROR No character was found for 'character_id' CODE !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --charid|@{character_id} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }}
May 29th, 2015 ~ 1:10 pm eastern Version: 3.1.2 Bugfix: Single value inline rolls like [[5]] will not crash the script anymore.
1432919559

Edited 1432919866
Master MJ said: ERROR evalmachine.:490 if (_.isEmpty(Tok)) TrackerName = Char.get("name"); ^ TypeError: Cannot call method 'get' of undefined at evalmachine.:490:56 at Array.forEach (native) at buildInline (evalmachine.:477:30) at evalmachine.:419:66 at Array.forEach (native) at evalmachine.:416:43 at checkFinishedOps ( IN CHAT BOX ERROR No character was found for 'character_id' CODE !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --charid|@{character_id} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} If this is for monsters without a character sheet, you need to use --tokenid|@{selected|token_id} instead. I also added a check for Char being undefined so that using the wrong ID won't crash the script. It didn't make it into 3.1.2, but it'll be there when I update the script next time.
HoneyBadger said: Master MJ said: ERROR evalmachine.:490 if (_.isEmpty(Tok)) TrackerName = Char.get("name"); ^ TypeError: Cannot call method 'get' of undefined at evalmachine.:490:56 at Array.forEach (native) at buildInline (evalmachine.:477:30) at evalmachine.:419:66 at Array.forEach (native) at evalmachine.:416:43 at checkFinishedOps ( IN CHAT BOX ERROR No character was found for 'character_id' CODE !power {{ --bgcolor|@{selected|ColorCode} --txcolor|#ffffff --name|INITIATIVE --charid|@{character_id} --!Roll|[[ [trkr] 1d20+@{selected|INITIATIVE}]] Initiative Turn }} If this is for monsters without a character sheet, you need to use --tokenid|@{selected|token_id} instead. What about for a monster with a character sheet?
Master MJ said: HoneyBadger said: If this is for monsters without a character sheet, you need to use --tokenid|@{selected|token_id} instead. What about for a monster with a character sheet? The token needs to be representing the character sheet.
HoneyBadger said: The token needs to be representing the character sheet. Gotcha, let me do some coding on the marco and see how it goes.
HoneyBadger said: @Robert: Yeah, if you want to hide the full mess of numbers... you'll need to wrap them in a nested inline roll as below: --Attack|[[ [$Atk|XPND] 1d20 + [[@{Level} + @{STRMOD} + @{MeleeMagicAtkBonus} + @{TempAtkBonus} + @{tracker|Escalation Die} ]] ]] Awesome, that works. Thank you.
1432921063

Edited 1432921089
Everything up and working here too. No API crashes. GREAT JOB JB!!
Master MJ said: HoneyBadger said: The token needs to be representing the character sheet. Gotcha, let me do some coding on the marco and see how it goes. I'm sure the code for initiative needs re-working... but here's how it is supposed to work: First... determine if the ID is for a (C) haracter or a (T) oken. This is done by checking for id's from the --charid and --tokenid tags in the macro. If a token id is used, the script simply uses that. If a character id is used, the script checks for a token representing that character first... And then falls back to the character sheet name if it can't find a token. If it doesn't have a token or character sheet id... it uses the player's Display Name. // ADD TOKEN OR CHARACTER OR DISPLAY NAME TO TURN ORDER TRACKER... var TrackerName = ""; if (TrackerID.charAt(0) === "C") { var Char = getObj("character", TrackerID.substring(2)); var Tok = findObjs({ type: 'graphic', pageid: Campaign().get("playerpageid"), represents: TrackerID.substring(2) }); if (_.isEmpty(Tok) && Char !== undefined) TrackerName = Char.get("name"); else TrackerID = Tok[0].id; } else if (TrackerID.charAt(0) === "T") TrackerID = TrackerID.substring(2); else TrackerName = who;
Robert M. said: HoneyBadger said: @Robert: Yeah, if you want to hide the full mess of numbers... you'll need to wrap them in a nested inline roll as below: --Attack|[[ [$Atk|XPND] 1d20 + [[@{Level} + @{STRMOD} + @{MeleeMagicAtkBonus} + @{TempAtkBonus} + @{tracker|Escalation Die} ]] ]] Awesome, that works. Thank you. This is actually a better way to do expanded rolls... because the way I was doing them before was a kludge and totally ignored order of operations. Nesting inline rolls and making Roll20 do the math is so much easier on me. :)
I was actually able to narrow down the issue I am having. I AM able to use two variables in the PC but when I try to use them both in a comparison I get an error. OK here is a better representation of what I was attempting that produced an error: !power {{ --format|recharge --name| This is a test macro --leftsub| ignore it --rightsub| for now --Var1| [[ [$var1] 1d20 ]] --Var2| [[ [$var2] 1d20 ]] --?? $var2 total < $var1 total ?? Sum| second roll was less than first --?? $var2 total > $var1 total ?? Sum| second roll was greater than first --?? $var2 total == $var1 total ?? Sum| second roll was equal to first }} Generates the following: (From ERROR): No information for the target number can found. Please check your macro and make sure that the targeted attribute is present on the token or character you are targeting. Is there a correct way to compare two variables?
I think that functionality is planned but not yet worked out, if I'm reading the "Honeydew List" right.
Robert M. said: I think that functionality is planned but not yet worked out, if I'm reading the "Honeydew List" right. Correct... though using a previous roll as a target number is actually easier to do than the other stuff I have planned. So I'll work on that and hopefully have something in the morning. Gotta go to work now.
1432937571
Gen Kitty
Forum Champion
New fun bug! Powercards gets downright snippy if you do --Name| instead of --name| :> Name vs name This is more a PSA than a bug fix request.
HoneyBadger said: Robert M. said: I think that functionality is planned but not yet worked out, if I'm reading the "Honeydew List" right. Correct... though using a previous roll as a target number is actually easier to do than the other stuff I have planned. So I'll work on that and hopefully have something in the morning. Gotta go to work now. Ah, ok then at least I know I am not doing it wrong then. I was really more interested in making sure I was using correct syntax than anything else. Thanks
1432985087

Edited 1432985484
Phoenix
Elite
Yeah I'm really looking forward to being able to reference other rolls in the macro. Lets me put critical and autohit notifications into it which I've been dying to do. Thanks in advance because this is really going to make things smoother going forward. Also I have a question about the conditionals. I've been reading them but it's like 4am and I'm still not sure on something. Would it be possible to compare a conditional against two separate numbers and check if it's equal to both of them, not just one or the other? EDIT: Okay I just reread it and you mentioned stacking them toward the end. Tried it and it works nicely. I just need to be able to reference rolls next instead of being psychic :) Thanks for putting so much documentation along with this. You really managed to take care of most of my questions ahead of time.
GenKitty said: New fun bug! Powercards gets downright snippy if you do --Name| instead of --name| :> Name vs name This is more a PSA than a bug fix request. Yeah... not really worth the effort to fix.
Hate to do this... but I'm re-doing how conditionals work. In the long run, it makes it easier to do comparisons. Before: ?? $Roll base symbol target ?? After: ?? Value1 symbol Value2 ?? You'll add dot base or dot total after the value if you are referencing a Roll ID. Example: ?? $Atk1.base > $Atk2.base ?? Example: ?? $Atk1.total > $Atk2.total ??
Will your new conditionals take effect when you bring out your next update?
Yup. Updating the gist/thread now.
1433080500

Edited 1433080821
This update will break macros that use conditionals! May 31st, 2015 ~ 9:45 am eastern Version: 3.2.0 MAJOR UPDATE: How conditionals work have been changed and will break any macro using the old style of conditionals. Old Example: ?? $ID base|total symbol target ?? New Structure: ?? Left vs Right ?? New Example 1: ?? $Atk1.base == 20 ?? New Example 2: ?? $Atk.total > $Def.total ?? New Example 3: ?? $Atk.total >= @{target|AC} ??
Just fyi... right now you must use .base or .total if you use a roll id on either side of the conditional. If you don't, the value will return as undefined and the conditional will not work. I will fix this problem either tonight before work or when I get home tomorrow morning. I'm off to bed now. Have fun breaking macro's!
If anyone has already changed up their macros to the new format. I could use some help getting my macros to conform to the new system. Below is my basic attacks macro for 4E. !power --tokenid|@{selected|token_id} --emote|He resorts to the simple attack he learned when he first learned to fight, stabbing things. {{ --format|atwill --name|Melee Basic Attack --leftsub|At-Will --rightsub|Standard Action --Attack|[[ [$Atk] 1d20 + @{strength-mod} [Strength Mod] + @{weapon-1-prof} + ?{Other Bonuses to Hit|0}]] vs @{target|token_name} AC --?? $Atk base == 1 ?? !CritFail:|Critical Failure --?? $Atk total < [[@{target|AC}]] ?? !Miss:|You missed. --?? $Atk total >= [[@{target|AC}]] AND $Atk base <> 1 AND $Atk base <> 20 ?? Hit:|[[ [NH] d@{weapon-1-dice} + @{weapon-1-total-damage} + @{strength-mod} + ?{Add Bonus Damage|0}]] martial damage --?? $Atk base == 20 ?? Critical Hit:|[[1*@{weapon-1-dice} + @{weapon-1-total-damage} + @{strength-mod} + ?{Add Bonus Damage|0}]] martial damage }} The above macro works in the old version. I have been unsuccessful in being able to update it. Any help is appreciated. Thanks, Ryeaa
1433101938
Gen Kitty
Forum Champion
HoneyBadger said: Just fyi... right now you must use .base or .total if you use a roll id on either side of the conditional. Your referred-to-rolls are lacking a . Try this instead: !power {{ --tokenid|@{selected|token_id} --emote|CHARACTERNAME resorts to the simple attack he learned when he first learned to fight, stabbing things. --format|atwill --name|Melee Basic Attack --leftsub|At-Will --rightsub|Standard Action --Attack|[[ [$Atk] 1d20 + @{strength-mod} [Strength Mod] + @{weapon-1-prof} + ?{Other Bonuses to Hit|0}]] vs @{target|token_name} AC --?? $Atk.base == 1 ?? !CritFail:|Critical Failure --?? $Atk.total < [[@{target|AC}]] ?? !Miss:|You missed. --?? $Atk.total >= [[@{target|AC}]] AND $Atk base <> 1 AND $Atk base <> 20 ?? Hit:|[[ [NH] d@{weapon-1-dice} + @{weapon-1-total-damage} + @{strength-mod} + ?{Add Bonus Damage|0}]] martial damage --?? $Atk . base == 20 ?? Critical Hit:|[[1*@{weapon-1-dice} + @{weapon-1-total-damage} + @{strength-mod} + ?{Add Bonus Damage|0}]] martial damage }} Once you have that working, you can start on the more advanced logic so if you roll a 1 you don't check to see if you hit/missed. Also, query: What will you do when the day arrives, as it inevitably will, that you forget to include a bonus/penalty and thus an attack misses that should have hit? This scenario is one everyone should take into account when going with a 'only show damage if I hit' template/schema. :>
Yeah, that's why I really didn't want to put conditionals in... but gotta keep ahead of roll templates. :D
Getting Unexpected Token * The macros tested worked under the previous version (2.4.11) !power --format|encounter --name|Mantle of Glory --title|Cleric Attack 13 --usage|Encounter --action|Standard Action --emote|Whispering a prayer to your deity, you invoke a blast of radiant light from your holy symbol. Your foes burn in its glorious light, while your allies are fortified by it. --Range|Close blast 5 --Target(s)|Nine Targets --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id} --Attack#?{Number of targets|1}|[[1d20+20]] vs %%Will%% Will (%%token_name%%) --damage|[[ 2d10+10 ]] radiant damage. --Effect|Each ally in the blast can spend a healing surge.[[2d6+17]]
Macro works for me. You probably just need to re-save the script. Or check some others. Also, you can re-write your macro like this and --usage --action are no longer valid for macro's. Use --leftsub and --rightsub instead. !power {{ --format|encounter --name|Mantle of Glory --title|Cleric Attack 13 --leftsubEncounter --rightsub|Standard Action --emote|Whispering a prayer to your deity, you invoke a blast of radiant light from your holy symbol. Your foes burn in its glorious light, while your allies are fortified by it. --Range|Close blast 5 --Target(s)|Nine Targets --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id} --Attack#?{Number of targets|1}|[[1d20+20]] vs %%Will%% Will (%%token_name%%) --damage|[[ 2d10+10 ]] radiant damage. --Effect|Each ally in the blast can spend a healing surge.[[2d6+17]] }}
This was built by the Character Importer (Thanks again for that work!) I'll re save and try again
Found it. a "comment" in another script
Wait, is the character importer up-to-date? The last version I know of used deprecated tags. I guess since 3.0 has been up for 5 days, it's not, but is it updated for the last version of PowerCards 2?
The D&D 4e Importer I wrote has not been updated in ages.
Is it worth investigating bringing the Character and Monster importer up to V3 standards? Everything works, and it saves LOTS of time
I might. Just haven't had a need to since I've only been playing a 5e campaign lately. Wasn't playing anything online for a long time.... Since I started a new job last April (2014).
1433132500

Edited 1433132605
GenKitty Once you have that working, you can start on the more advanced logic so if you roll a 1 you don't check to see if you hit/missed. Also, query: What will you do when the day arrives, as it inevitably will, that you forget to include a bonus/penalty and thus an attack misses that should have hit? This scenario is one everyone should take into account when going with a 'only show damage if I hit' template/schema. :> While agreed, it will (and already has happened) during my campaign. Using the hit\miss logic of the attacks really sped up my groups play time. My macro does show both critical fail and miss in the same attack if a 1 is rolled, but so far, I like that for some reason. As far as more complicated logic goes, I am no scripter or java ninja. I am lucky I understand what's going on here, but thanks to the great examples provided. I am able to piece things together. With that being said. Thank you guys and girls who take the time to make these API and answer all the questions you do. Take a bow. Thanks, Ryeaa
1433144292

Edited 1433161259
Here's a working version of a single target D&D 5e attack which rolls attacks based on whether you have advantage, disadvantage, or not. It requires the next update of the script though. Otherwise it will crash. Posting that update in a few minutes !power {{ --name|Longsword --leftsub|Melee Attack --rightsub|Reach 5 ft. --format|player --title|[[ [$AtkType] ?{Attack Std (0), Dis (1), or Adv(2)|0} + 0d0 ]] --?? $AtkType == 0 ?? Attack:|[[ [$AtkStd] 1d20 + 4 [Str Mod] + 2 [Proficiency] + ?{Misc. Attack Modifier|0} [Misc. Mod] ]] vs @{target|AC} AC --?? $AtkType == 1 ?? Attack:|[[ [$AtkDis] {2d20}KL1 + 4 [Str Mod] + 2 [Proficiency] + ?{Misc. Attack Modifier|0} [Misc. Mod] ]] vs @{target|AC} AC --?? $AtkType == 2 ?? Attack:|[[ [$AtkAdv] {2d20}KH1 + 4 [Str Mod] + 2 [Proficiency] + ?{Misc. Attack Modifier|0} [Misc. Mod] ]] vs @{target|AC} AC --?? $AtkType == 0 AND $AtkStd.base == 1 ?? Critical Miss:|You critically missed! --?? $AtkType == 0 AND $AtkStd.base <> 1 AND $AtkStd.total < @{target|AC} ?? Miss:|You missed! --?? $AtkType == 0 AND $AtkStd.base <> 1 AND $AtkStd.total >= @{target|AC} AND $AtkStd.base <> 20 ?? Hit:|[[ [nh] 1d8 + 4 [Str Mod] ]] slashing damage --?? $AtkType == 0 AND $AtkStd.base == 20 ?? Critical Hit:|[[ [nh] 2d8 + 4 [Str Mod] ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base == 1 ?? Critical Miss:|You critically missed! --?? $AtkType == 1 AND $AtkDis.base <> 1 AND $AtkDis.total < @{target|AC} ?? Miss:|You missed! --?? $AtkType == 1 AND $AtkDis.base <> 1 AND $AtkDis.total >= @{target|AC} AND $AtkDis.base <> 20 ?? Hit:|[[ [nh] 1d8 + 4 [Str Mod] ]] slashing damage --?? $AtkType == 1 AND $AtkDis.base == 20 ?? Critical Hit:|[[ [nh] 2d8 + 4 [Str Mod] ]] slashing damage --?? $AtkType == 2 AND $AtkAdv.base == 1 ?? Critical Miss:|You critically missed! --?? $AtkType == 2 AND $AtkAdv.base <> 1 AND $AtkAdv.total < @{target|AC} ?? Miss:|You missed! --?? $AtkType == 2 AND $AtkAdv.base <> 1 AND $AtkAdv.total >= @{target|AC} AND $AtkAdv.base <> 20 ?? Hit:|[[ [nh] 1d8 + 4 [Str Mod] ]] slashing damage --?? $AtkType == 2 AND $AtkAdv.base == 20 ?? Critical Hit:|[[ [nh] 2d8 + 4 [Str Mod] ]] slashing damage }}
June 1st, 2015 ~ 8:30 am eastern Version: 3.2.1 Update: Referring to a roll id without adding .base or .total will now default to .total instead of crashing the script. Example: ?? $Atk >= @{target|AC} ?? will default to the total result of [[ [$Atk] 1d20 + 4 ]] instead of the base roll of just the d20.
Also, query: What will you do when the day arrives, as it inevitably will, that you forget to include a bonus/penalty and thus an attack misses that should have hit? This scenario is one everyone should take into account when going with a 'only show damage if I hit' template/schema. :> The way it tends to work for me, I make far less mistakes as a GM if I have automation backing me up (I also benefit from using 13th Age, which generally doesn't use many bonuses/penalties, of course). If I do flub something, I rule in favor of the players. (I.E. If I forgot something and caused them to miss, I change it so they hit, and if I forgot something and caused an enemy to miss, the enemy still misses.)
Hi, intermittently my power card macro's roll twice. I have attached a pic. not really much to see. It does not happen every time I launch the campaign. I feel the same as Robert M. I make so many less mistakes in Combat with a level of automation.
Yeah... that happens. Not really sure why. I've had it happen with other scripts too.
OK. Normally I just reload the campaign and it fixes itself so not really a problem, but i thought i'd ask. Thanks
New error: evalmachine.<anonymous>:925 (roll.expr.toString().match(/\+|\-|\*|\\/g)) roll.expr = roll.expr.replace(/\ ^ TypeError: Object -2 has no method 'replace' at processRoll (evalmachine.<anonymous>:925:79) at evalmachine.<anonymous>:812:22 at Array.forEach (native) at buildInline (evalmachine.<anonymous>:811:30) at evalmachine.<anonymous>:753:66 at Array.forEach (native) at evalmachine.<anonymous>:750:43 at checkFinishedOps ( Causing Macro: !power --format|dnd4e --emote|ROLAIN, VAMPIRE --name|Dominating Gaze --usage|Recharge 6+ --action|Minor Action --Range|Ranged 5 --attack|[[1d20 + 27]] vs [[@{target|Will}]] Will @{target|token_name} --Effect|@{target|token_name} is Dominated (save ends [[-2]] to save) After Effect: @{target|token_name} is dazed (save ends)
It's most likely the [[-2]] that is causing the problem. Also, --usage and --action are deprecated and should be replaced with --leftsub and --rightsub. If you're using the character importer, you could update it yourself to change those.
Ah thanks
1433210544

Edited 1433210579
Michael B - You can fix this by using [!-2!] instead of [[-2]] until I get the error fixed and the script updated. [! !] will make anything look like an inline roll. If you're using the most recent version of PowerCards, here's an updated macro for you: !power {{ --emote|ROLAIN, VAMPIRE --name|Dominating Gaze --leftsub|Recharge 6+ --rightsub|Minor Action --Range|Ranged 5 --Attack|[[1d20 + 27]] vs [[@{target|AC}]] Will (@{target|token_name}) --Effect|@{target|token_name} is Dominated (save ends [!-2!] to save) --^1After Effect:|@{target|token_name} is dazed (save ends) }}
Here's a small example of how you can write scripts to handle your own roll mechanics in Roll20 and still output to PowerCards. Basically, this little script will take the information from the !mroll command and run it through some functions to determine the results and then plug those results into a string to send to PowerCard.Process to be sent to the chat window. Dunno what game it is for though. :D !mroll [[ [Athletics] @{Athletics}d12k@{Strength} ]] @{character_name} !mroll [[ [Athletics] @{selected|Athletics}d12k@{selected|Strength} ]] @{selected|character_name} // FUNCTIONS var Roll = Roll || {}; // API COMMAND HANDLER on("chat:message", function(msg) { if (msg.type !== "api") return; if (msg.content.split(" ", 1)[0] === "!mroll") { var player_obj = getObj("player", msg.playerid); msg.who = msg.who.replace(" (GM)", ""); Roll.Process(msg, player_obj); } }); Roll.Process = function(msg, player_obj) { var name = (msg.content.substring(msg.content.indexOf("]]")+3).trim() || "Name not found."); var skill = msg.inlinerolls[0].results.rolls[0].text; var expr = msg.inlinerolls[0].expression.replace(/\[.*?\]/, "").trim(); var results = []; var new_msg = {}; var count = 1; _.each(msg.inlinerolls[0].results.rolls[1].results, function(a) { if (a.d === undefined) { if (a.v <= 8) results.push({v: a.v, result: "Fail"}); if (a.v == 9 || a.v == 10) results.push({v: a.v, result: "Success at cost"}); if (a.v >= 11) results.push({v: a.v, result: "Success"}); } return results; }); var content = ""; _.each(results, function (b) { content += "--!Result " + count + "| [! " + b.v + " !] = **" + b.result + "**"; count++; return content; }) new_msg.content = "!power --name|" + skill + " --title|Sent by: %%who%% --leftsub|" + name + " --rightsub|" + expr + " " + content; PowerCard.Process(new_msg, player_obj); }
Ok not sure what I am doing wrong but when I try the conditionals, even using some of your examples HB I get the following error. For reference, the error message generated was: /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 "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "$" found. This is with the latest version and happens any time I have a roll with a conditional tag.
You need to post the macro you're using.
I have tried a few mods of my pathfinder weapon macro but when they failed I tried the following example you provided !power {{ --name|Basic Attack --leftsub|Longsword--rightsub|Range Melee --Attack:|[[ [$Atk] 1d20 + 4 [Str Mod] + 3 [Weapon Proficiency] ]] vs AC --Hit:|[[ 1d8 + 4 [Str Mod] ]] slashing damage --?? $Atk base == 20 ?? Critical Hit:| Add [[1d8]] slashing damage}} And even the below simple test. !power --name|test --Attack:|[[ [$Test] 1d20 ]] --?? $Test base == 20 ?? Crit:|add [[1d20]] It appears to be failing on the initial tag, and not the conditional test. If I remove the tag and instead use the following macro. !power {{ --name|Basic Attack --leftsub|Longsword--rightsub|Range Melee --Attack:|[[1d20 + 4 [Str Mod] + 3 [Weapon Proficiency] ]] vs AC --Hit:|[[ 1d8 + 4 [Str Mod] ]] slashing damage --?? $Atk base == 20 ?? Critical Hit:| Add [[1d8]] slashing damage}} I get
1433245026

Edited 1433245081
You didn't see the most recent updates to conditionals. I changed how they work. The reason for the change was so that people could compare two die rolls in conditionals or a die roll and a number or even two numbers. ?? $Atk.base == 20 ?? instead of ?? $Atk base == 20 ?? ?? $Atk >= @{target|AC} ?? instead of ?? $Atk total >= @{target|AC} ??
Also, make sure you're using version 3.2.1 by entering !power_version in chat.