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 (Thread 5)

Can I get some help guys? I am trying to make a powercard but when i execute it i get all the outcomes instead of just one. I tried to change the order of the AND OR statements but i am getting this. A 22 would had been a hit to the Primary Arm, and I only want the Outcome if i role a double and the location. What i am missing? any idea how i can go around it? !power {{ --titlefontshadow|none --titlefontsize|24px --titlefont|Times New Roman --corners|10 --orowbg|#73E738 --erowbg|#4D9A26 --format|Parry --name|@{Selected|MeleeName1} --leftsub|@{Selected|MeleeReach1} --rightsub|@{Selected|MeleeQuality1} --tokenid|@{selected|Token_Id} --target_list|@{target|token_id} --emote| **@{selected|token_name}** Defend against **@{target|token_name}** --Roll| //[^Aroll.base]//  ~R **Target:**  //[[ [TXT] @{selected|Current_WS}+?{Modifier|0} + 0d0 ]]//  ~R --SL|~R [[ [$Attr] ( (@{selected|Current_WS}+?{Modifier|0} - [$Aroll] 1d100)/10 ) ]]   ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 10 OR $Aroll.base == 20 OR $Aroll.base == 30 OR $Aroll.base == 40 OR $Aroll.base == 50 OR $Aroll.base == 60 OR $Aroll.base == 70 OR $Aroll.base == 80 OR $Aroll.base == 90 ?? Outcome *1|~R //Hit Head// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 1 OR $Aroll.base == 11 OR $Aroll.base == 21 OR $Aroll.base == 31 OR $Aroll.base == 41 OR $Aroll.base == 51 OR $Aroll.base == 61 OR $Aroll.base == 71 OR $Aroll.base == 81 OR $Aroll.base == 91 OR $Aroll.base == 2 OR $Aroll.base == 12 OR $Aroll.base == 22 OR $Aroll.base == 32 OR $Aroll.base == 42 ?? Outcome *2|~R //Hit Secondary Arm// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 52 OR $Aroll.base == 62 OR $Aroll.base == 72 OR $Aroll.base == 82 OR $Aroll.base == 92 OR $Aroll.base == 3 OR $Aroll.base == 13 OR $Aroll.base == 23 OR $Aroll.base == 33 OR $Aroll.base == 43 OR $Aroll.base == 53 OR $Aroll.base == 63 OR $Aroll.base == 73 OR $Aroll.base == 83 OR $Aroll.base == 93 OR $Aroll.base == 4 OR $Aroll.base == 14 OR $Aroll.base == 24 OR $Aroll.base== 34 OR $Aroll.base == 44 ?? Outcome *3|~R //Hit Primary Arm// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 54 OR $Aroll.base == 64 OR $Aroll.base == 74 OR $Aroll.base == 84 OR $Aroll.base == 94 OR $Aroll.base == 5 OR $Aroll.base == 15 OR $Aroll.base == 25 OR $Aroll.base == 35 OR $Aroll.base == 45 OR $Aroll.base == 55 OR $Aroll.base == 65 OR $Aroll.base == 75 OR $Aroll.base == 85 OR $Aroll.base == 95 OR $Aroll.base == 6 OR $Aroll.base == 16 OR $Aroll.base == 26 OR $Aroll.base == 36 OR $Aroll.base == 46 OR $Aroll.base == 56 OR $Aroll.base == 66 OR $Aroll.base == 76 OR $Aroll.base == 86 OR $Aroll.base == 96 OR $Aroll.base == 7 OR $Aroll.base == 17 OR $Aroll.base == 27 OR $Aroll.base == 37 OR $Aroll.base == 47 OR $Aroll.base == 57 OR $Aroll.base == 67 OR $Aroll.base == 77 OR $Aroll.base == 87 OR $Aroll.base == 97 ?? Outcome *4|~R //Hit Body// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 8 OR $Aroll.base == 18 OR $Aroll.base == 28 OR $Aroll.base == 38 OR $Aroll.base == 48 OR $Aroll.base == 58 OR $Aroll.base == 68 OR $Aroll.base == 78 OR $Aroll.base == 88 OR $Aroll.base == 98 OR $Aroll.base == 9 ?? Outcome *5|~R //Hit Left Leg// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 19 OR $Aroll.base == 29 OR $Aroll.base == 39 OR $Aroll.base == 49 OR $Aroll.base == 59 OR $Aroll.base == 69 OR $Aroll.base == 79 OR $Aroll.base == 89 OR $Aroll.base == 99 OR $Aroll.base == 100 ?? Outcome *6|~R //Hit Right Leg// ~R --?? $Aroll.base >= $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *9|~C [Critical](!
#🕔WeaponS1  ) ~C --?? $Aroll.base < $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *8|~C  [Fumble](!
#🕔WeaponS1  ) ~C --?? $Aroll.base == 1 ?? ! *1| // Sigmar Smiles upon you. Automatic Success! // --?? $Aroll.base >= 98 ?? ! *2| //Ranald Frown upon you. Automatic Failure! // }}
1533773060

Edited 1533773136
Danny C. said: Can I get some help guys? I am trying to make a powercard but when i execute it i get all the outcomes instead of just one. I tried to change the order of the AND OR statements but i am getting this. A 22 would had been a hit to the Primary Arm, and I only want the Outcome if i role a double and the location. What i am missing? any idea how i can go around it? !power {{ --titlefontshadow|none --titlefontsize|24px --titlefont|Times New Roman --corners|10 --orowbg|#73E738 --erowbg|#4D9A26 --format|Parry --name|@{Selected|MeleeName1} --leftsub|@{Selected|MeleeReach1} --rightsub|@{Selected|MeleeQuality1} --tokenid|@{selected|Token_Id} --target_list|@{target|token_id} --emote| **@{selected|token_name}** Defend against **@{target|token_name}** --Roll| //[^Aroll.base]//  ~R **Target:**  //[[ [TXT] @{selected|Current_WS}+?{Modifier|0} + 0d0 ]]//  ~R --SL|~R [[ [$Attr] ( (@{selected|Current_WS}+?{Modifier|0} - [$Aroll] 1d100)/10 ) ]]   ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 10 OR $Aroll.base == 20 OR $Aroll.base == 30 OR $Aroll.base == 40 OR $Aroll.base == 50 OR $Aroll.base == 60 OR $Aroll.base == 70 OR $Aroll.base == 80 OR $Aroll.base == 90 ?? Outcome *1|~R //Hit Head// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 1 OR $Aroll.base == 11 OR $Aroll.base == 21 OR $Aroll.base == 31 OR $Aroll.base == 41 OR $Aroll.base == 51 OR $Aroll.base == 61 OR $Aroll.base == 71 OR $Aroll.base == 81 OR $Aroll.base == 91 OR $Aroll.base == 2 OR $Aroll.base == 12 OR $Aroll.base == 22 OR $Aroll.base == 32 OR $Aroll.base == 42 ?? Outcome *2|~R //Hit Secondary Arm// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 52 OR $Aroll.base == 62 OR $Aroll.base == 72 OR $Aroll.base == 82 OR $Aroll.base == 92 OR $Aroll.base == 3 OR $Aroll.base == 13 OR $Aroll.base == 23 OR $Aroll.base == 33 OR $Aroll.base == 43 OR $Aroll.base == 53 OR $Aroll.base == 63 OR $Aroll.base == 73 OR $Aroll.base == 83 OR $Aroll.base == 93 OR $Aroll.base == 4 OR $Aroll.base == 14 OR $Aroll.base == 24 OR $Aroll.base== 34 OR $Aroll.base == 44 ?? Outcome *3|~R //Hit Primary Arm// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 54 OR $Aroll.base == 64 OR $Aroll.base == 74 OR $Aroll.base == 84 OR $Aroll.base == 94 OR $Aroll.base == 5 OR $Aroll.base == 15 OR $Aroll.base == 25 OR $Aroll.base == 35 OR $Aroll.base == 45 OR $Aroll.base == 55 OR $Aroll.base == 65 OR $Aroll.base == 75 OR $Aroll.base == 85 OR $Aroll.base == 95 OR $Aroll.base == 6 OR $Aroll.base == 16 OR $Aroll.base == 26 OR $Aroll.base == 36 OR $Aroll.base == 46 OR $Aroll.base == 56 OR $Aroll.base == 66 OR $Aroll.base == 76 OR $Aroll.base == 86 OR $Aroll.base == 96 OR $Aroll.base == 7 OR $Aroll.base == 17 OR $Aroll.base == 27 OR $Aroll.base == 37 OR $Aroll.base == 47 OR $Aroll.base == 57 OR $Aroll.base == 67 OR $Aroll.base == 77 OR $Aroll.base == 87 OR $Aroll.base == 97 ?? Outcome *4|~R //Hit Body// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 8 OR $Aroll.base == 18 OR $Aroll.base == 28 OR $Aroll.base == 38 OR $Aroll.base == 48 OR $Aroll.base == 58 OR $Aroll.base == 68 OR $Aroll.base == 78 OR $Aroll.base == 88 OR $Aroll.base == 98 OR $Aroll.base == 9 ?? Outcome *5|~R //Hit Left Leg// ~R --?? $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99 AND $Aroll.base == 19 OR $Aroll.base == 29 OR $Aroll.base == 39 OR $Aroll.base == 49 OR $Aroll.base == 59 OR $Aroll.base == 69 OR $Aroll.base == 79 OR $Aroll.base == 89 OR $Aroll.base == 99 OR $Aroll.base == 100 ?? Outcome *6|~R //Hit Right Leg// ~R --?? $Aroll.base >= $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *9|~C [Critical](!
#WeaponS1  ) ~C --?? $Aroll.base < $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *8|~C  [Fumble](!
#WeaponS1  ) ~C --?? $Aroll.base == 1 ?? ! *1| // Sigmar Smiles upon you. Automatic Success! // --?? $Aroll.base >= 98 ?? ! *2| //Ranald Frown upon you. Automatic Failure! // }} How about this? !power {{ --titlefontshadow|none --titlefontsize|24px --titlefont|Times New Roman --corners|10 --orowbg|#73E738 --erowbg|#4D9A26 --format|Parry --name|@{Selected|MeleeName1} --leftsub|@{Selected|MeleeReach1} --rightsub|@{Selected|MeleeQuality1} --tokenid|@{selected|Token_Id} --target_list|@{target|token_id} --emote| **@{selected|token_name}** Defend against **@{target|token_name}** --Roll| //[^Aroll.base]//  ~R **Target:**  //[[ [TXT] @{selected|Current_WS}+?{Modifier|0} + 0d0 ]]//  ~R --SL|~R [[ [$Attr] ( (@{selected|Current_WS}+?{Modifier|0} - [$Aroll] 1d100)/10 ) ]]   ~R --?? $Aroll.base == 10 OR $Aroll.base == 20 OR $Aroll.base == 30 OR $Aroll.base == 40 OR $Aroll.base == 50 OR $Aroll.base == 60 OR $Aroll.base == 70 OR $Aroll.base == 80 OR $Aroll.base == 90 ?? Outcome *1|~R //Hit Head// ~R --?? $Aroll.base == 1 OR $Aroll.base == 11 OR $Aroll.base == 21 OR $Aroll.base == 31 OR $Aroll.base == 41 OR $Aroll.base == 51 OR $Aroll.base == 61 OR $Aroll.base == 71 OR $Aroll.base == 81 OR $Aroll.base == 91 OR $Aroll.base == 2 OR $Aroll.base == 12 OR $Aroll.base == 22 OR $Aroll.base == 32 OR $Aroll.base == 42 ?? Outcome *2|~R //Hit Secondary Arm// ~R --?? $Aroll.base == 52 OR $Aroll.base == 62 OR $Aroll.base == 72 OR $Aroll.base == 82 OR $Aroll.base == 92 OR $Aroll.base == 3 OR $Aroll.base == 13 OR $Aroll.base == 23 OR $Aroll.base == 33 OR $Aroll.base == 43 OR $Aroll.base == 53 OR $Aroll.base == 63 OR $Aroll.base == 73 OR $Aroll.base == 83 OR $Aroll.base == 93 OR $Aroll.base == 4 OR $Aroll.base == 14 OR $Aroll.base == 24 OR $Aroll.base== 34 OR $Aroll.base == 44 ?? Outcome *3|~R //Hit Primary Arm// ~R --?? $Aroll.base == 54 OR $Aroll.base == 64 OR $Aroll.base == 74 OR $Aroll.base == 84 OR $Aroll.base == 94 OR $Aroll.base == 5 OR $Aroll.base == 15 OR $Aroll.base == 25 OR $Aroll.base == 35 OR $Aroll.base == 45 OR $Aroll.base == 55 OR $Aroll.base == 65 OR $Aroll.base == 75 OR $Aroll.base == 85 OR $Aroll.base == 95 OR $Aroll.base == 6 OR $Aroll.base == 16 OR $Aroll.base == 26 OR $Aroll.base == 36 OR $Aroll.base == 46 OR $Aroll.base == 56 OR $Aroll.base == 66 OR $Aroll.base == 76 OR $Aroll.base == 86 OR $Aroll.base == 96 OR $Aroll.base == 7 OR $Aroll.base == 17 OR $Aroll.base == 27 OR $Aroll.base == 37 OR $Aroll.base == 47 OR $Aroll.base == 57 OR $Aroll.base == 67 OR $Aroll.base == 77 OR $Aroll.base == 87 OR $Aroll.base == 97 ?? Outcome *4|~R //Hit Body// ~R --?? $Aroll.base == 8 OR $Aroll.base == 18 OR $Aroll.base == 28 OR $Aroll.base == 38 OR $Aroll.base == 48 OR $Aroll.base == 58 OR $Aroll.base == 68 OR $Aroll.base == 78 OR $Aroll.base == 88 OR $Aroll.base == 98 OR $Aroll.base == 9 ?? Outcome *5|~R //Hit Left Leg// ~R --?? $Aroll.base == 19 OR $Aroll.base == 29 OR $Aroll.base == 39 OR $Aroll.base == 49 OR $Aroll.base == 59 OR $Aroll.base == 69 OR $Aroll.base == 79 OR $Aroll.base == 89 OR $Aroll.base == 99 OR $Aroll.base == 100 ?? Outcome *6|~R //Hit Right Leg// ~R --?? $Aroll.base >= $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *9|~C [Critical](!
#WeaponS1  ) ~C --?? $Aroll.base < $Attr AND $Aroll.base == 11 OR $Aroll.base == 22 OR $Aroll.base == 33 OR $Aroll.base == 44 OR $Aroll.base == 55 OR $Aroll.base == 66 OR $Aroll.base == 77 OR $Aroll.base == 88 OR $Aroll.base == 99  ?? ! *8|~C  [Fumble](!
#WeaponS1  ) ~C --?? $Aroll.base == 1 ?? ! *1| // Sigmar Smiles upon you. Automatic Success! // --?? $Aroll.base >= 98 ?? ! *2| //Ranald Frown upon you. Automatic Failure! // }} Should give the same top half (Roll, Target, SL, one Outcome, and Crit or Failure.
Is there a way to do a conditional to check if Target 1 is the same as Target 2 and only do the 2nd set of rolls if they aren't? Example: --?? ~T-CID$ <> ~T1-CID$ ?? ACTION!!!
1533799727

Edited 1533808430
thx
1533860171
Kurt J.
Pro
API Scripter
PowerCards 3.8.4 is now on the Development GIST This version is up, but because of the extensive changes, it will definitely need some testing. Please report any issues on the thread and I'll work on them as I can. If things go well, this version will end up on One Click (likely next Tuesday). There are two major feature updates with 3.8.4: - An entirely new style of conditional: eval conditionals . These are based on the same type of logic that was included in the template conditionals, and attempt to perform a javascript eval() on the text inside the conditional markers (?! and !?) and allows for additional flexibility. For example, if you can do something along the lines of : --?! ( $atk.base % 10 ) == 1 !?Ones|That roll ends in a 1!   As with normal conditionals, everything needs to be separated by spaces (in this case, even the parenthesis need to be set off from everything else with spaces), as that is how it figures out what is a RollID and what isn't.   Any condition that ends up as a true javascript evaluatable expression will result in the line being displayed. Anything else will not. - Initial attempt to provide more generic support for replacement sections for those not using the 5E OGL Sheet . The --replacesection command takes 5 parameters and generates replacement variables for all of the attributes of a repeating section entry. These parameters are Character ID, Entry Name, section name, identifier text, and replacement prefix. Character ID is self explanatory. Entry Name is the repeating section entry we will be looking for. This could be the name of a weapon or a spell, etc. Section name is the name of the repeating section. For example, in the 5E OGL sheet, the repeating_npcaction section would be named "npcaction". "repeating_" will be prefixed to this name to retrieve attributes from this section. Identifer Text is the name-type field for the repeating section entry. In the 5E OGL sheet, for example, this is usually "name", but sometimes "spellname" or "atkname". This is the attribute suffix we will look for to compare against Entry Name. Replacement Prefix will be put in front of any returned replacement values. For example: --replacesection|@{selected|character_id}|Warhammer|attack|atkname|PA- will generate replacement variables beginning with the "PA-" prefix, from the repeating_attack section of the character sheet when the value of repeating_attack_*_atkname is equal to Warhammer for the given character ID. This allows for the generic use of any repeating section on the character sheet
1533860264
Kurt J.
Pro
API Scripter
Theodore S. said: Is there a way to do a conditional to check if Target 1 is the same as Target 2 and only do the 2nd set of rolls if they aren't? Example: --?? ~T-CID$ <> ~T1-CID$ ?? ACTION!!! With the new conditionals, this should be possible: --?! "~T-CID$" <> "~T1-CID$" !?Yep|Do Something
Got some simple question: Can powercards now do simple Math with variables like [[1d8 + ([^Atk.base] + [^Str.base]) ]] ? All the threads are pretty big and in the Wiki it just show some display values. I just want the full damage to display and not just 1d8 + 3 + 2. 
1533894958
Kurt J.
Pro
API Scripter
lordshark said: Got some simple question: Can powercards now do simple Math with variables like [[1d8 + ([^Atk.base] + [^Str.base]) ]] ? All the threads are pretty big and in the Wiki it just show some display values. I just want the full damage to display and not just 1d8 + 3 + 2.  You can use attribute values and such like [[ 1d8 + @{selected|strength_mod} ]] and the output would be the total numeric result. You can't use the result of one roll in another roll, though, because all rolls are processed at the same time. That said, you can roll multiple dice in a roll as well ([[ 1d8 + 1d4 + 1d20 ]]) will roll all three dice and total the results. Hovering over the output number will show the roll formula and the results of each component.
1533919345

Edited 1533919705
Kurt J. said: Theodore S. said: Is there a way to do a conditional to check if Target 1 is the same as Target 2 and only do the 2nd set of rolls if they aren't? Example: --?? ~T-CID$ <> ~T1-CID$ ?? ACTION!!! With the new conditionals, this should be possible: --?! "~T-CID$" <> "~T1-CID$" !?Yep|Do Something Followed your possibility and here is the result: !power {{ --replacespell|@{selected|character_id}|Eldritch Blast --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|1st|character_id} --replaceattrs|T1-|@{target|2nd|character_id} --inlinereplace|CL|~S-L$ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --emote|~S-CN$ ^^ casts ^^ ~SP-NAME$ --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell  --rightsub|~SP-RANGE$ --Level:|Cantrip --Casting Time:|~SP-CASTINGTIME$ --Duration:|~SP-DURATION$ --Beam*1:|[[ [$Atk_1] ?{Advantage1?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T-AC$ --?? $Atk_1 < ~T-AC$ ?? !Missed*1|**You missed!** --?? $Atk_1 >= ~T-AC$ AND $Atk_1.base <> 20 ?? Hit:#1|[#[ [$dmg] floor(1d10 / ?{Resistance1?|No, 1|Yes, 2} * ?{Vulnerable1?|No, 1|Yes, 2}) ]#] Force Damage --?? $Atk_1.base == 20 ?? Critical Hit:*1|[[ [TXT] 1t[Hit-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 1 ?? Fumble:*1|[[ [TXT] 1t[Fumble-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 20 ?? Normal Damage:*1|[[1d10]] Force Damage --?! "~T-CID$" <> "~T1-CID$" !? Beam*2:|[[ [$Atk_2] ?{Advantage2?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T1-AC$ }} Attempt #2 - Tried it without the quotes and got the same result. Attempt #3 - Tried removing the space between ? and B and got same result. Attempt #4 - Tried adding spaced after (and before) quotes) and same result.
1533924702

Edited 1533924776
Kurt J.
Pro
API Scripter
Theodore S. said: Kurt J. said: Theodore S. said: Is there a way to do a conditional to check if Target 1 is the same as Target 2 and only do the 2nd set of rolls if they aren't? Example: --?? ~T-CID$ <> ~T1-CID$ ?? ACTION!!! With the new conditionals, this should be possible: --?! "~T-CID$" <> "~T1-CID$" !?Yep|Do Something Followed your possibility and here is the result: !power {{ --replacespell|@{selected|character_id}|Eldritch Blast --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|1st|character_id} --replaceattrs|T1-|@{target|2nd|character_id} --inlinereplace|CL|~S-L$ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --emote|~S-CN$ ^^ casts ^^ ~SP-NAME$ --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell  --rightsub|~SP-RANGE$ --Level:|Cantrip --Casting Time:|~SP-CASTINGTIME$ --Duration:|~SP-DURATION$ --Beam*1:|[[ [$Atk_1] ?{Advantage1?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T-AC$ --?? $Atk_1 < ~T-AC$ ?? !Missed*1|**You missed!** --?? $Atk_1 >= ~T-AC$ AND $Atk_1.base <> 20 ?? Hit:#1|[#[ [$dmg] floor(1d10 / ?{Resistance1?|No, 1|Yes, 2} * ?{Vulnerable1?|No, 1|Yes, 2}) ]#] Force Damage --?? $Atk_1.base == 20 ?? Critical Hit:*1|[[ [TXT] 1t[Hit-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 1 ?? Fumble:*1|[[ [TXT] 1t[Fumble-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 20 ?? Normal Damage:*1|[[1d10]] Force Damage --?! "~T-CID$" <> "~T1-CID$" !? Beam*2:|[[ [$Atk_2] ?{Advantage2?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T1-AC$ }} Attempt #2 - Tried it without the quotes and got the same result. Attempt #3 - Tried removing the space between ? and B and got same result. Attempt #4 - Tried adding spaced after (and before) quotes) and same result.  First, the obvious : did you update to 3.8.4? Anything in ?! and !? blocks should be stripped out by 8.3.4 no matter how it evaluates out, so should not be displayed. I stripped down your macro to just the essentials, and if I change <> to !== (javascript's not-equal operator) it works (showing beam two only of I select two different targets). I missed that above (that <> doesn't mean anything to Javascript).
1533928341

Edited 1533931839
Kurt J. said: Theodore S. said: Kurt J. said: Theodore S. said: Is there a way to do a conditional to check if Target 1 is the same as Target 2 and only do the 2nd set of rolls if they aren't? Example: --?? ~T-CID$ <> ~T1-CID$ ?? ACTION!!! With the new conditionals, this should be possible: --?! "~T-CID$" <> "~T1-CID$" !?Yep|Do Something Followed your possibility and here is the result: !power {{ --replacespell|@{selected|character_id}|Eldritch Blast --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|1st|character_id} --replaceattrs|T1-|@{target|2nd|character_id} --inlinereplace|CL|~S-L$ --charid|@{selected|character_id} --tokenid|@{selected|token_id} --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} --emote|~S-CN$ ^^ casts ^^ ~SP-NAME$ --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell  --rightsub|~SP-RANGE$ --Level:|Cantrip --Casting Time:|~SP-CASTINGTIME$ --Duration:|~SP-DURATION$ --Beam*1:|[[ [$Atk_1] ?{Advantage1?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T-AC$ --?? $Atk_1 < ~T-AC$ ?? !Missed*1|**You missed!** --?? $Atk_1 >= ~T-AC$ AND $Atk_1.base <> 20 ?? Hit:#1|[#[ [$dmg] floor(1d10 / ?{Resistance1?|No, 1|Yes, 2} * ?{Vulnerable1?|No, 1|Yes, 2}) ]#] Force Damage --?? $Atk_1.base == 20 ?? Critical Hit:*1|[[ [TXT] 1t[Hit-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 1 ?? Fumble:*1|[[ [TXT] 1t[Fumble-Magic-(Lv.5-8)] ]] --?? $Atk_1.base == 20 ?? Normal Damage:*1|[[1d10]] Force Damage --?! "~T-CID$" <> "~T1-CID$" !? Beam*2:|[[ [$Atk_2] ?{Advantage2?| Normal, 1d20 + @{selected|spell_attack_bonus} | Advantage, 2d20KH1 + @{selected|spell_attack_bonus} | Disadvantage, 2d20KL1 + @{selected|spell_attack_bonus} } ]] vs **AC** ~T1-AC$ }} Attempt #2 - Tried it without the quotes and got the same result. Attempt #3 - Tried removing the space between ? and B and got same result. Attempt #4 - Tried adding spaced after (and before) quotes) and same result.  First, the obvious : did you update to 3.8.4? Anything in ?! and !? blocks should be stripped out by 8.3.4 no matter how it evaluates out, so should not be displayed. I stripped down your macro to just the essentials, and if I change <> to !== (javascript's not-equal operator) it works (showing beam two only of I select two different targets). I missed that above (that <> doesn't mean anything to Javascript). Awesome. That was what I was looking for. UPDATE: That was the fix AND I did forget to install 3.8.4 into the game I as testing in.
1533951359

Edited 1533952525
Kurt J.
Pro
API Scripter
Version 3.8.5 is on the Development GIST, and you should update if you are using 3.8.4. NOTE: 3.8.4 was never set to be promoted to One Click, so this issue will not impact you if you are using a One Click version of PowerCards. There is a potentially related issue with tempates, but since the GM controls templates (and not players) the problem is lessened. Either way, the fix for both will be in 3.8.5 headed to One Click. I've updated the development GIST to 3.8.5, and if you are using 3.8.4 you should update. The new conditionals (?! and !?) in 3.8.4 have the potential to be used maliciously, which could result in problems. In 3.8.5, I've modified the way these conditionals work. There are now a number of characters that cannot be used in the conditional statements, including: = ; < ! > { } [ ] ( ) . & | Any of these characters will be stripped out of the conditional. Also note that these characters will be stripped out of any replacements that contain them in the conditional text (but only in the conditional). At first glance, this might make these conditionals seem useless, but there are available alternative operators that follow the Microsoft PowerShell standard (note that they are all case sensitive and in lower case): -eq is equivalent to == -ne is equivalent to !== -gt is equivalent to > -lt is equivalent to < -ge is equivalent to >= -le is equivalent to <= -and is equivalent to && -or is equivalent to || The same is also true of optional inclusion lines in templates, and this will be a breaking change if you are currently using option inclusion in templates. You will need to update them to use the operators above. Template optional inclusion is not as big of an issue as the new conditionals, as the GM has control over templates, while players can type macros.
Looking through the code, I see a section that intrigues me: function getPCAttack(charid, attackname) {  var return_set = []; try { var action_prefix = filterObjs(function(z) { return (z.get("characterid") == charid && z.get("name").startsWith("repeating_attack") && z.get("name").endsWith("atkname")); }) .filter(entry => entry.get("current") == attackname)[0] .get("name").slice(0,-7); } catch (e) { return(return_set) }; // var actionType = (getAttrByName(charid, action_prefix + "attack_flag") == "on" ? "ATTACK" : "INFOCARD"); // return_set.push("PCA-NAME|" + attackname); // return_set.push("PCA-DMGBASE|" + getAttrByName(charid, action_prefix + "dmgbase")); // return_set.push("PCA-DMGTYPE|" + getAttrByName(charid, action_prefix + "dmgtype")); // var atkattr = getAttrByName(charid, action_prefix + "atkattr_base"); // return_set.push("PCA-ATKATTR|" + atkattr.substring(2,3).toUpperCase(); // return_set.push("PCA-ATKATTRBONUS|" + atkattr.substring( // return_set.push("PCA-DMGATTR|" + getAttrByName(charid, action_prefix + "dmgattr").substring(2,3)).toUpperCase(); // return_set.push("PCA-PROF|" + + getAttrByName(charid, action_prefix + "atkprofflag")); // return_set.push("NPCA-DESCRIPTION|" + getAttrByName(charid, action_prefix + "description")); var action_attrs = filterObjs(function(z) { return (z.get("characterid") == charid && z.get("name").startsWith(action_prefix)); }) action_attrs.forEach(function(z) { if (!(z.get("name").startsWith(action_prefix + "rollbase"))) { return_set.push("PCA-"+z.get("name").replace(action_prefix,"") + "|" + z.get("current")); } }) //log(return_set); return (return_set); Is this area working or are you still testing to see how hard it would be to get it to work?
what is an eval conditionals? What can i do with it?
1534140175

Edited 1534140224
So, just to throw a crazy bit of example code out there that I won't have a chance to test myself for awhile - with the new conditionals, would it be possible to do something like this little bit of psuedocode? !power {{ ... --?! @{is_something} -lt 1 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|-blue --?! @{is_something} -gt 0 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|blue:@{is_something} ... }}
Aquaricat said: So, just to throw a crazy bit of example code out there that I won't have a chance to test myself for awhile - with the new conditionals, would it be possible to do something like this little bit of psuedocode? !power {{ ... --?! @{is_something} -lt 1 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|-blue --?! @{is_something} -gt 0 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|blue:@{is_something} ... }} Yes, besides the fact you are asking if something is less than 1 or greater than 0. Why not use -ge 0 (is greater than or equal to) and -gt  (is greater than).
Here is my macro: !power {{ --format|atwill --whisper|GM --tokenid|@{selected|token_id} --name|@{selected|character_name} --leftsub|Spell Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --npc_attribute_summary|@{selected|character_id} --Speed:|@{selected|npc_speed} --npc_qualities_summary|@{selected|character_id} --npc_skill_summary|@{selected|character_id} --npc_action_list|@{selected|character_id} --npc_legendaryaction_list|@{selected|character_id} --npc_reaction_list|@{selected|character_id} --npc_traits_list|@{selected|character_id} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} NPC Actions are great except for the npc_skill_summary and npc_traits_list line when they don't have any.
1534341894
Kurt J.
Pro
API Scripter
Theodore S. said: Here is my macro: !power {{ --format|atwill --whisper|GM --tokenid|@{selected|token_id} --name|@{selected|character_name} --leftsub|Spell Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --npc_attribute_summary|@{selected|character_id} --Speed:|@{selected|npc_speed} --npc_qualities_summary|@{selected|character_id} --npc_skill_summary|@{selected|character_id} --npc_action_list|@{selected|character_id} --npc_legendaryaction_list|@{selected|character_id} --npc_reaction_list|@{selected|character_id} --npc_traits_list|@{selected|character_id} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} NPC Actions are great except for the npc_skill_summary and npc_traits_list line when they don't have any. That's because it is "npc_skills_summary" and "npc_trait_list" (you have "skill" and "traits")... The Wiki had them wrong (fixing it now). I know that is not exactly internally consistent :) When a list is empty it just won't display anything. I'll probably add both variations as acceptable (so both "npc_skill_summary" and "npc_skills_summary" will do the same thing).
Theodore S. said: Aquaricat said: So, just to throw a crazy bit of example code out there that I won't have a chance to test myself for awhile - with the new conditionals, would it be possible to do something like this little bit of psuedocode? !power {{ ... --?! @{is_something} -lt 1 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|-blue --?! @{is_something} -gt 0 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|blue:@{is_something} ... }} Yes, besides the fact you are asking if something is less than 1 or greater than 0. Why not use -ge 0 (is greater than or equal to) and -gt  (is greater than). I wrote that psuedocode very quickly on my phone on my lunch break from memory.  ^^  In the end it works the same way either way, so it's just a matter of semantics.  Is it a hair more readable to use -ge?  Probably.  However, I'm using the attribute as a sort of rough 'truthy' value, ergo, when the attribute is '0' I mean 'false', and if it's anything else, I mean 'true'.  As a more concrete example - I could (and will be!) use the above code to indicate that my character has Shield of Faith active, by showing a token marker with an indicator digit saying how many more turns it'll last.
Aquaricat said: Theodore S. said: Aquaricat said: So, just to throw a crazy bit of example code out there that I won't have a chance to test myself for awhile - with the new conditionals, would it be possible to do something like this little bit of psuedocode? !power {{ ... --?! @{is_something} -lt 1 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|-blue --?! @{is_something} -gt 0 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|blue:@{is_something} ... }} Yes, besides the fact you are asking if something is less than 1 or greater than 0. Why not use -ge 0 (is greater than or equal to) and -gt  (is greater than). I wrote that psuedocode very quickly on my phone on my lunch break from memory.  ^^  In the end it works the same way either way, so it's just a matter of semantics.  Is it a hair more readable to use -ge?  Probably.  However, I'm using the attribute as a sort of rough 'truthy' value, ergo, when the attribute is '0' I mean 'false', and if it's anything else, I mean 'true'.  As a more concrete example - I could (and will be!) use the above code to indicate that my character has Shield of Faith active, by showing a token marker with an indicator digit saying how many more turns it'll last. Also, to use Power Cards or any other API, you must be a Pro member.
1534375565

Edited 1534444502
Kurt J.
Pro
API Scripter
Theodore S. said: Aquaricat said: Theodore S. said: Aquaricat said: So, just to throw a crazy bit of example code out there that I won't have a chance to test myself for awhile - with the new conditionals, would it be possible to do something like this little bit of psuedocode? !power {{ ... --?! @{is_something} -lt 1 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|-blue --?! @{is_something} -gt 0 !? api_token-mod|_ids @{character_id} _ignore_selected _set statusmarkers|blue:@{is_something} ... }} Yes, besides the fact you are asking if something is less than 1 or greater than 0. Why not use -ge 0 (is greater than or equal to) and -gt  (is greater than). I wrote that psuedocode very quickly on my phone on my lunch break from memory.  ^^  In the end it works the same way either way, so it's just a matter of semantics.  Is it a hair more readable to use -ge?  Probably.  However, I'm using the attribute as a sort of rough 'truthy' value, ergo, when the attribute is '0' I mean 'false', and if it's anything else, I mean 'true'.  As a more concrete example - I could (and will be!) use the above code to indicate that my character has Shield of Faith active, by showing a token marker with an indicator digit saying how many more turns it'll last. Also, to use Power Cards or any other API, you must be a Pro member. Not necessarily... The person hosting your game must be a Pro member, but players can create their own PowerCards macros, and they don't need Pro for that.
Hey guys! I'm having a minor but infuriating problem with a few of my power cards and was wondering if you can help me out. See, I use standardized attack macros across my NPC's, at least for basic attacks. Meaning that all of them use an identical powercard macro. Despite this... it only seems to be working for some characters. <a href="https://screenshots.firefox.com/VaCcaeKMqVH5xg2p/app.roll20.net" rel="nofollow">https://screenshots.firefox.com/VaCcaeKMqVH5xg2p/app.roll20.net</a> What you can see here is an example of the exact same macro run on two different characters. <a href="https://screenshots.firefox.com/wwXBGCUOyFTQwJAP/app.roll20.net" rel="nofollow">https://screenshots.firefox.com/wwXBGCUOyFTQwJAP/app.roll20.net</a> This is the macro in question on each character's sheet. You'll note they appear to be absolutely identical. Despite this, one works and the other has broken buttons that no longer function. It's worth noting, the button code is correct. If one button is removed, the other becomes functional with no changes. If the buttons are split onto two separate powercard tags, each button becomes functional with no other changes. But for some reason, having them both together on the same line stops them working... on about half my characters. The other half work fine. Any ideas what might be causing this or how to fix it anyone? Worst case scenario I can split it into two lines/tags, but I'd much rather resolve the issue if possible.
1534463962
Kurt J.
Pro
API Scripter
Morgan said: Hey guys! I'm having a minor but infuriating problem with a few of my power cards and was wondering if you can help me out. See, I use standardized attack macros across my NPC's, at least for basic attacks. Meaning that all of them use an identical powercard macro. Despite this... it only seems to be working for some characters. <a href="https://screenshots.firefox.com/VaCcaeKMqVH5xg2p/app.roll20.net" rel="nofollow">https://screenshots.firefox.com/VaCcaeKMqVH5xg2p/app.roll20.net</a> What you can see here is an example of the exact same macro run on two different characters. <a href="https://screenshots.firefox.com/wwXBGCUOyFTQwJAP/app.roll20.net" rel="nofollow">https://screenshots.firefox.com/wwXBGCUOyFTQwJAP/app.roll20.net</a> This is the macro in question on each character's sheet. You'll note they appear to be absolutely identical. Despite this, one works and the other has broken buttons that no longer function. It's worth noting, the button code is correct. If one button is removed, the other becomes functional with no changes. If the buttons are split onto two separate powercard tags, each button becomes functional with no other changes. But for some reason, having them both together on the same line stops them working... on about half my characters. The other half work fine. Any ideas what might be causing this or how to fix it anyone? Worst case scenario I can split it into two lines/tags, but I'd much rather resolve the issue if possible. Can you post the values for the @{CharNAME} for the ones that work and the ones that don't? My guess is that the ones that don't work start with R, C, J, or L, and are being misinterpreted as formatting characters (Left, Right, Center, and Justify). This only occurs because of the ~ in front of them, and the name being repeated in the tag (~R Something ~R) becomes right justified, but (~R Something) will be left alone. The question then becomes how to fix it. I have a couple of ideas... I could add a tag modifier that skipped inline formatting for that tag. This would be some character at the front of the tag like the hidden tag ($) or indent (^) modifiers. Alternatively (or perhaps in addition) I could introduce a tag that would disable inline formatting for the whole card. This would allow it to be placed in the Format tag, so you could update your format entry (Attack) in one place and not have to update every card.
Theodore S. said: Looking through the code, I see a section that intrigues me: function getPCAttack(charid, attackname) {&nbsp; var return_set = []; try { var action_prefix = filterObjs(function(z) { return (z.get("characterid") == charid &amp;&amp; z.get("name").startsWith("repeating_attack") &amp;&amp; z.get("name").endsWith("atkname")); }) .filter(entry =&gt; entry.get("current") == attackname)[0] .get("name").slice(0,-7); } catch (e) { return(return_set) }; // var actionType = (getAttrByName(charid, action_prefix + "attack_flag") == "on" ? "ATTACK" : "INFOCARD"); // return_set.push("PCA-NAME|" + attackname); // return_set.push("PCA-DMGBASE|" + getAttrByName(charid, action_prefix + "dmgbase")); // return_set.push("PCA-DMGTYPE|" + getAttrByName(charid, action_prefix + "dmgtype")); // var atkattr = getAttrByName(charid, action_prefix + "atkattr_base"); // return_set.push("PCA-ATKATTR|" + atkattr.substring(2,3).toUpperCase(); // return_set.push("PCA-ATKATTRBONUS|" + atkattr.substring( // return_set.push("PCA-DMGATTR|" + getAttrByName(charid, action_prefix + "dmgattr").substring(2,3)).toUpperCase(); // return_set.push("PCA-PROF|" + + getAttrByName(charid, action_prefix + "atkprofflag")); // return_set.push("NPCA-DESCRIPTION|" + getAttrByName(charid, action_prefix + "description")); var action_attrs = filterObjs(function(z) { return (z.get("characterid") == charid &amp;&amp; z.get("name").startsWith(action_prefix)); }) action_attrs.forEach(function(z) { if (!(z.get("name").startsWith(action_prefix + "rollbase"))) { return_set.push("PCA-"+z.get("name").replace(action_prefix,"") + "|" + z.get("current")); } }) //log(return_set); return (return_set); Is this area working or are you still testing to see how hard it would be to get it to work? Are you planning on making this a functional area in the future?
Kurt J. said: Theodore S. said: Here is my macro: !power {{ --format|atwill --whisper|GM --tokenid|@{selected|token_id} --name|@{selected|character_name} --leftsub|Spell Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --npc_attribute_summary|@{selected|character_id} --Speed:|@{selected|npc_speed} --npc_qualities_summary|@{selected|character_id} --npc_skill_summary|@{selected|character_id} --npc_action_list|@{selected|character_id} --npc_legendaryaction_list|@{selected|character_id} --npc_reaction_list|@{selected|character_id} --npc_traits_list|@{selected|character_id} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} NPC Actions are great except for the npc_skill_summary and npc_traits_list line when they don't have any. That's because it is "npc_skills_summary" and "npc_trait_list" (you have "skill" and "traits")... The Wiki had them wrong (fixing it now). I know that is not exactly internally consistent :) When a list is empty it just won't display anything. I'll probably add both variations as acceptable (so both "npc_skill_summary" and "npc_skills_summary" will do the same thing). !power {{ --format|atwill --whisper|GM --tokenid|@{selected|token_id} --name|@{selected|character_name} --leftsub|Spell Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --npc_attribute_summary|@{selected|character_id} --Speed:|@{selected|npc_speed} --npc_qualities_summary|@{selected|character_id} --npc_skills_summary|@{selected|character_id} --npc_action_list|@{selected|character_id} --npc_legendaryaction_list|@{selected|character_id} --npc_reaction_list|@{selected|character_id} --npc_trait_list|@{selected|character_id} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} That worked on my NPCs. Thanks for the quick info.
Is this issue ever going to be fixed or a workaround for it? In the situation of a "Successful saving throw causes half damage": [[ [^Roll] / 2 ]] damage I know there are other APIs that can do what I am looking for but I love how Power Cards/Alter Bar work together and reduce my work.
1534471025
Kurt J.
Pro
API Scripter
Theodore S. said: Theodore S. said: Looking through the code, I see a section that intrigues me: function getPCAttack(charid, attackname) {&nbsp; var return_set = []; try { var action_prefix = filterObjs(function(z) { return (z.get("characterid") == charid &amp;&amp; z.get("name").startsWith("repeating_attack") &amp;&amp; z.get("name").endsWith("atkname")); }) .filter(entry =&gt; entry.get("current") == attackname)[0] .get("name").slice(0,-7); } catch (e) { return(return_set) }; // var actionType = (getAttrByName(charid, action_prefix + "attack_flag") == "on" ? "ATTACK" : "INFOCARD"); // return_set.push("PCA-NAME|" + attackname); // return_set.push("PCA-DMGBASE|" + getAttrByName(charid, action_prefix + "dmgbase")); // return_set.push("PCA-DMGTYPE|" + getAttrByName(charid, action_prefix + "dmgtype")); // var atkattr = getAttrByName(charid, action_prefix + "atkattr_base"); // return_set.push("PCA-ATKATTR|" + atkattr.substring(2,3).toUpperCase(); // return_set.push("PCA-ATKATTRBONUS|" + atkattr.substring( // return_set.push("PCA-DMGATTR|" + getAttrByName(charid, action_prefix + "dmgattr").substring(2,3)).toUpperCase(); // return_set.push("PCA-PROF|" + + getAttrByName(charid, action_prefix + "atkprofflag")); // return_set.push("NPCA-DESCRIPTION|" + getAttrByName(charid, action_prefix + "description")); var action_attrs = filterObjs(function(z) { return (z.get("characterid") == charid &amp;&amp; z.get("name").startsWith(action_prefix)); }) action_attrs.forEach(function(z) { if (!(z.get("name").startsWith(action_prefix + "rollbase"))) { return_set.push("PCA-"+z.get("name").replace(action_prefix,"") + "|" + z.get("current")); } }) //log(return_set); return (return_set); Is this area working or are you still testing to see how hard it would be to get it to work? Are you planning on making this a functional area in the future? Yes, that is something I'm working on... I just have been busy and haven't gotten back to it.
1534471626
Kurt J.
Pro
API Scripter
Theodore S. said: Is this issue ever going to be fixed or a workaround for it? In the situation of a "Successful saving throw causes half damage": [[ [^Roll] / 2 ]] damage I know there are other APIs that can do what I am looking for but I love how Power Cards/Alter Bar work together and reduce my work. Well, it is a pretty fundamental part of PowerCards that the results of a roll can't be used in another roll because of the way they are processed. That said, there are two types of workarounds - one you can do right now (include the /2 in the roll itself and apply it twice on a failed save) and one that I've got in 3.8.6 (which will be along in a few days). I've added ".halfbase" and ".halftotal" to the modifiers you can use when displaying the value of a roll, so [^Roll.halftotal] will be replaced with half (rounded down) of the total value of the roll.
Hi folks, is there a variation of the Spellbook that doesn't require a token to be selected to click the command buttons? For example I would like to create it as a Character sheet ability so players can use it from their macro bar even when tokens are not present. If I wipe all the "selected"s from the API call it throws errors into the API log (although the card itself does display). "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bless_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Create_or_Destroy_Water_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Cure_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Inflict_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Purify_Food_and_Drink_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Aid_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Blindness_Deafness_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Lesser_Restoration_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Prayer_of_Healing_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Spiritual_Weapon_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Beacon_of_Hope_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bestow_Curse_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Mass_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Revivify_macro" Here's my macro: !power {{ --emote|** @{character_name} grips his shield **&nbsp; --titlebackground|none&nbsp; --titlefontshadow|none --whisper|@{character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{character_name} --rightsub|Level @{level} @{class}^^ ^^ --**Spell Save DC**| [[ @{spell_save_dc}]] ^^**Spell Attack Bonus**&nbsp; [[@{spell_attack_bonus}]] --Number of Spells Known:| [[@{wisdom_mod} + @{Level} ]] ^^ --spell_slots|@{character_id} --spell_list|@{character_id} }}
1534495991

Edited 1534496083
Kurt J. said: Can you post the values for the @{CharNAME} for the ones that work and the ones that don't? My guess is that the ones that don't work start with R, C, J, or L, and are being misinterpreted as formatting characters (Left, Right, Center, and Justify). This only occurs because of the ~ in front of them, and the name being repeated in the tag (~R Something ~R) becomes right justified, but (~R Something) will be left alone. The question then becomes how to fix it. I have a couple of ideas... I could add a tag modifier that skipped inline formatting for that tag. This would be some character at the front of the tag like the hidden tag ($) or indent (^) modifiers. Alternatively (or perhaps in addition) I could introduce a tag that would disable inline formatting for the whole card. This would allow it to be placed in the Format tag, so you could update your format entry (Attack) in one place and not have to update every card. Welp. That's spot on. I hadn't even considered that. Considering the fact that the names in quest are "Lucas Lancardi", "Ralph Dingwall", and "Rabid Slave" (plus others) I think that's DEFINITELY the case. If you could add something to avoid that it would be amazing, and sorry for the hassle. However, if you're busy (or would rather not bother with something so minor), I can absolutely work around it for the moment by just splitting the buttons across two tags/lines. Really glad to know what was causing it though, since it was honestly driving me insane trying to work it out and I'd never even considered that it be getting mistaken for formatting code. Thanks a ton &lt;3
1534501029
Kurt J.
Pro
API Scripter
Evan said: Hi folks, is there a variation of the Spellbook that doesn't require a token to be selected to click the command buttons? For example I would like to create it as a Character sheet ability so players can use it from their macro bar even when tokens are not present. If I wipe all the "selected"s from the API call it throws errors into the API log (although the card itself does display). "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bless_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Create_or_Destroy_Water_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Cure_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Inflict_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Purify_Food_and_Drink_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Aid_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Blindness_Deafness_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Lesser_Restoration_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Prayer_of_Healing_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Spiritual_Weapon_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Beacon_of_Hope_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bestow_Curse_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Mass_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Revivify_macro" Here's my macro: !power {{ --emote|** @{character_name} grips his shield **&nbsp; --titlebackground|none&nbsp; --titlefontshadow|none --whisper|@{character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{character_name} --rightsub|Level @{level} @{class}^^ ^^ --**Spell Save DC**| [[ @{spell_save_dc}]] ^^**Spell Attack Bonus**&nbsp; [[@{spell_attack_bonus}]] --Number of Spells Known:| [[@{wisdom_mod} + @{Level} ]] ^^ --spell_slots|@{character_id} --spell_list|@{character_id} }} This is a side-effect of the fact that checking to see if an attribute exists logs that message to the API log. So far, I haven't found a good way around that. I could use a find/filter but those are pretty slow compared to just directly using GetAttrByName.
1534501113
Kurt J.
Pro
API Scripter
Morgan said: Kurt J. said: Can you post the values for the @{CharNAME} for the ones that work and the ones that don't? My guess is that the ones that don't work start with R, C, J, or L, and are being misinterpreted as formatting characters (Left, Right, Center, and Justify). This only occurs because of the ~ in front of them, and the name being repeated in the tag (~R Something ~R) becomes right justified, but (~R Something) will be left alone. The question then becomes how to fix it. I have a couple of ideas... I could add a tag modifier that skipped inline formatting for that tag. This would be some character at the front of the tag like the hidden tag ($) or indent (^) modifiers. Alternatively (or perhaps in addition) I could introduce a tag that would disable inline formatting for the whole card. This would allow it to be placed in the Format tag, so you could update your format entry (Attack) in one place and not have to update every card. Welp. That's spot on. I hadn't even considered that. Considering the fact that the names in quest are "Lucas Lancardi", "Ralph Dingwall", and "Rabid Slave" (plus others) I think that's DEFINITELY the case. If you could add something to avoid that it would be amazing, and sorry for the hassle. However, if you're busy (or would rather not bother with something so minor), I can absolutely work around it for the moment by just splitting the buttons across two tags/lines. Really glad to know what was causing it though, since it was honestly driving me insane trying to work it out and I'd never even considered that it be getting mistaken for formatting code. Thanks a ton &lt;3 I've added both of the methods I described above (more or less... I had to slightly vary one of them) to 3.8.6, which I'll push up to the development GIST in a couple of days.
Kurt J. said: I've added both of the methods I described above (more or less... I had to slightly vary one of them) to 3.8.6, which I'll push up to the development GIST in a couple of days. Thanks!!! That's amazingly helpful!
1534520437

Edited 1534520556
I am in the process of getting ready for the 3.8.6 update and can't get the macro to show damage if the saving throw is less than the DC: !power {{ --replacespell|@{selected|character_id}|Breath Weapon --api_setattr|_name @{selected|character_name} _modb _repeating_resource_$0_resource_right|-1 _silent --charid|@{selected|character_id} --tokenid|@{selected|token_id} --replaceattrs|S-|@{selected|character_id} --replaceattrs|T1-|@{target|1st|character_id} --replaceattrs|T2-|@{target|2nd|character_id} --replaceattrs|T3-|@{target|3rd|character_id} --replaceattrs|T4-|@{target|4th|character_id} --replaceattrs|T5-|@{target|5th|character_id} --replaceattrs|T6-|@{target|6th|character_id} --inlinereplace|CL|~S-L$ --emote|~S-CN$ ^^ uses ^^ Acid Breath --format|encounter --name|~SP-NAME$ --leftsub|Ranged Attack Spell --rightsub|~SP-RANGE$ --Casting Time:|~SP-CASTINGTIME$ --Duration:|~SP-DURATION$ --Saving Throw:|~SP-SAVE$ @{selected|breath_dc} --hroll|[[ [$Save1] ?{Target 1 Advantage?| Normal, 1d20 + ~T1-MDEX [DEX] | Advantage, 2d20KH1 + ~T1-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T1-MDEX$ [DEX] } ]] | [[ [$Save2] ?{Target 2 Advantage?| Normal, 1d20 + ~T2-MDEX [DEX] | Advantage, 2d20KH1 + ~T2-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T2-MDEX$ [DEX] } ]] | [[ [$Save3] ?{Target 3 Advantage?| Normal, 1d20 + ~T3-MDEX [DEX] | Advantage, 2d20KH1 + ~T3-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T3-MDEX$ [DEX] } ]] | [[ [$Save4] ?{Target 4 Advantage?| Normal, 1d20 + ~T4-MDEX [DEX] | Advantage, 2d20KH1 + ~T4-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T4-MDEX$ [DEX] } ]] | [[ [$Save5] ?{Target 5 Advantage?| Normal, 1d20 + ~T5-MDEX [DEX] | Advantage, 2d20KH1 + ~T5-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T5-MDEX$ [DEX] } ]] | [[ [$Save6] ?{Target 6 Advantage?| Normal, 1d20 + ~T6-MDEX [DEX] | Advantage, 2d20KH1 + ~T6-MDEX$ [DEX] | Disadvantage, 2d20KL1 + ~T6-MDEX$ [DEX] } ]] --Target1:|[^Save1] --Target2:|[^Save2] --Target3:|[^Save3] --Target4:|[^Save4] --Target5:|[^Save5] --Target6:|[^Save6] --?! ~CL$ -le 5 !? Damage:| [#[ [$dmg1] 2d6 ]#] Acid damage --?! ~CL$ -ge 6 AND ~CL$ -le 10 !? Damage:| [#[ [$dmg2] 3d6 ]#] Acid damage --?! ~CL$ -ge 11 AND ~CL$ -le 15 !? Damage:| [#[ [$dmg3] 4d6 ]#] Acid damage --?! ~CL$ -ge 16 !? Damage:| [#[ [$dmg4] 5d6 ]#] Acid damage --?! [^Save1] -lt @{selected|breath_dc} !? Acid1:|[^dmg1] Acid damage --?! [^Save2] -lt @{selected|breath_dc} !? Acid2:|[^dmg1] Acid damage --?! [^Save3] -lt @{selected|breath_dc} !? Acid3:|[^dmg1] Acid damage --?! [^Save4] -lt @{selected|breath_dc} !? Acid4:|[^dmg1] Acid damage --?! [^Save5] -lt @{selected|breath_dc} !? Acid5:|[^dmg1] Acid damage --?! [^Save6] -lt @{selected|breath_dc} !? Acid6:|[^dmg1] Acid damage --Description:|~SP-DESCRIPTION$ --?! ~CL$ -gt 5 !? Higher Level:|~SP-ATHIGHER$ --Breath Weapon Uses Left:|[[ @{selected|repeating_resource_$0_resource_right} - 1]] }} Any help would be appreciated. The section that isn't working is: --?! [^Save1] -lt @{selected|breath_dc} !? Acid1:|[^dmg1] Acid damage --?! [^Save2] -lt @{selected|breath_dc} !? Acid2:|[^dmg1] Acid damage --?! [^Save3] -lt @{selected|breath_dc} !? Acid3:|[^dmg1] Acid damage --?! [^Save4] -lt @{selected|breath_dc} !? Acid4:|[^dmg1] Acid damage --?! [^Save5] -lt @{selected|breath_dc} !? Acid5:|[^dmg1] Acid damage --?! [^Save6] -lt @{selected|breath_dc} !? Acid6:|[^dmg1] Acid damage
1534520630

Edited 1534521130
Kurt J. said: Evan said: Hi folks, is there a variation of the Spellbook that doesn't require a token to be selected to click the command buttons? For example I would like to create it as a Character sheet ability so players can use it from their macro bar even when tokens are not present. If I wipe all the "selected"s from the API call it throws errors into the API log (although the card itself does display). "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bless_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Create_or_Destroy_Water_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Cure_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Inflict_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Purify_Food_and_Drink_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Aid_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Blindness_Deafness_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Lesser_Restoration_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Prayer_of_Healing_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Spiritual_Weapon_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Beacon_of_Hope_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bestow_Curse_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Mass_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Revivify_macro" Here's my macro: !power {{ --emote|** @{character_name} grips his shield **&nbsp; --titlebackground|none&nbsp; --titlefontshadow|none --whisper|@{character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{character_name} --rightsub|Level @{level} @{class}^^ ^^ --**Spell Save DC**| [[ @{spell_save_dc}]] ^^**Spell Attack Bonus**&nbsp; [[@{spell_attack_bonus}]] --Number of Spells Known:| [[@{wisdom_mod} + @{Level} ]] ^^ --spell_slots|@{character_id} --spell_list|@{character_id} }} This is a side-effect of the fact that checking to see if an attribute exists logs that message to the API log. So far, I haven't found a good way around that. I could use a find/filter but those are pretty slow compared to just directly using GetAttrByName. Thanks for the reply Kurt, really appreciate your work on this awesome script! I guess if there's no tokens up the players can probably just pull up their character sheets anyway because the Spellbook macro is more of a shortcut to improve flow in combat. I'm also toying with the idea of just making a version of the macro like this (expanded to all the relevant spots obviously): @{wtype} &amp;{template:desc} {{desc= **CANTRIPS** [@{repeating_spell-cantrip_$0_spellname}](~repeating_spell-cantrip_$0_spell)[@{repeating_spell-cantrip_$1_spellname}](~repeating_spell-cantrip_$1_spell)[@{repeating_spell-cantrip_$2_spellname}](~repeating_spell-cantrip_$2_spell)[@{repeating_spell-cantrip_$3_spellname}](~repeating_spell-cantrip_$3_spell) }} It's a lot more work (and way less elegant) but it works with no tokens.
1534590726
Kurt J.
Pro
API Scripter
Evan said: Kurt J. said: Evan said: Hi folks, is there a variation of the Spellbook that doesn't require a token to be selected to click the command buttons? For example I would like to create it as a Character sheet ability so players can use it from their macro bar even when tokens are not present. If I wipe all the "selected"s from the API call it throws errors into the API log (although the card itself does display). "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bless_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Create_or_Destroy_Water_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Cure_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Inflict_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Purify_Food_and_Drink_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Aid_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Blindness_Deafness_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Lesser_Restoration_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Prayer_of_Healing_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Spiritual_Weapon_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Beacon_of_Hope_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bestow_Curse_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Mass_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Revivify_macro" Here's my macro: !power {{ --emote|** @{character_name} grips his shield **&nbsp; --titlebackground|none&nbsp; --titlefontshadow|none --whisper|@{character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{character_name} --rightsub|Level @{level} @{class}^^ ^^ --**Spell Save DC**| [[ @{spell_save_dc}]] ^^**Spell Attack Bonus**&nbsp; [[@{spell_attack_bonus}]] --Number of Spells Known:| [[@{wisdom_mod} + @{Level} ]] ^^ --spell_slots|@{character_id} --spell_list|@{character_id} }} This is a side-effect of the fact that checking to see if an attribute exists logs that message to the API log. So far, I haven't found a good way around that. I could use a find/filter but those are pretty slow compared to just directly using GetAttrByName. Thanks for the reply Kurt, really appreciate your work on this awesome script! I guess if there's no tokens up the players can probably just pull up their character sheets anyway because the Spellbook macro is more of a shortcut to improve flow in combat. I'm also toying with the idea of just making a version of the macro like this (expanded to all the relevant spots obviously): @{wtype} &amp;{template:desc} {{desc= **CANTRIPS** [@{repeating_spell-cantrip_$0_spellname}](~repeating_spell-cantrip_$0_spell)[@{repeating_spell-cantrip_$1_spellname}](~repeating_spell-cantrip_$1_spell)[@{repeating_spell-cantrip_$2_spellname}](~repeating_spell-cantrip_$2_spell)[@{repeating_spell-cantrip_$3_spellname}](~repeating_spell-cantrip_$3_spell) }} It's a lot more work (and way less elegant) but it works with no tokens. You should be able to specify a character name instead of selected, so @{fred|character_id}, @{fred|character_name}, etc, which would then work without tokens. The macro would just have to be specific to each character then.
1534603144

Edited 1534636217
Kurt J. said: Evan said: Kurt J. said: Evan said: Hi folks, is there a variation of the Spellbook that doesn't require a token to be selected to click the command buttons? For example I would like to create it as a Character sheet ability so players can use it from their macro bar even when tokens are not present. If I wipe all the "selected"s from the API call it throws errors into the API log (although the card itself does display). "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bless_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Create_or_Destroy_Water_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Cure_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Inflict_Wounds_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Purify_Food_and_Drink_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Aid_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Blindness_Deafness_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Lesser_Restoration_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Prayer_of_Healing_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Spiritual_Weapon_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Beacon_of_Hope_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Bestow_Curse_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Mass_Healing_Word_macro" "Error: No attribute or sheet field found for character_id -L4vycyMq3w7NQ56wz_E named spell_Revivify_macro" Here's my macro: !power {{ --emote|** @{character_name} grips his shield **&nbsp; --titlebackground|none&nbsp; --titlefontshadow|none --whisper|@{character_name},GM --corners|10 --format|atwill --name|^^Spell Book --leftsub|@{character_name} --rightsub|Level @{level} @{class}^^ ^^ --**Spell Save DC**| [[ @{spell_save_dc}]] ^^**Spell Attack Bonus**&nbsp; [[@{spell_attack_bonus}]] --Number of Spells Known:| [[@{wisdom_mod} + @{Level} ]] ^^ --spell_slots|@{character_id} --spell_list|@{character_id} }} This is a side-effect of the fact that checking to see if an attribute exists logs that message to the API log. So far, I haven't found a good way around that. I could use a find/filter but those are pretty slow compared to just directly using GetAttrByName. Thanks for the reply Kurt, really appreciate your work on this awesome script! I guess if there's no tokens up the players can probably just pull up their character sheets anyway because the Spellbook macro is more of a shortcut to improve flow in combat. I'm also toying with the idea of just making a version of the macro like this (expanded to all the relevant spots obviously): @{wtype} &amp;{template:desc} {{desc= **CANTRIPS** [@{repeating_spell-cantrip_$0_spellname}](~repeating_spell-cantrip_$0_spell)[@{repeating_spell-cantrip_$1_spellname}](~repeating_spell-cantrip_$1_spell)[@{repeating_spell-cantrip_$2_spellname}](~repeating_spell-cantrip_$2_spell)[@{repeating_spell-cantrip_$3_spellname}](~repeating_spell-cantrip_$3_spell) }} It's a lot more work (and way less elegant) but it works with no tokens. You should be able to specify a character name instead of selected, so @{fred|character_id}, @{fred|character_name}, etc, which would then work without tokens. The macro would just have to be specific to each character then. I was trying to avoid references to character names, as I know they might change in the future, but I accept it's probably the best way to achieve my goals at this point. My assumption from fiddling around with Character Sheet Abilities macros, was that the Character the sheet referred to was inherent, so any calls to sheet attributes would be assumed to be for that character. What I'm gathering is that some of the awesomeness in PowerCards needs a more literal declaration of the desired character to work? Once again, thanks for your contribution to the community! edit: I tried referencing a Character name ahead of their id for the last two commands in the macro, but the buttons in the spellbook still complain that no token is selected. I'm guessing there's something in the --spell_list command/function that creates the buttons to use @{selected} when it calls the spell in question? edit 2 : looks like that's the case--here's the HTML for one of the spell buttons it generates (emphasis mine): &lt;a href="~ selected |repeating_spell-cantrip_-LAkeztM2HEwlPL4ZN5q_spell"&gt;Guidance&lt;/a&gt; So... can I put in a low-priority request to have a second version of --spell_list that doesn't append selected onto the command buttons it creates :) TIA. For my purposes, replacing selected with @{character_id} would suffice as the spellbook is being generated from a character sheet. edit 3 : I had a quick look at the script and forked it to test without the selected keyword in there. Seems to work OK. Hopefully I'm not out of line with my suggested commit.
1534874908

Edited 1534874980
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Button Macros are not working with power cards...Help! When I test a macro that is a power card is works. Then I save it and then when button is pressed it spits out the code and doesnt work but only with conditionals. Am I missing something?
Scott S. said: Button Macros are not working with power cards...Help! When I test a macro that is a power card is works. Then I save it and then when button is pressed it spits out the code and doesnt work but only with conditionals. Am I missing something? Post code you are using.
1534876496

Edited 1534876719
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
!power {{ &nbsp;--format|basic &nbsp;--name|Test Name &nbsp;--Roll:|[[ [$Atk] [NH]3d6 ]] vs #ESL &nbsp;--?! $Atk -eq 3 OR 4 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 5 -and #ESL -ge 15 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 6 -and #ESL -ge 16 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 17 !? !Result:|Critical Fail!! &nbsp;--?! $Atk -eq 18 !? !Result:|Critical Fail!! &nbsp;--?! $Atk -le #ESL !? !Result:|Success!! &nbsp;--?! $Atk -gt #ESL !? !Result:|Fail!! &nbsp; }} The reason I am doing this is I cannot get my !GURPS roll parser to work with power cards.
Scott S. said: !power {{ &nbsp;--format|basic &nbsp;--name|Test Name &nbsp;--Roll:|[[ [$Atk] [NH]3d6 ]] vs #ESL &nbsp;--?! $Atk -eq 3 OR 4 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 5 -and #ESL -ge 15 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 6 -and #ESL -ge 16 !? !Result:|Critical Success!! &nbsp;--?! $Atk -eq 17 !? !Result:|Critical Fail!! &nbsp;--?! $Atk -eq 18 !? !Result:|Critical Fail!! &nbsp;--?! $Atk -le #ESL !? !Result:|Success!! &nbsp;--?! $Atk -gt #ESL !? !Result:|Fail!! &nbsp; }} The reason I am doing this is I cannot get my !GURPS roll parser to work with power cards. I have a feeling the #ESL is the break point. Also, I would change the line to: --?! $Atk -eq 3 -or $Atk -eq 4 !? !Result:|Critical Sucess!!
1534882903

Edited 1534883680
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Thanks that fixed it here is the result: !power {{ &nbsp;--format|basic &nbsp;--name|Test Name &nbsp;--Roll:|[[ [$Atk] [NH]3d6 ]] vs #ESL &nbsp;--?! $Atk -eq 3 -and #ESL -le 15 !? !Result*1:|Critical Success!! &nbsp;--?! $Atk -eq 4 -and #ESL -le 15 !? !Result*2:|Critical Success!! &nbsp;--?! $Atk -eq 5 -and #ESL -ge 15 !? !Result*3:|Critical Success!! &nbsp;--?! $Atk -eq 6 -and #ESL -ge 16 !? !Result*5:|Critical Success!! &nbsp;--?! $Atk -le #ESL !? !Result*6:|Success!! &nbsp;--?! $Atk -eq 17 !? !Result*8:|Critical Fail!! &nbsp;--?! $Atk -eq 18 !? !Result*9:|Critical Fail!! --?! $Atk -gt #ESL !? !Result*7:|Fail!! &nbsp; }} What I'd like to do is get this api to send to power cards. on("chat:message", function(msg) { if(msg.type === "api" &amp;&amp; msg.content.indexOf("!gurps ") !== -1) { var level = Number(msg.content.split(" ")[1]); var roll = randomInteger(6) + randomInteger(6) + randomInteger(6); var margin = level - roll; var result; if(roll &lt;= level) { result = "Success"; } else { result = "Failure"; } if(roll === 3 || roll === 4) { result = "Critical Success"; } if(roll === 5 &amp;&amp; level &gt;= 15) { result = "Critical Success"; } if(roll === 6 &amp;&amp; level &gt;= 16) { result = "Critical Success"; } if(roll === 18) { result = "Critical Failure"; } if(roll === 17 &amp;&amp; level &lt;= 15) { result = "Critical Failure"; } if(margin &lt;= -10) { result = "Critical Failure"; } sendChat(msg.who, "&amp;{template:default} {{name=Roll vs. Effective Skill " + level.toString() + "}} {{Roll=" + roll.toString() + "}} {{Result=" + result + "}}"); } });
Is there a way to get the results of a roll so that you can see each die?&nbsp; In chat I can write "/roll @{selected|attack}d6sa" and I can see what each die rolled and they are sorted in ascending order.
1534931947
GiGs
Pro
Sheet Author
API Scripter
Michael D. said: Is there a way to get the results of a roll so that you can see each die?&nbsp; In chat I can write "/roll @{selected|attack}d6sa" and I can see what each die rolled and they are sorted in ascending order. There's an XPND function described in the wiki that preserves each roll but you still have to hover over the result to see it, a far as I can tell. is there some way to have those dice rolls shown openly?
G G said: Michael D. said: Is there a way to get the results of a roll so that you can see each die?&nbsp; In chat I can write "/roll @{selected|attack}d6sa" and I can see what each die rolled and they are sorted in ascending order. There's an XPND function described in the wiki that preserves each roll but you still have to hover over the result to see it, a far as I can tell. is there some way to have those dice rolls shown openly? I believe that is what the XPND command is for.
1534944323
GiGs
Pro
Sheet Author
API Scripter
When I've used the XPND command it hasnt printed it out, it just shows the dice in the hovertext. Whats the proper syntax for using it to reveal the dice without needing to use hovertext?
1534947172
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
What is the syntax to send an api output back into power cards for processing?
1534967731
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Still beating my brain in trying to get this to work within power cards without having to run the command !gurps. on("chat:message", function(msg) { &nbsp; &nbsp; if(msg.type === "api" &amp;&amp; msg.content.indexOf("!gurps ") !== -1) { &nbsp; &nbsp; &nbsp; &nbsp; var level = Number(msg.content.split(" ")[1]); &nbsp; &nbsp; &nbsp; &nbsp; var roll = randomInteger(6) + randomInteger(6) + randomInteger(6); &nbsp; &nbsp; &nbsp; &nbsp; var margin = level - roll; &nbsp; &nbsp; &nbsp; &nbsp; var result; &nbsp; &nbsp; &nbsp; &nbsp; if(roll &lt;= level) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Success";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Failure";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(roll === 3 || roll === 4) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Success"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(roll === 5 &amp;&amp; level &gt;= 15) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Success"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(roll === 6 &amp;&amp; level &gt;= 16) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Success"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(roll === 18) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Failure"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(roll === 17 &amp;&amp; level &lt;= 15) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Failure"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; if(margin &lt;= -10) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = "Critical Failure"; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; sendChat(msg.who, "!power {{ --format|basic --name|Roll vs. Effective Skill " + level.toString() + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; " --leftsub|Roll: " + roll.toString() + " --rightsub|Result: " + result + "}}"); &nbsp; &nbsp; } });
Theodore S. said: I believe that is what the XPND command is for. Thanks, that does work.&nbsp; All the rolls show up without needing to hover.&nbsp; It will even sort them if you use something like "6d6sa".&nbsp; It does put the sum in there as well so I may just end up trying to come up with a script.
G G said: When I've used the XPND command it hasnt printed it out, it just shows the dice in the hovertext. Whats the proper syntax for using it to reveal the dice without needing to use hovertext? Did you do something like [[ [XPND] 3d6 ]] ?