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)

Hi Patrick, thanks for the advice. But alas, it gives the same error. Patrick said: Try adding a $ before each of the named variables like below. Also, an afterthought... not sure that you can have one that is separated by a space. Might need to try [$Chain_Shirt] instead. ?{ Selling armor |Breastplate, [[75 [$Breastplate] ]] |Chain Shirt, [[ 25 [$Chain Shirt] ]] } Ravenknight said: Hi guys. I'm having a problem. I've created a haggle-macro for players that want to sell stuff in town. The prices are kept in a drop down menu on the merchant token bar2|max ?{ Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]] } I can access the price using @{selected|bar2|max} outside of Powercards just fine but when used within Powercards I get the following message: Any ideas?
1537919251

Edited 1537919390
Ravenknight said: Hi Patrick, thanks for the advice. But alas, it gives the same error. Patrick said: Try adding a $ before each of the named variables like below. Also, an afterthought... not sure that you can have one that is separated by a space. Might need to try [$Chain_Shirt] instead. ?{ Selling armor |Breastplate, [[75 [$Breastplate] ]] |Chain Shirt, [[ 25 [$Chain Shirt] ]] } Ravenknight said: Hi guys. I'm having a problem. I've created a haggle-macro for players that want to sell stuff in town. The prices are kept in a drop down menu on the merchant token bar2|max ?{ Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]] } I can access the price using @{selected|bar2|max} outside of Powercards just fine but when used within Powercards I get the following message: Any ideas? If I knew the exact macro you are trying to use, I would be able to assist you as I have made some intricate PowerCard Macros using the drop-down menu for my games. Please post the full PowerCard macro. Also, what is the intended result?
1537919397
Kurt J.
Pro
API Scripter
Theodore S. said: Ravenknight said: Hi Patrick, thanks for the advice. But alas, it gives the same error. Patrick said: Try adding a $ before each of the named variables like below. Also, an afterthought... not sure that you can have one that is separated by a space. Might need to try [$Chain_Shirt] instead. ?{ Selling armor |Breastplate, [[75 [$Breastplate] ]] |Chain Shirt, [[ 25 [$Chain Shirt] ]] } Ravenknight said: Hi guys. I'm having a problem. I've created a haggle-macro for players that want to sell stuff in town. The prices are kept in a drop down menu on the merchant token bar2|max ?{ Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]] } I can access the price using @{selected|bar2|max} outside of Powercards just fine but when used within Powercards I get the following message: Any ideas? If I knew the exact macro you are trying to use, I would be able to assist you as I have made some intricate PowerCard Macros using the drop-down menu for my games. Please post the full PowerCard macro. Theodore is right... We would need to see the PowerCard macro. It is likely a pre-parsing issue, and would need [[ and ]] replaced by [#[ and ]#] to hide them from the chat server.
1537920454

Edited 1537920515
Kurt, what is your plans for the next update? FYI, PowerCards work awesomely with the Javascript option.
1537938539

Edited 1537939480
Ravenknight
KS Backer
Theodore S. said: If I knew the exact macro you are trying to use, I would be able to assist you as I have made some intricate PowerCard Macros using the drop-down menu for my games. Please post the full PowerCard macro. Also, what is the intended result? Kurt J. said: Theodore is right... We would need to see the PowerCard macro. It is likely a pre-parsing issue, and would need [[ and ]] replaced by [#[ and ]#] to hide them from the chat server. Thanks guys! Here we go. !power {{ --emote|@{target|Who is selling?|token_name} goes looking for a buyer. --tokenid|@{target|Who is selling?|token_id} --format|atwill --Base price:|@{selected|bar2|max} gp --Haggle Check|[[ [NH] [$Price] ?{Time spent haggling?|Don't Haggle, 1d1 [Quick Sell]|1 day, 1d20+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [1 day]|3 days, 2d20kh1+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [3 days]|1 hour, 2d20kl1+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [1 hour]} ]] --?? $Price.base == 1 OR $Price.total <= 10?? !Result|Selling one piece for [[round(0.1*@{selected|bar2|max}) ]] gp --?? $Price.total >= 11 AND $Price.total <= 15 ?? !Result|Selling up to two pieces for [[round(0.25*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 16 AND $Price.total <= 20 ?? !Result|Selling up to three pieces for [[round(0.5*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 21 AND $Price.total <= 24 ?? !Result|Selling up to four pieces for [[round(0.75*@{selected|bar2|max}) ]] gp a piece --?? $Price.total == 25 ?? !Result|Selling up to five pieces for [[round(1*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 26 ?? !Result|Selling up to five pieces for [[round(1.25*@{selected|bar2|max}) ]] gp a piece }} And this line in Bar2|Max on the trader. ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]}
I'm not sure if this is possible, but I was hoping to make a generic API call (to ChatSetAttr) but based on a conditional. Essentially, I'm using a rollID to test if a weapon is ranged, then if it is, I want to make an API call to reduce ammo by 1 (I'm using Shaped Sheet). Is that possible? The --api_ tag doesn't seem like it can be used within a conditional, but maybe I'm missing something. Thanks!
another question I have for your Kurt. Would it be possible to add delay to fx options?. For example when i beam fire I would like it that the target catch flame after the effect of the beam wears off. Something similar like the delay tag in Roll20 AM. No idea if this is possible at all, but could be kind of cool
1537957998

Edited 1537958034
Gromduraz said: I'm not sure if this is possible, but I was hoping to make a generic API call (to ChatSetAttr) but based on a conditional. Essentially, I'm using a rollID to test if a weapon is ranged, then if it is, I want to make an API call to reduce ammo by 1 (I'm using Shaped Sheet). Is that possible? The --api_ tag doesn't seem like it can be used within a conditional, but maybe I'm missing something. Thanks! In 5e OGL, this is what I have done: !power {{ --inlinereplace|WEP|?{Which weapon?|Dagger|Dart|Sickle} --inlinereplace|THROWN|?{Thrown?|No|Yes} --inlinereplace|HAND|?{Which hand?|Main|Offhand} --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --target_list|@{target|token_id} --emote|~S-CN$ ^^ attacks ^^ ~T-CN$ --tokenid|@{selected|token_id} --format|encounter --corners|10 --name|~WEP$ --leftsub|~S-CN$ --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" !? !Range*1:|**Range**: 5 feet --?! "~WEP$" -eq "Sickle" !? !Range*2:|**Range**: 5 feet --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" !? !Range*3:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dart" !? !Range*4:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dagger" -or "~WEP$" -eq "Dart" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! "~WEP$" -eq "Sickle" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! $Atk -lt ~T-AC$ -and $Atk.base -gt 1 !? !Missed|**You missed!** --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*1:|You caused [#[ [$dmg] floor((1d6 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*2:|You caused [#[ [$dmg1] floor(1d6 [DEX] / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*3:|You caused [#[ [$dmg2] floor((1d4 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*4:|You caused [#[ [$dmg3] floor((1d4 + ~S-MSTR$ [STR]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and $Atk.base -eq 20 !? !Critical Hit*1:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Critical Hit*2:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Critical Hit*3:|**Critical Effect:** [#[ [TXT] 1t[Hit-Slashing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" -and $Atk.base -eq 1 !? !Fumble*1:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" -and $Atk.base -eq 1 !? !Fumble*2:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 1 !? !Fumble*3:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 1 !? !Fumble*4:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk.base -eq 20 !? !Normal*1:|**Damage**: [^dmg] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk.base -eq 20 !? !Normal*2:|**Damage**: [^dmg1] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Normal*3:|**Damage**: [^dmg2] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Normal*4:|**Damage**: [^dmg3] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^dmg] _show|all --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar3|_target|@{target|token_id} _bar|3 _amount|-[^dmg2] _show|all --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar4|_target|@{target|token_id} _bar|3 _amount|-[^dmg3] _show|all }} The lines --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent tell the API if the conditions are met, reduce the ammo by 1 and add 1 to expended ammo. I hope that helps.
Ravenknight said: Theodore S. said: If I knew the exact macro you are trying to use, I would be able to assist you as I have made some intricate PowerCard Macros using the drop-down menu for my games. Please post the full PowerCard macro. Also, what is the intended result? Kurt J. said: Theodore is right... We would need to see the PowerCard macro. It is likely a pre-parsing issue, and would need [[ and ]] replaced by [#[ and ]#] to hide them from the chat server. Thanks guys! Here we go. !power {{ --emote|@{target|Who is selling?|token_name} goes looking for a buyer. --tokenid|@{target|Who is selling?|token_id} --format|atwill --Base price:|@{selected|bar2|max} gp --Haggle Check|[[ [NH] [$Price] ?{Time spent haggling?|Don't Haggle, 1d1 [Quick Sell]|1 day, 1d20+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [1 day]|3 days, 2d20kh1+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [3 days]|1 hour, 2d20kl1+[[@{target|Who is selling?|persuasion_bonus}]] [persuasion] + [[@{target|Who is selling?|insight_bonus}]] [1 hour]} ]] --?? $Price.base == 1 OR $Price.total <= 10?? !Result|Selling one piece for [[round(0.1*@{selected|bar2|max}) ]] gp --?? $Price.total >= 11 AND $Price.total <= 15 ?? !Result|Selling up to two pieces for [[round(0.25*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 16 AND $Price.total <= 20 ?? !Result|Selling up to three pieces for [[round(0.5*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 21 AND $Price.total <= 24 ?? !Result|Selling up to four pieces for [[round(0.75*@{selected|bar2|max}) ]] gp a piece --?? $Price.total == 25 ?? !Result|Selling up to five pieces for [[round(1*@{selected|bar2|max}) ]] gp a piece --?? $Price.total >= 26 ?? !Result|Selling up to five pieces for [[round(1.25*@{selected|bar2|max}) ]] gp a piece }} And this line in Bar2|Max on the trader. ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]} Unfortunately, it converts the ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]} to a number so I don't believe that will work but I am sure you could make a macro that would have the person input price of item and use the haggle to determine how much they sell it for.
Theodore S. said: Unfortunately, it converts the ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]} to a number so I don't believe that will work but I am sure you could make a macro that would have the person input price of item and use the haggle to determine how much they sell it for. Yea, I believe you're right. It works fine with just the numbers to be honest, but I kinda like the ability to be able to hover and see what's been sold. Oh well.
1537992681

Edited 1538000674
EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! This is perfect - you are awesome. I'm always inspired to see all the ways people use Powercards.  Theodore S. said: Gromduraz said: I'm not sure if this is possible, but I was hoping to make a generic API call (to ChatSetAttr) but based on a conditional. Essentially, I'm using a rollID to test if a weapon is ranged, then if it is, I want to make an API call to reduce ammo by 1 (I'm using Shaped Sheet). Is that possible? The --api_ tag doesn't seem like it can be used within a conditional, but maybe I'm missing something. Thanks! In 5e OGL, this is what I have done: !power {{ --inlinereplace|WEP|?{Which weapon?|Dagger|Dart|Sickle} --inlinereplace|THROWN|?{Thrown?|No|Yes} --inlinereplace|HAND|?{Which hand?|Main|Offhand} --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --target_list|@{target|token_id} --emote|~S-CN$ ^^ attacks ^^ ~T-CN$ --tokenid|@{selected|token_id} --format|encounter --corners|10 --name|~WEP$ --leftsub|~S-CN$ --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" !? !Range*1:|**Range**: 5 feet --?! "~WEP$" -eq "Sickle" !? !Range*2:|**Range**: 5 feet --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" !? !Range*3:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dart" !? !Range*4:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dagger" -or "~WEP$" -eq "Dart" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! "~WEP$" -eq "Sickle" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! $Atk -lt ~T-AC$ -and $Atk.base -gt 1 !? !Missed|**You missed!** --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*1:|You caused [#[ [$dmg] floor((1d6 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*2:|You caused [#[ [$dmg1] floor(1d6 [DEX] / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*3:|You caused [#[ [$dmg2] floor((1d4 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*4:|You caused [#[ [$dmg3] floor((1d4 + ~S-MSTR$ [STR]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and $Atk.base -eq 20 !? !Critical Hit*1:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Critical Hit*2:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Critical Hit*3:|**Critical Effect:** [#[ [TXT] 1t[Hit-Slashing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" -and $Atk.base -eq 1 !? !Fumble*1:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" -and $Atk.base -eq 1 !? !Fumble*2:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 1 !? !Fumble*3:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 1 !? !Fumble*4:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk.base -eq 20 !? !Normal*1:|**Damage**: [^dmg] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk.base -eq 20 !? !Normal*2:|**Damage**: [^dmg1] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Normal*3:|**Damage**: [^dmg2] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Normal*4:|**Damage**: [^dmg3] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^dmg] _show|all --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar3|_target|@{target|token_id} _bar|3 _amount|-[^dmg2] _show|all --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar4|_target|@{target|token_id} _bar|3 _amount|-[^dmg3] _show|all }} The lines --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent tell the API if the conditions are met, reduce the ammo by 1 and add 1 to expended ammo. I hope that helps.
Honestly, it could be the template. That is why I use the --inlinereplace instead of templates. I would love to see your coding to see what may be happening. The way I use the PowerCards currently like example below is for the player to do an auto-attack on a monster. No manually deducting hit points from monsters for me unless they critical hit or critical fail. Gromduraz said: EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! This is perfect - you are awesome. I'm always inspired to see all the ways people use Powercards.  Theodore S. said: Gromduraz said: I'm not sure if this is possible, but I was hoping to make a generic API call (to ChatSetAttr) but based on a conditional. Essentially, I'm using a rollID to test if a weapon is ranged, then if it is, I want to make an API call to reduce ammo by 1 (I'm using Shaped Sheet). Is that possible? The --api_ tag doesn't seem like it can be used within a conditional, but maybe I'm missing something. Thanks! In 5e OGL, this is what I have done: !power {{ --inlinereplace|WEP|?{Which weapon?|Dagger|Dart|Sickle} --inlinereplace|THROWN|?{Thrown?|No|Yes} --inlinereplace|HAND|?{Which hand?|Main|Offhand} --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --target_list|@{target|token_id} --emote|~S-CN$ ^^ attacks ^^ ~T-CN$ --tokenid|@{selected|token_id} --format|encounter --corners|10 --name|~WEP$ --leftsub|~S-CN$ --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" !? !Range*1:|**Range**: 5 feet --?! "~WEP$" -eq "Sickle" !? !Range*2:|**Range**: 5 feet --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" !? !Range*3:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dart" !? !Range*4:|**Range**: 20/60 feet --?! "~WEP$" -eq "Dagger" -or "~WEP$" -eq "Dart" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! "~WEP$" -eq "Sickle" !? Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MSTR$ [STR] + ~S-PB$ [PROF] } + ?{Flanking?|No, 0|Yes, 2} [FLANK] ]] --?! $Atk -lt ~T-AC$ -and $Atk.base -gt 1 !? !Missed|**You missed!** --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*1:|You caused [#[ [$dmg] floor((1d6 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*2:|You caused [#[ [$dmg1] floor(1d6 [DEX] / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*3:|You caused [#[ [$dmg2] floor((1d4 + ~S-MDEX$ [DEX]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*4:|You caused [#[ [$dmg3] floor((1d4 + ~S-MSTR$ [STR]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~WEP$" -eq "Dagger" -and $Atk.base -eq 20 !? !Critical Hit*1:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Critical Hit*2:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Critical Hit*3:|**Critical Effect:** [#[ [TXT] 1t[Hit-Slashing-(Lv.5-8)] ]#] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "No" -and $Atk.base -eq 1 !? !Fumble*1:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~THROWN$" -eq "Yes" -and $Atk.base -eq 1 !? !Fumble*2:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 1 !? !Fumble*3:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 1 !? !Fumble*4:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk.base -eq 20 !? !Normal*1:|**Damage**: [^dmg] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk.base -eq 20 !? !Normal*2:|**Damage**: [^dmg1] piercing damage --?! "~WEP$" -eq "Dart" -and $Atk.base -eq 20 !? !Normal*3:|**Damage**: [^dmg2] piercing damage --?! "~WEP$" -eq "Sickle" -and $Atk.base -eq 20 !? !Normal*4:|**Damage**: [^dmg3] piercing damage --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^dmg] _show|all --?! "~WEP$" -eq "Dagger" -and "~HAND$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! "~WEP$" -eq "Dart" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar3|_target|@{target|token_id} _bar|3 _amount|-[^dmg2] _show|all --?! "~WEP$" -eq "Sickle" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar4|_target|@{target|token_id} _bar|3 _amount|-[^dmg3] _show|all }} The lines --?! "~WEP$" -eq "Dart" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~WEP$" -eq "Dart" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent tell the API if the conditions are met, reduce the ammo by 1 and add 1 to expended ammo. I hope that helps.
1538006604

Edited 1538006619
Kurt J.
Pro
API Scripter
Gromduraz said: EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! Replacement tags can be used in conjunction with templates (and I do that ALOT), but not inside templates... too may opportunities for circular nesting (ie, a template that includes a replacement that includes a template, etc). :)
1538006893
Kurt J.
Pro
API Scripter
Ravenknight said: Theodore S. said: Unfortunately, it converts the ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]} to a number so I don't believe that will work but I am sure you could make a macro that would have the person input price of item and use the haggle to determine how much they sell it for. Yea, I believe you're right. It works fine with just the numbers to be honest, but I kinda like the ability to be able to hover and see what's been sold. Oh well. I've been playing around trying to get it to work... I think the crux of the issue that 75 [Breastplate] is being included inside the "round" statement, and it just doesn't know what to do with round(0.1 * 75 [Breastplate]) - which is true, though inconvenient :) I'll play around a bit and see if I can come up with a way to trick it into working...
Kurt J. said: Ravenknight said: Theodore S. said: Unfortunately, it converts the ?{Selling armor |Breastplate, [[75 [Breastplate] ]] |Chain Shirt, [[ 25 [Chain Shirt] ]]} to a number so I don't believe that will work but I am sure you could make a macro that would have the person input price of item and use the haggle to determine how much they sell it for. Yea, I believe you're right. It works fine with just the numbers to be honest, but I kinda like the ability to be able to hover and see what's been sold. Oh well. I've been playing around trying to get it to work... I think the crux of the issue that 75 [Breastplate] is being included inside the "round" statement, and it just doesn't know what to do with round(0.1 * 75 [Breastplate]) - which is true, though inconvenient :) I'll play around a bit and see if I can come up with a way to trick it into working... Thanks Kurt!
1538017226

Edited 1538025519
Kurt J. said: Gromduraz said: EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! Replacement tags can be used in conjunction with templates (and I do that ALOT), but not inside templates... too may opportunities for circular nesting (ie, a template that includes a replacement that includes a template, etc). :) Makes perfect sense. Thanks! EDIT: This raises another question though - using replacesection, is it possible to get the id/index of the entry found? For example, if I'm getting information about the class feature "Sneak Attack" using:  --replacesection|@{selected|character_id}|Sneak Attack|classfeature|name|CF- Would it be possible to get something like CF-id returning $0, or $1, depending on where it is in the class feature list? Thanks!
Gromduraz said: Kurt J. said: Gromduraz said: EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! Replacement tags can be used in conjunction with templates (and I do that ALOT), but not inside templates... too may opportunities for circular nesting (ie, a template that includes a replacement that includes a template, etc). :) Makes perfect sense. Thanks! EDIT: This raises another question though - using replacesection, is it possible to get the id/index of the entry found? For example, if I'm getting information about the class feature "Sneak Attack" using:  --replacesection|@{selected|character_id}|Sneak Attack|classfeature|name|CF- Would it be possible to get something like CF-id returning $0, or $1, depending on where it is in the class feature list? Thanks! Here is the way I handle Sneak Attack: !power {{ --inlinereplace|W|?{Which weapon?|Dagger|Shortsword|Shortbow} --inlinereplace|T|?(Thrown Weapon?|No|Yes} --inlinereplace|H|?{Which hand?|Main|Offhand} --inlinereplace|S|?{Sneak Attack?|No,0|Yes,3d6} --inlinereplace|F|?{Flanking?|No,0|Yes,2} --?! "~W$" -eq "Shortbow" !? api_setattr|_name @{selected|character_name} _modb _other_resource|-1 _silent --?! "~W$" -eq "Shortbow" !? api_setattr*1|_name @{selected|character_name} _modb _repeating_resource_$0_resource_left|+1 _silent --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --target_list|@{target|token_id} --emote|~S-CN$ ^^ attacks ^^ ~T-CN$ --tokenid|@{selected|token_id} --format|encounter --corners|10 --name|~W$ --?! "~W$" -eq "Dagger" -and "~T$" -eq "No" !? !Range*1:|**Range**: 5 feet --?! "~W$" -eq "Dagger" -and "~T$" -eq "Yes" !? !Range*2:|**Range**: 20/60 feet --?! "~W$" -eq "Shortsword" !? !Range*3:|**Range**: 5 feet --?! "~W$" -eq "Shortbow" !? !Range*4:|**Range**: 80/320 feet --!Attack*1|**Attack**: [[ [$Atk] ?{Advantage?| Normal, 1d20 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Advantage, 2d20KH1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] | Disadvantage, 2d20KL1 + ~S-MDEX$ [DEX] + ~S-PB$ [PROF] } + ~F$ [FLANK] ]] --?! $Atk -lt ~T-AC$ -and $Atk.base -gt 1 !? !Missed|**You missed!** --?! "~W$" -eq "Dagger" -and "~H$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*1:|You caused [#[ [$dmg] floor((1d4 + ~S-MDEX$ [DEX] + ~S$ [SNEAK]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~W$" -eq "Dagger" -and "~H$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*2:|You caused [#[ [$dmg1] floor((1d4 + ~S$ [SNEAK]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~W$" -eq "Shortsword" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*3:|You caused [#[ [$dmg2] floor((1d6 + ~S-MDEX$ [DEX] + ~S$ [SNEAK]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! "~W$" -eq "Shortbow" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? !Damage*4:|You caused [#[ [$dmg3] floor((1d6 + ~S-MDEX$ [DEX] + ~S$ [SNEAK]) / ?{Resistance?|No, 1|Yes, 2} [RESIST] * ?{Vulnerable?|No, 1|Yes, 2} [VULN] ) ]#] piercing damage --?! $Atk.base -eq 20 !? !Critical Hit*1:|**Critcal Effect:** [#[ [TXT] 1t[Hit-Piercing-(Lv.5-8)] ]#] --?! "~W$" -eq "Dagger" -and "~T$" -eq "No" -and $Atk.base -eq 1 !? !Fumble*1:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~W$" -eq "Dagger" -and "~T$" -eq "Yes" -and $Atk.base -eq 1 !? !Fumble*2:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~W$" -eq "Shortsword" -and $Atk.base -eq 1 !? !Fumble*3:|**Fumble**: [[ [TXT] 1t[Fumble-Melee-(Lv.5-8)] ]] --?! "~W$" -eq "Shortbow" -and $Atk.base -eq 1 !? !Fumble*4:|**Fumble**: [[ [TXT] 1t[Fumble-Ranged-(Lv.5-8)] ]] --?! "~W$" -eq "Dagger" -and "~H$" -eq "Main" -and $Atk.base -eq 20 !? !Normal*1:|**Damage**: [^dmg] piercing damage --?! "~W$" -eq "Dagger" -and "~H$" -eq "Offhand" -and $Atk.base -eq 20 !? !Normal*2:|**Damage**: [^dmg1] piercing damage --?! "~W$" -eq "Shortsword" -and $Atk.base -eq 20 !? !Normal*3:|**Damage**: [^dmg2] piercing damage --?! "~W$" -eq "Shortbow" -and $Atk.base -eq 20 !? !Normal*4:|**Damage**: [^dmg3] piercing damage --?! "~W$" -eq "Dagger" -and "~H$" -eq "Main" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^dmg] _show|all --?! "~W$" -eq "Dagger" -and "~H$" -eq "Offhand" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^dmg1] _show|all --?! "~W$" -eq "Shortsword" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar3|_target|@{target|token_id} _bar|3 _amount|-[^dmg2] _show|all --?! "~W$" -eq "Shortbow" -and $Atk -ge ~T-AC$ -and $Atk.base -ne 20 !? alterbar4|_target|@{target|token_id} _bar|3 _amount|-[^dmg3] _show|all }} Hope this helps.
I appreciate you sharing your macros - always helpful to see how other people do things. I should have been more specific in my issue however - I am actually trying to have one generic attack function for all first slot weapon attacks. The issue comes in with ammo tracking, since the ammo slot is not the same as the weapon slot - so I can have a bow in repeating slot $2 using ammo in slot $0, if that makes any sense. I could hardcode it, or ask the user, but I'm trying to see if there is a one-stop solution.  So I use the --replacesection tag to get information about the ammo that the slot $2 bow is using - weight, uses left, name, etc. But when it comes time to use !modattr to consume the ammo, I'm unable to reference the correct ammo slot (this may be different in OGL, I'm not sure - I see you using repeating_resouce, in shaped sheet). I just wasn't sure if I was missing some functionality in the --replacesection tag - maybe a built-in identifier for which repeating section it found the 'match' (like ammo-name gives the name, ammo-$id would return $0 or 0) Sorry if that was difficult to follow - I appreciate your assistance, and worst-case scenario I can just hardcode the ammo slot values, and tell my players to always keep things in their correct slots/inform me if they're moving things around. Thanks again!
So repeating_resource is how it is done in Shaped? Gromduraz said: I appreciate you sharing your macros - always helpful to see how other people do things. I should have been more specific in my issue however - I am actually trying to have one generic attack function for all first slot weapon attacks. The issue comes in with ammo tracking, since the ammo slot is not the same as the weapon slot - so I can have a bow in repeating slot $2 using ammo in slot $0, if that makes any sense. I could hardcode it, or ask the user, but I'm trying to see if there is a one-stop solution.  So I use the --replacesection tag to get information about the ammo that the slot $2 bow is using - weight, uses left, name, etc. But when it comes time to use !modattr to consume the ammo, I'm unable to reference the correct ammo slot (this may be different in OGL, I'm not sure - I see you using repeating_resouce, in shaped sheet). I just wasn't sure if I was missing some functionality in the --replacesection tag - maybe a built-in identifier for which repeating section it found the 'match' (like ammo-name gives the name, ammo-$id would return $0 or 0) Sorry if that was difficult to follow - I appreciate your assistance, and worst-case scenario I can just hardcode the ammo slot values, and tell my players to always keep things in their correct slots/inform me if they're moving things around. Thanks again!
Nope that's me just losing my brain halfway through a sentence. What I meant to say is -in shaped sheet, there's a repeating_offense section that has a field - repeating_offense_$num_ammo_field_name - this would yield 'Crossbow bolts'. It has a separate section, repeating_ammo_$num_[fields - like name, weight, uses]. To control ammo counts I would need to access repeating_ammo_$num_uses. The issue is that the $num of the repeating_offense section may not match the $num of the repeating_ammo section - which is why I was wondering if I could somehow return that $num index with a --replacesection attribute. 
1538088940
Kurt J.
Pro
API Scripter
Gromduraz said: Kurt J. said: Gromduraz said: EDIT: So your solution for the problem below is awesome - however I ran into an odd issue with --replacesection and --inlinereplace. The tag seems to be registering as a normal tag - meaning the content is displayed and not being recognized as a reserved tag - I am using a template for the macro - would that be an issue? Thanks again! Replacement tags can be used in conjunction with templates (and I do that ALOT), but not inside templates... too may opportunities for circular nesting (ie, a template that includes a replacement that includes a template, etc). :) Makes perfect sense. Thanks! EDIT: This raises another question though - using replacesection, is it possible to get the id/index of the entry found? For example, if I'm getting information about the class feature "Sneak Attack" using:  --replacesection|@{selected|character_id}|Sneak Attack|classfeature|name|CF- Would it be possible to get something like CF-id returning $0, or $1, depending on where it is in the class feature list? Thanks! So, repeating sections like repeating_attack_$0 actually resolve internally to something like "repeating_attack_f8sa748x0hf03" (ok, I just jammed my hands down on the keyboard, but you get the idea :)) Anyway, it would be possible to return this string (and with a bit more work the index ($0, $1, etc), but I don't know if it would be of any use. This would be because @{} notation is processed by the chat server, so @{selected|~CF-id$} would always be empty since ~CF-ID$ would be looking for an actual attribute on the character called ~CF-ID$ when the chat server processed it. In fact, PowerCards would never see the ~CF-ID$, as the whole @{} sequence will be stripped out by chat.
1538102549

Edited 1538103048
I wasn't intended to use an attribute notation with it -rather I'd like to pass the index to an api_ tag to chatsetattr to properly select the correct attribute to modify - something like: --replacesection|@{selected|character_id}|@{selected|repeating_offense_$0_ammo_field_name}|ammo|name|ammo- --api_modattr|_name @{selected|character_name} _repeating_ammo_~ammo-INDEX$_uses|-1 with ~ammo-INDEX$ being $0, $1, etc. Basically it just finds the ammo the first slot weapon is using then reduces the corresponding repeating ammo attribute uses by 1.  I did think of a potential alternative method, but I don't think it'll work due to order of operations - but to confirm - Can inlinereplace tags be put behind a conditional? Thanks!
Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session?
Kevin S. said: Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session? I believe having them on is actually the point as it allows you to troubleshoot any issues you are having.
Theodore S. said: Kevin S. said: Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session? I believe having them on is actually the point as it allows you to troubleshoot any issues you are having. I don't disagree that's it is useful but would be nice to have an option to turn it off. When debugging other things also triggering it creates a ton of unnecessary log output. I guess put it on my list of nice to have things but certainly not critical.
1538177783
Kurt J.
Pro
API Scripter
Kevin S. said: Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session? Yes, it is a mistake that the log command was left in there. It will be removed in the next one-click version.
1538185819

Edited 1538186874
Kurt J. said: Kevin S. said: Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session? Yes, it is a mistake that the log command was left in there. It will be removed in the next one-click version. Great thank you. If possible to add a --debug or something command that would be great to see the output yet when you need it. Also, anyone able to help with this. I have a script that when I click to run it while editing it works. As soon as I hit the checkbox to be done editing it just outputs the text of the script to chat and doesn't run the powercard api anymore  !power {{  --whisper|self  --replacement|?{Direction?|    Spell to Points, ?{Spell Level|       1st, StoP1 |       2nd, StoP2 |   3rd, StoP3 } |    Points to Spell, ?{Spell Level |       1st (2), PtoS1 |       2nd (3), PtoS2 |   3rd (5), PtoS3 }  }  --name|Flexible Casting  --leftsub|~DIR$  --rightsub|Bonus Action  --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point  --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot  --?! "~DIR$" -eq "Spell to Points" !? api_setattr|_name Leland _mod _evaluate _~ATR$|-1 _class_resource|~Points$  --?! "~DIR$" -eq "Points to Spell" !? api_setattr|_name Leland _mod _evaluate _~ATR$|1 _class_resource|-~Points$ }} And here is what ends up in chat: !power {{ --whisper|self --replacement| StoP1  --name|Flexible Casting --leftsub|~DIR$ --rightsub|Bonus Action --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot --?! "~DIR$" -eq "Spell to Points" !? api_setattr|_name Leland _mod _evaluate _~ATR$|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Points to Spell" !? api_setattr|_name Leland _mod _evaluate _~ATR$|1 _class_resource|-~Points$ }} From looking at the chat output and the console log it seems that after I close editing it is only doing the replacement on the first line, not the other lines of the program
1538189595

Edited 1538191293
Kevin S. said: Kurt J. said: Kevin S. said: Currently 3.8.6 on the one click install is outputting all expanded conditional statements to the log. Can this be turned off, it really jams up the log during a session? Yes, it is a mistake that the log command was left in there. It will be removed in the next one-click version. Great thank you. If possible to add a --debug or something command that would be great to see the output yet when you need it. Also, anyone able to help with this. I have a script that when I click to run it while editing it works. As soon as I hit the checkbox to be done editing it just outputs the text of the script to chat and doesn't run the powercard api anymore  !power {{  --whisper|self  --replacement|?{Direction?|    Spell to Points, ?{Spell Level|       1st, StoP1 |       2nd, StoP2 |   3rd, StoP3 } |    Points to Spell, ?{Spell Level |       1st (2), PtoS1 |       2nd (3), PtoS2 |   3rd (5), PtoS3 }  }  --name|Flexible Casting  --leftsub|~DIR$  --rightsub|Bonus Action  --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point  --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot  --?! "~DIR$" -eq "Spell to Points" !? api_setattr|_name Leland _mod _evaluate _~ATR$|-1 _class_resource|~Points$  --?! "~DIR$" -eq "Points to Spell" !? api_setattr|_name Leland _mod _evaluate _~ATR$|1 _class_resource|-~Points$ }} And here is what ends up in chat: !power {{ --whisper|self --replacement| StoP1  --name|Flexible Casting --leftsub|~DIR$ --rightsub|Bonus Action --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot --?! "~DIR$" -eq "Spell to Points" !? api_setattr|_name Leland _mod _evaluate _~ATR$|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Points to Spell" !? api_setattr|_name Leland _mod _evaluate _~ATR$|1 _class_resource|-~Points$ }} From looking at the chat output and the console log it seems that after I close editing it is only doing the replacement on the first line, not the other lines of the program It's alot more lines to the macro BUT it does work: !power {{ --whisper|self --inlinereplace|DIR|?{Direction?|Spell to Points|Points to Spells} --inlinereplace|Lvl|?{Spell Level?|1st|2nd|3rd|4th|5th} --inlinereplace|Points|?{Number of Points?|2|3|5|6|7} --name|Flexible Casting --leftsub|~DIR$ --rightsub|Bonus Action --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "1st" !? api_setattr*1|_name @{selected|character_name} _mod _evaluate _lvl1_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "2nd" !? api_setattr*2|_name @{selected|character_name} _mod _evaluate _lvl2_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "3rd" !? api_setattr*3|_name @{selected|character_name} _mod _evaluate _lvl3_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "4th" !? api_setattr*4|_name @{selected|character_name} _mod _evaluate _lvl4_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "5th" !? api_setattr*5|_name @{selected|character_name} _mod _evaluate _lvl5_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "2" !? api_setattr*6|_name @{selected|character_name} _mod _evaluate _lvl1_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "3" !? api_setattr*7|_name @{selected|character_name} _mod _evaluate _lvl2_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "5" !? api_setattr*8|_name @{selected|character_name} _mod _evaluate _lvl3_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "6" !? api_setattr*9|_name @{selected|character_name} _mod _evaluate _lvl4_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "7" !? api_setattr*10|_name @{selected|character_name} _mod _evaluate _lvl5_slots_expended|1 _class_resource|-~Points$ }}
Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level.
Kevin S. said: Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level. Let me see if I can get it to work using your replacement sheet
1538191988

Edited 1538193413
Theodore S. said: Kevin S. said: Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level. Let me see if I can get it to work using your replacement sheet From what I am seeing, it is not reading the secondary questions correctly. EDIT: It doesn't like your replacement question. Hence why you get the ~DIR$. So unless someone can suggest something better to work with your replacement sheet, I am going to go back to the code I placed for Flexible Casting above. !power {{ --whisper|self --inlinereplace|DIR|?{Direction?|Spell to Points|Points to Spells} --inlinereplace|Lvl|?{Spell Level?|1st|2nd|3rd|4th|5th} --inlinereplace|Points|?{Number of Points?|2|3|5|6|7} --name|Flexible Casting --leftsub|~DIR$ --rightsub|Bonus Action --?! "~DIR$" -eq "Spell to Points" !? Converting:| ~Lvl$ level spell to ~Points$ Sorcery Point --?! "~DIR$" -eq "Points to Spell" !? Converting:| ~Points$ Sorcery Points to ~Lvl$ level slot --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "1st" !? api_setattr*1|_name @{selected|character_name} _mod _evaluate _lvl1_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "2nd" !? api_setattr*2|_name @{selected|character_name} _mod _evaluate _lvl2_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "3rd" !? api_setattr*3|_name @{selected|character_name} _mod _evaluate _lvl3_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "4th" !? api_setattr*4|_name @{selected|character_name} _mod _evaluate _lvl4_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Spell to Points" -and "~Lvl$" -eq "5th" !? api_setattr*5|_name @{selected|character_name} _mod _evaluate _lvl5_slots_expended|-1 _class_resource|~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "2" !? api_setattr*6|_name @{selected|character_name} _mod _evaluate _lvl1_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "3" !? api_setattr*7|_name @{selected|character_name} _mod _evaluate _lvl2_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "5" !? api_setattr*8|_name @{selected|character_name} _mod _evaluate _lvl3_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "6" !? api_setattr*9|_name @{selected|character_name} _mod _evaluate _lvl4_slots_expended|1 _class_resource|-~Points$ --?! "~DIR$" -eq "Points to Spells" -and "~Points$" -eq "7" !? api_setattr*10|_name @{selected|character_name} _mod _evaluate _lvl5_slots_expended|1 _class_resource|-~Points$ }}
From what I am seeing, it is not reading the secondary questions correctly. EDIT: It doesn't like your replacement question. Hence why you get the ~DIR$. So unless someone can suggest something better to work with your replacement sheet, I am going to go back to the code I placed for Flexible Casting above. Yeah I'm guessing its an issue with the html replacement tags. For some reason they work when you are editing the ability and run it, but when you save the ability it messes things up. Thanks for the rework, that'll handle what I need. 
1538226153
Kurt J.
Pro
API Scripter
Kevin S. said: Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level. Couple of possibilities I see to check: First, you have "SStoP1" in replacements, but the value being output by the roll query is "StoP1". Also, because of the linebreaks in the macro, there is likely either an html masked or simply an empty character in front of the values ( --replacement| StoP1 ) contains a space before StoP1, so it is possible that it is not matching the replacements list.
Kurt J. said: Kevin S. said: Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level. Couple of possibilities I see to check: First, you have "SStoP1" in replacements, but the value being output by the roll query is "StoP1". Also, because of the linebreaks in the macro, there is likely either an html masked or simply an empty character in front of the values ( --replacement| StoP1 ) contains a space before StoP1, so it is possible that it is not matching the replacements list. The SStop was just a copy paste issue. I've checked over the other things, removed all the spaces in the macro but still no go. When I run the script while editing it, it works just fine. After hitting the check box to save it, suddenly it doesn't work. Something must happen with the script on save that doesn't happen when you run it otherwise. Oh well, I'll fall back to the simpler versions for now at least. Thanks for taking a look
Kevin S. said: Kurt J. said: Kevin S. said: Theodore S. said: Almost got it figured out. Just wondering what ~ATR$ represents Here's my replacement: S StoP1:Lvl|1st;Points|1;DIR|Spell to Points;ATR|lvl1_slots_expended StoP2:Lvl|2nd;Points|2;DIR|Spell to Points;ATR|lvl2_slots_expended StoP3:Lvl|3rd;Points|3;DIR|Spell to Points;ATR|lvl3_slots_expended StoP4:Lvl|4th;Points|4;DIR|Spell to Points;ATR|lvl4_slots_expended StoP5:Lvl|5th;Points|5;DIR|Spell to Points;ATR|lvl5_slots_expended StoP6:Lvl|6th;Points|6;DIR|Spell to Points;ATR|lvl6_slots_expended StoP7:Lvl|7th;Points|7;DIR|Spell to Points;ATR|lvl7_slots_expended PtoS1:Lvl|1st;Points|2;DIR|Points to Spell;ATR|lvl1_slots_expended PtoS2:Lvl|2nd;Points|3;DIR|Points to Spell;ATR|lvl2_slots_expended PtoS3:Lvl|3rd;Points|5;DIR|Points to Spell;ATR|lvl3_slots_expended PtoS4:Lvl|4th;Points|6;DIR|Points to Spell;ATR|lvl4_slots_expended PtoS5:Lvl|5th;Points|7;DIR|Points to Spell;ATR|lvl5_slots_expended ATR is the attribute on the OGL sheet for the spell level to mark a slot expended from. So I have an entry for each spell level. Couple of possibilities I see to check: First, you have "SStoP1" in replacements, but the value being output by the roll query is "StoP1". Also, because of the linebreaks in the macro, there is likely either an html masked or simply an empty character in front of the values ( --replacement| StoP1 ) contains a space before StoP1, so it is possible that it is not matching the replacements list. The SStop was just a copy paste issue. I've checked over the other things, removed all the spaces in the macro but still no go. When I run the script while editing it, it works just fine. After hitting the check box to save it, suddenly it doesn't work. Something must happen with the script on save that doesn't happen when you run it otherwise. Oh well, I'll fall back to the simpler versions for now at least. Thanks for taking a look I hope that the macro I provided gives your sorcerer alot of assistance in using his Sorcery Points.
I hope that the macro I provided gives your sorcerer alot of assistance in using his Sorcery Points. Yup, looks like it is going to work out great, thanks again for the assistance. I just started using power cards this week, and am just blown away with what's possible. I had done a bunch with setattr and token mod but always needed multiple buttons or to enter values so they'd get applied. Being able to save rolls in powercards is amazing. 
I actually use PowerCards to roll Save, Skills, Unskilled Checks, Weapons, etc. And when it comes to weapons/spells, as long as it is a single target attack, it will auto apply damage. My players typically do not have to look at their character sheet because of the power cards.
Hey so maybe I'm just dumb, but I'm trying to create a macro for my rogue player for Reliable Talent, this is my code however when I try to use it nothing happens? Any help? Can change the format or however if there is a way to do it I just can't seem to think of a way to get it to work. (I just used $Atk and $Dmg for those because in other macros I've made those are the only things that work.) !power {{ --tokenid|@{selected|token_id} --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Reliable Talent --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Skill:|~C ?{Skill Name|Deception|Insight|Investigation|Perception|Performance|Persuasion|Sleight of Hand|Stealth} ~C --$Base Roll:|[[ [NH] [$Atk] ?{Roll Type|Standard, 1d20 [Base]|Advantage, 2d20kh1 [Base]|Disadvantage, 2d20kl1 [Base]} ]] --Skill Bonus:|[[ [$Dmg] ?{Skill|Deception, @{selected|deception_bonus}|Insight, @{selected|insight_bonus}|Investigation, @{selected|investigation_bonus}|Perception, @{selected|perception_bonus}|Performance, @{selected|performance_bonus}|Persuasion, @{selected|persuasion_bonus}|Sleight of Hand, @{selected|sleight_of_hand_bonus}|Stealth, @{selected|stealth_bonus}} ]] --?? $Atk.base < 10 ?? Check Total:| 10 + [^Dmg] --?? $Atk.base > 9 ?? Check Result:| [^Atk] + [^Dmg] }}
Caleb, see corrected code below: !power {{ --tokenid|@{selected|token_id} --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Reliable Talent --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Skill:|~C ?{Skill Name|Deception|Insight|Investigation|Perception|Performance|Persuasion|Sleight of Hand|Stealth} ~C --hrolls|[[ [NH] [$Atk] ?{Roll Type|Standard, 1d20 [Base]|Advantage, 2d20kh1 [Base]|Disadvantage, 2d20kl1 [Base]} ]] [[ [$Dmg] 1d0 + ?{Skill|Deception, @{selected|deception_bonus}|Insight, @{selected|insight_bonus}|Investigation, @{selected|investigation_bonus}|Perception, @{selected|perception_bonus}|Performance, @{selected|performance_bonus}|Persuasion, @{selected|persuasion_bonus}|Sleight of Hand, @{selected|sleight_of_hand_bonus}|Stealth, @{selected|stealth_bonus}} ]] --?? $Atk.base < 10 ?? Check Total:| 10 + [^Dmg] --?? $Atk.base > 9 ?? Check Result:| [^Atk] + [^Dmg] }} That seems to work for me. I made two changes - first, suppressing the output of a tag with '$' doesn't allow the result to be stored in a rollID - you must use the hroll tag for it, or allow the result to be seen. Secondly, I went ahead and added a '1d0+' in your Dmg roll - I've noticed in my experience that with hidden rolls, it's always a good idea to include a 'dummy' roll instead of just a number, despite it working in the chat box just fine. I moved both the Atk and Dmg rolls into an hrolls tag as well, to clean things up. Let me know if this is working as intended.  Caleb said: Hey so maybe I'm just dumb, but I'm trying to create a macro for my rogue player for Reliable Talent, this is my code however when I try to use it nothing happens? Any help? Can change the format or however if there is a way to do it I just can't seem to think of a way to get it to work. (I just used $Atk and $Dmg for those because in other macros I've made those are the only things that work.) !power {{ --tokenid|@{selected|token_id} --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Reliable Talent --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Skill:|~C ?{Skill Name|Deception|Insight|Investigation|Perception|Performance|Persuasion|Sleight of Hand|Stealth} ~C --$Base Roll:|[[ [NH] [$Atk] ?{Roll Type|Standard, 1d20 [Base]|Advantage, 2d20kh1 [Base]|Disadvantage, 2d20kl1 [Base]} ]] --Skill Bonus:|[[ [$Dmg] ?{Skill|Deception, @{selected|deception_bonus}|Insight, @{selected|insight_bonus}|Investigation, @{selected|investigation_bonus}|Perception, @{selected|perception_bonus}|Performance, @{selected|performance_bonus}|Persuasion, @{selected|persuasion_bonus}|Sleight of Hand, @{selected|sleight_of_hand_bonus}|Stealth, @{selected|stealth_bonus}} ]] --?? $Atk.base < 10 ?? Check Total:| 10 + [^Dmg] --?? $Atk.base > 9 ?? Check Result:| [^Atk] + [^Dmg] }}
Yeah, that works thanks, I think I haven't caught up with the proper use of the code since a couple of updates. Gromduraz said: Caleb, see corrected code below: !power {{ --tokenid|@{selected|token_id} --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Reliable Talent --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Skill:|~C ?{Skill Name|Deception|Insight|Investigation|Perception|Performance|Persuasion|Sleight of Hand|Stealth} ~C --hrolls|[[ [NH] [$Atk] ?{Roll Type|Standard, 1d20 [Base]|Advantage, 2d20kh1 [Base]|Disadvantage, 2d20kl1 [Base]} ]] [[ [$Dmg] 1d0 + ?{Skill|Deception, @{selected|deception_bonus}|Insight, @{selected|insight_bonus}|Investigation, @{selected|investigation_bonus}|Perception, @{selected|perception_bonus}|Performance, @{selected|performance_bonus}|Persuasion, @{selected|persuasion_bonus}|Sleight of Hand, @{selected|sleight_of_hand_bonus}|Stealth, @{selected|stealth_bonus}} ]] --?? $Atk.base < 10 ?? Check Total:| 10 + [^Dmg] --?? $Atk.base > 9 ?? Check Result:| [^Atk] + [^Dmg] }} That seems to work for me. I made two changes - first, suppressing the output of a tag with '$' doesn't allow the result to be stored in a rollID - you must use the hroll tag for it, or allow the result to be seen. Secondly, I went ahead and added a '1d0+' in your Dmg roll - I've noticed in my experience that with hidden rolls, it's always a good idea to include a 'dummy' roll instead of just a number, despite it working in the chat box just fine. I moved both the Atk and Dmg rolls into an hrolls tag as well, to clean things up. Let me know if this is working as intended.  Caleb said: Hey so maybe I'm just dumb, but I'm trying to create a macro for my rogue player for Reliable Talent, this is my code however when I try to use it nothing happens? Any help? Can change the format or however if there is a way to do it I just can't seem to think of a way to get it to work. (I just used $Atk and $Dmg for those because in other macros I've made those are the only things that work.) !power {{ --tokenid|@{selected|token_id} --border|1px solid #1ddfb3 --corners|0 --bgcolor|#ffffff --txcolor|#1f91a9 --erowtx|#ffffff --erowbg|#28baa8 --orowtx|#ffffff --orowbg|#1f91a9 --name|Reliable Talent --titlefont|New Century Schoolbook --titlefontshadow|none --subtitlefont|New Century Schoolbook --bodyfont|New Century Schoolbook --!Skill:|~C ?{Skill Name|Deception|Insight|Investigation|Perception|Performance|Persuasion|Sleight of Hand|Stealth} ~C --$Base Roll:|[[ [NH] [$Atk] ?{Roll Type|Standard, 1d20 [Base]|Advantage, 2d20kh1 [Base]|Disadvantage, 2d20kl1 [Base]} ]] --Skill Bonus:|[[ [$Dmg] ?{Skill|Deception, @{selected|deception_bonus}|Insight, @{selected|insight_bonus}|Investigation, @{selected|investigation_bonus}|Perception, @{selected|perception_bonus}|Performance, @{selected|performance_bonus}|Persuasion, @{selected|persuasion_bonus}|Sleight of Hand, @{selected|sleight_of_hand_bonus}|Stealth, @{selected|stealth_bonus}} ]] --?? $Atk.base < 10 ?? Check Total:| 10 + [^Dmg] --?? $Atk.base > 9 ?? Check Result:| [^Atk] + [^Dmg] }}
So my Java/API skills are definitely sub par compared to many of the posters here, but I as wondering if anyone would have an idea if what i am looking to would be possible. I currently using the  Development GIST of PowerCards, and was wondering if there would be a way to include a tooltip/hover over showing the spell info: description, components,targets, range, etc for the buttons created by the  --spell_list tag. I have looked through the RAW file and can some what see where the buttons are created under the  " // CREATE 5e OGL SHEET PREPARED SPELL LIST (BOTH PC & NPC)" on line 530. And the Htlm href for the actual links on line 1572. I messed around with a couple of changes and ended up breaking the whole script and had to reload.  Any help would be awesome as this would help streamline for some of my more inexperienced players for the game i am DM'ing. Below i mocked up what i was thinking in Gimp since I was worried what i tried to describe may not have come across very well.
I would love to get tooltips for things, especially spells.  When I cast some spell, I want to be able to present a simplified card (e.g., just damage and saves) to the chat window but allow the GM to be able to hover over the spell name on the card to get the full spell text.  At the moment the GM often asks us (players) to post the full spell text so he can read over it, but this clutters the chat window and I would prefer it just be temporarily available.
Is it possible to do a conditional on the result of a drop-down choice?  I want my macro to prompt the user with Standard, Advantage, Disadvantage and then the resulting power card in the chat window would have conditional output like: ?? RollType == Advantage ?? @{selected|character_name} attacks @{target|character_name} with advantage, rolling a [^attack] to hit.
Micah Zoltu said: Is it possible to do a conditional on the result of a drop-down choice?  I want my macro to prompt the user with Standard, Advantage, Disadvantage and then the resulting power card in the chat window would have conditional output like: ?? RollType == Advantage ?? @{selected|character_name} attacks @{target|character_name} with advantage, rolling a [^attack] to hit. --inlinereplace|RollType|?{Normal|Advantage|Disadvantage} --?! "RollType" -eq "Advantage" !? !result|@{selected|character_name} attacks @{target|character_name} with advantage, rolling a [^attack] to hit
Thanks Theodore, I'll give that a try... as soon as I figure out why PowerCards has ceased functioning.  :/  I was iterating on a PowerCard, and then all of a sudden the whole plugin ceased functioning. !power {{ --name|hello }} doesn't even work.  What do I need to do to fix it?
1539009815

Edited 1539012801
Theodore S. said: --inlinereplace|RollType|?{Normal|Advantage|Disadvantage} --?! "RollType" -eq "Advantage" !? !result|@{selected|character_name} attacks @{target|character_name} with advantage, rolling a [^attack] to hit How can I then use the same drop-down entry to actually roll with/without advantage?  If I do ?{RollType|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1} Then I'll get 2 separate prompts (and also things seem to break when I do this in general).
Is it possible to group Boolean logic? ?? $attack.base < 20 AND $attack.base > 1 AND ($attack.total < @{target|npc_ac} OR $attack.total < @{target|ac}) ?? Alternatively, is there a way to do a min or max? ?? $attack.base < 20 AND $attack.base > 1 AND $attack.total < max(@{target|npc_ac},@{target|ac}) ?? I'm very annoyed that `npc_ac` and `ac` are different attributes on the OGL character sheet, it is giving me no end of headache trying to get a single macro to work against players or npcs.
1539062611

Edited 1539062807
I'm unable to get Video effects to work.&nbsp; I have tried the `--vfx_opt` examples on <a href="https://wiki.roll20.net/Script:PowerCards#Audio_and_Video_Effects" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Audio_and_Video_Effects</a> but none work.&nbsp; I also have watched the video and made sure to set token_id and target_list (which are working correctly, they show up as part of my emote) but still no video effects play when the script is run. Is there some additional trick required?&nbsp; Here is the code I'm trying that doesn't work: !power {{ &nbsp; --name|Test &nbsp; --tokenid|@{selected|token_id} &nbsp; --target_list|@{target|token_id} &nbsp; --emote|I cast magic missile! &nbsp; --vfx_opt|@{selected|token_id} @{target|token_id} breath-fire }}
1539078121
Kurt J.
Pro
API Scripter
Micah Zoltu said: I'm unable to get Video effects to work.&nbsp; I have tried the `--vfx_opt` examples on <a href="https://wiki.roll20.net/Script:PowerCards#Audio_and_Video_Effects" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Audio_and_Video_Effects</a> but none work.&nbsp; I also have watched the video and made sure to set token_id and target_list (which are working correctly, they show up as part of my emote) but still no video effects play when the script is run. Is there some additional trick required?&nbsp; Here is the code I'm trying that doesn't work: !power {{ &nbsp; --name|Test &nbsp; --tokenid|@{selected|token_id} &nbsp; --target_list|@{target|token_id} &nbsp; --emote|I cast magic missile! &nbsp; --vfx_opt|@{selected|token_id} @{target|token_id} breath-fire }} Make sure your Player Ribbon is on the page you (as the DM) are viewing... The effects play on the player page and it can be easy to forget to move it while testing.
1539085056

Edited 1539085205
Ah, that did it (moving ribbon).&nbsp; Happen to have a magic solution for everything else?&nbsp; :D I think I figured out the AC thing, I can do the character replacements which includes the ac || ncp_ac thing for me, and that seems to work.&nbsp; I still can't figure out how to have a roll query that I use for two different things (e.g., advantage/disadvantage roll query both for presentation to the user and deciding how to roll the dice). I also haven't been able to figure out a way to roll for damage across multiple attacks and total them.&nbsp; The problem is that rolling for crit requires a conditional, and I can only do conditionals for display, not for rolling/not-rolling.