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

Healling hands macro & API

December 28 (4 years ago)

I have this macro for the paladin..... is there any way that by selecting the token you want to heal you can DIRECTLY apply the healing on the token and deduct the points used on the character sheet?


&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|token_name} ***}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.}} @{charname_output}

December 29 (4 years ago)

maybe something with the ChatSetAttr API? i do not yet control the issue of api, but some know if this could be done?

December 29 (4 years ago)

I try this.... but does`t work at all... modify the other token bar 3 for a letter "lay on h..." but no restore health   :S


&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|token_name} ***}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.}} @{charname_output}

!token-mod --ids @{target|token_id} --set bar3_value|+?{Lay on Hands @{selected|class_resource} 

December 30 (4 years ago)

You are missing the name portion of the attribute calls @{class_resource} should be @{selected|class_resource} or @{target|Paladin|class_resource} or @{CHARACTERNAME|class_resource}

You should also confirm that the token you are selecting has a character sheet with charname_output as an attribute.  I didn't have that on a test character I created so the macro didn't work until I used @{selected|token_name} instead of the @{charname_output}

One thing you are doing incorrectly is using the @{selected|class_resource} as the amount that is adjusting the bar3_value.  You need to use the ?{Number of Points to Heal} instead. The same is true for subtracting from the class resource attribute on the paladin character.

Try this base macro to start:

&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|Who is healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}


If that works, then figure out the healing macro. There's a couple of options. I suggest using the ChatSetAttr script, as it will work regardless of which bar displays hp:

!token-mod --ids @{target|Who is healed|token_id} --set bar3_value|+?{Number of points to Heal}
!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}


Then the section to remove the class resource from the paladin who is using Lay on Hands:

!modattr --silent --name @{selected|token_name} --class_resource|-?{Number of points to Heal}


If each section works, put them all together:

&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|Who is healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}
!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}
!modattr --silent --name @{selected|token_name} --class_resource|-?{Number of points to Heal}


A caveat: this will always try to heal a targeted character, so it can't be used for the 'spending 5 resource points to cure one disease or neutralize one poison' portion of Lay on Hands.  Those points would need to be subtracted manually.

You also have to have a token selected to use this macro as well. If it is only a single character using this macro, replace the 'selected' with the character name.

December 30 (4 years ago)

Doesn't seem to be working.....

It does not heal the character that I select and neither are the points deducted.... in addition the question of who you want to heal appears twice

I put this code..... (the name of the Paladin is Klauss Ravenash).... maybe the command --sel (removes the name?)


&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|Who is healed|token_name}***}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.

Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}

!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}

!modattr --silent --name @{selected|token_name} --class_resource|-?{Number of points to Heal}

December 30 (4 years ago)

With this code.....

&{template:atkdmg} {{normal=1}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}
!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}
!modattr --silent ----charid @{selected | character_id} --class_resource|-?{Number of points to Heal}


the Paladin heals a token..... and the double check question is gone, only ask once. But the problem is that the Lay on hand points are not reduced on the sheet, and appears a red info....


December 30 (4 years ago)

Edited December 30 (4 years ago)

You have to have the paladin token selected to use the macro. Then you use the target click to select who is being healed (it can be the paladin or another character). 


Also go through each of the three sections that I posted individually: do they work on their own? They worked in my test game, and then the whole thing works as well. 

December 31 (4 years ago)

I select the token, click on the macro (token action), and then I select the token that receives the healing (it works except that the points used are not deducted from the sheet)






December 31 (4 years ago)
Oosh
Sheet Author
API Scripter

It looks like the last couple of lines are outside the template, and sent as new chat commands.I think that's breaking the @{selected} reference, as a target click will reset your selection. You can try moving the !modattr command so it's inline, and part of the same chat message, or just hard-code the --charid so it isn't relying on a @{selected} reference.

December 31 (4 years ago)

Thax.... Final i think it works.... the final code is....

&{template:atkdmg} {{normal=1}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.

Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}

!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}

!modattr --silent --charid @{selected|character_id} --class_resource|-?{Number of points to Heal}

December 31 (4 years ago)

Edited December 31 (4 years ago)

The macro below works correctly now (it now heal a target token and reduce the used points from the character sheet), but it has 2 problems..... 

1. Problem. The name of the target (token that recive the healing effect) does not appear in the chat, only appears the healer's name (Paladin's name)

2. Problem. As example, If a token has 30 hp max (28 hp current), and the Paladin heal 4, in the token appears 32 hp (2 above the max limit). It's a bit stupid because my players will choose the exact amount, but in case of macros like Second Wind, that you roll a die may be the case. Any way to limit this to the natural maximum of the token?

3. Problem. I don't know if this is a problem in itself, or an incompatibility between APIs. I have the API of Aura/Tint HealthColor, and when I ejecute the Lay on hands macro with the Paladin, I do not see the green effect of the sparks on the token that receives the healing effect. Normally when i modify the bar 3 (hp) manually i see the red effect when i rest and the green effect when i add. 


&{template:atkdmg} {{normal=1}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.

Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}

!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}

!modattr --silent --charid @{selected|character_id} --class_resource|-?{Number of points to Heal}

January 01 (4 years ago)

Edited January 01 (4 years ago)

Rober M. said:

The macro below works correctly now (it now heal a target token and reduce the used points from the character sheet), but it has 2 problems..... 

1. Problem. The name of the target (token that recive the healing effect) does not appear in the chat, only appears the healer's name (Paladin's name)

2. Problem. As example, If a token has 30 hp max (28 hp current), and the Paladin heal 4, in the token appears 32 hp (2 above the max limit). It's a bit stupid because my players will choose the exact amount, but in case of macros like Second Wind, that you roll a die may be the case. Any way to limit this to the natural maximum of the token?

3. Problem. I don't know if this is a problem in itself, or an incompatibility between APIs. I have the API of Aura/Tint HealthColor, and when I ejecute the Lay on hands macro with the Paladin, I do not see the green effect of the sparks on the token that receives the healing effect. Normally when i modify the bar 3 (hp) manually i see the red effect when i rest and the green effect when i add. 


&{template:atkdmg} {{normal=1}} {{rname=LAY ON HANDS

}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.

Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}

!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}

!modattr --silent --charid @{selected|character_id} --class_resource|-?{Number of points to Heal}

I accidentally didn't make the two @{target|Who is Healed|token_name} exactly the same.  One had 'Healed' capitalized and the other had 'healed' uncapitalized, so it should have made you select two targets.

1. You removed the {{mod=on ***@{target|Who is Healed|token_name}***}} from your macro, which is why it isn't showing the name of the token that is healed.

2.  Yes it's possible. This will take the number of LoH points selected, and compare it too the target's max HP minus current HP (so the maximum that could be applied to the target), and keeps the lower of the two numbers.

[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]

3. It's an API communication issue.  If you use Token-Mod, then it will still update Aura/Tint HealthColors, so you can switch out the API call for the healing portion to TokenMod instead of ChatSetAttr to get the healing animation to play.

!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]


Here's the full macro without "Using ### points." in the desc field. You probably don't need that, as it's the value in the R1 range section anyways:

!?{Number of points to Heal|@{selected|class_resource}}
!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
!modattr --silent --name @{selected|token_name} --class_resource|-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|Who is Healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]]]}}{{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.}} {{charname=@{selected|token_name}}}


Edit: Macro with "Using ### points." in the desc field. For some reason it wasn't working when the Desc section was at the end, but when I moved it earlier in the macro it works for me.

!?{Number of points to Heal|@{selected|class_resource}}
!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
!modattr --silent --name @{selected|token_name} --class_resource|-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
&{template:atkdmg} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using [[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]] points.}} {{charname=@{selected|token_name}}} {{normal=1}} {{mod=on ***@{target|Who is Healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]]]}}{{dmg1type=points left}}

This screencap was taken after after the Life Cleric had 45/50 hp, and the Paladin tried to use 10 of his 20 LoH points:


OMG, works like a charm..... a lot of thx bro