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 .
×
May your rolls be merry + bright! 🎄
Create a free account

[Script] Smart Aoe Healing word

1705826938

Edited 1705827068
Hi everyone, I'm trying to create a macro for the Healing word spell to use with SmartAoe; I'll start by saying that I don't know much about writing code and everything I've written is the result of testing and copying portions of other macros already done. I wrote the following code, it seems to follow my instructions but in the end it doesn't work; can you help me correct it? Thank you !smartaoe {{     --title|Healing word     --leftsub|Slot level ?{what level?|1|2|3|4|5|6|7|8|9}     --rightsub|No Save          !smartquery @{target|Choose a Target|token_id}          --fx|holy          --damageFormula1|[[0 + [[0 - ?{what level?}]]d4]]     --damageType1|(Healing)     --instant|1          --autoApply|yes     --bar|1     }} !modattr --charid @{selected|character_id} --lvl?{what level??}_slots_expended | -1
So I don't use smartaoe and cannot help you with your above smartaoe macro. I do have a Healing Word written in  ScriptCards . If you want to see the ScriptCards version, let me know and I will post that.
1705835484

Edited 1705836859
Hi Federico, There's an example of the spell Healing Aura on the SmartAoE wiki page that can be easily edited to create one for healing word. Just need to change the radius to 5 feet, the roll to a d4 and add in a level select. EDIT: So, turns out SmartAoE has it's own resource reduction already built in. I've updated the SmartAoE script with that included. The problem comes when you try to use ChatSetAttr after the smartaoe script as the "what level" query won't pass to outside of the SmartAoE script. Here is a working SmartAoE script for Healing Word, but it won't deduct a spell slot. !smartaoe {{ --title|Aura of Vitality --leftsub|Slot level ?{Cast at what level?|1,1|2,2|3,3|4,4|5,5|6,6|7,7|8,8|9,9} --rightsub|No Save --titlecardbackground|url('<a href="https://s3.amazonaws.com/files.d20.io/images/253287692/0dpMLj12wwv9cRy5RRw6LA/max.png?1635706258');background-size" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/253287692/0dpMLj12wwv9cRy5RRw6LA/max.png?1635706258');background-size</a>: 100% 100%; background-repeat: no-repeat --oddrowbackground|#ffffaa --evenrowbackground|#ffffff --oddrowfontcolor|#000000 --tablebgcolor|#ffffff --aoeColor|#ffff0050 --aoeOutlineColor|#cccc00 --gridColor|#ffffff00 --aoeType|circle, float --radius|5ft --forceIntersection|0 --minGridArea|0.5 --minTokArea|0.25 --fx|bubbling-holy --noSave|1 --damageFormula1|[[0 + [[0 -?{Cast at what level?}]]d4]] --damageType1|(Healing) --autoApply|1 --instant|1 --resource|lvl?{Cast at what level?}_slots_expended,1 }} I'll show you the macro I use for Healing Word which can also be adapted to Cure Wounds and other healing spells. It does require the ScriptCards, and TokenMod scripts, though. It also uses my preferred template style, but you can change it up or use --overridetemplate and use the built in ScriptCards templates. !scriptcards {{ --#title|Healing Word --#leftsub|Level 1 | Evocation | Bonus Action [br] --#rightsub| 60' | V | Instantaneous --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:character_name] Casts Healing Word on [*T:character_name] --#bodyfontface|Helvetica --#oddrowfontcolor|#290000 --#evenrowfontcolor|#290000 --#bodyfontsize|12px --#buttonfontsize|10px --#buttonbackground|#930c10 --#buttonbackground|#672223 --#buttonbackground|rgba(103,34,35,1); display:inline-block; --#buttonfontface|Tahoma --#titlecardbackgroundcolor|#930c10 --#titlecardbackgroundcolor|#672223 --#titlefontcolor|#fffebd --#titlefontsize|1.5em --#titlefontshadow|0 --#oddrowbackground|#f7ce65 --#evenrowbackground|#f7ce65 --#oddrowbackground|#b3ab96 --#evenrowbackground|#b3ab96 --#subtitlefontcolor|#fffebd --#tablebgcolor|#fffebd --#lineheight|10pt --#buttonpadding|5px --~HowFarAway|distance;@{selected|token_id};@{target|token_id} --=HowFar|[$HowFarAway] * 5 --?[$HowFar] -gt 60|tooFar --&gt;WhatSpellSlot| --X| --:HealingWord| --=HPRecovered|[$SlotLevel]d4 + @{selected|wisdom_mod} --=Wounds|[*T:hp^] - [*T:hp] --?[$HPRecovered] -le [$Wounds]|StillWounded --+|[*T:character_name] received [$HPRecovered] HP and is now at full health! --+|Level [$SlotLevel] Slots Left: [$SlotsLeft] --@token-mod| _set bar1_value|+[$Wounds] _ids @{target|token_id} --X| --:StillWounded| --+|[*T:character_name] recovered [$HPRecovered] of [$Wounds] lost HP! --+|Level [$SlotLevel] Slots Left: [$SlotsLeft] --@token-mod| _set bar1_value|+[$HPRecovered] _ids @{target|token_id} --X| --:WhatSpellSlot| --+At what level is the spell being cast?| --+|[rbutton]1::WhatLVL;1[/rbutton][rbutton]2::WhatLVL;2[/rbutton][rbutton]3::WhatLVL;3[/rbutton][rbutton]4::WhatLVL;4[/rbutton][rbutton]5::WhatLVL;5[/rbutton][rbutton]6::WhatLVL;6[/rbutton][rbutton]7::WhatLVL;7[/rbutton][rbutton]8::WhatLVL;8[/rbutton][rbutton]9::WhatLVL;9[/rbutton] --X| --:WhatLVL| --=SlotLevel|[&amp;reentryval] --=SlotsTotal|0 --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --?[$SlotsExpended.Raw] -eq [$SlotsTotal.Raw]|[ --&gt;NoSlotsLeft| --]|[ --?[$SlotLevel] -eq 0|NoSlot --=SlotsLeft|[$SlotsExpended] - 1 --!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft] --=Targets|[$SlotLevel]-1 --a|cure_wounds --&gt;HealingWord| --]| --X| --:NoSlot| --X| --:NoSlotsLeft| --+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] --X|NoSlotsLeftStop --X| --:tooFar| --+|The target is too far away. --X| }}
Thanks for the reply, I don't know ScriptCards and I don't have the computer in front of me to try what you suggested.&nbsp; Focusing on what I tried to do I can tell you that the last line is optional and in any case it worked on the macro I created for the fireball spell.&nbsp; That said, I was unable to create a macro that allows player X to cast the spell and select player Y's token and heal him.&nbsp; As soon as I have the chance I will also try ScriptCards
Just so you don't miss it, I've updated my reply to you because SmartAoE does already have a resource deduction command already built in.
1705840479
David M.
Pro
API Scripter
The SC solution is going to be much less fiddly than SmartAoE in this instance, requiring fewer clicks and not needing to move a control token around first. SmartAoE is best used for larger areas and multiple targets rather than single target effects.
1705857574

Edited 1705858535
Timothy B. said: !scriptcards {{ --#title|Healing Word --#leftsub|Level 1 | Evocation | Bonus Action [br] --#rightsub| 60' | V | Instantaneous --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:character_name] Casts Healing Word on [*T:character_name] --#bodyfontface|Helvetica --#oddrowfontcolor|#290000 --#evenrowfontcolor|#290000 --#bodyfontsize|12px --#buttonfontsize|10px --#buttonbackground|#930c10 --#buttonbackground|#672223 --#buttonbackground|rgba(103,34,35,1); display:inline-block; --#buttonfontface|Tahoma --#titlecardbackgroundcolor|#930c10 --#titlecardbackgroundcolor|#672223 --#titlefontcolor|#fffebd --#titlefontsize|1.5em --#titlefontshadow|0 --#oddrowbackground|#f7ce65 --#evenrowbackground|#f7ce65 --#oddrowbackground|#b3ab96 --#evenrowbackground|#b3ab96 --#subtitlefontcolor|#fffebd --#tablebgcolor|#fffebd --#lineheight|10pt --#buttonpadding|5px --~HowFarAway|distance;@{selected|token_id};@{target|token_id} --=HowFar|[$HowFarAway] * 5 --?[$HowFar] -gt 60|tooFar --&gt;WhatSpellSlot| --X| --:HealingWord| --=HPRecovered|[$SlotLevel]d4 + @{selected|wisdom_mod} --=Wounds|[*T:hp^] - [*T:hp] --?[$HPRecovered] -le [$Wounds]|StillWounded --+|[*T:character_name] received [$HPRecovered] HP and is now at full health! --+|Level [$SlotLevel] Slots Left: [$SlotsLeft] --@token-mod| _set bar1_value|+[$Wounds] _ids @{target|token_id} --X| --:StillWounded| --+|[*T:character_name] recovered [$HPRecovered] of [$Wounds] lost HP! --+|Level [$SlotLevel] Slots Left: [$SlotsLeft] --@token-mod| _set bar1_value|+[$HPRecovered] _ids @{target|token_id} --X| --:WhatSpellSlot| --+At what level is the spell being cast?| --+|[rbutton]1::WhatLVL;1[/rbutton][rbutton]2::WhatLVL;2[/rbutton][rbutton]3::WhatLVL;3[/rbutton][rbutton]4::WhatLVL;4[/rbutton][rbutton]5::WhatLVL;5[/rbutton][rbutton]6::WhatLVL;6[/rbutton][rbutton]7::WhatLVL;7[/rbutton][rbutton]8::WhatLVL;8[/rbutton][rbutton]9::WhatLVL;9[/rbutton] --X| --:WhatLVL| --=SlotLevel|[&amp;reentryval] --=SlotsTotal|0 --=SlotsExpended|[*S:lvl[$SlotLevel]_slots_expended] --?[$SlotsExpended.Raw] -eq [$SlotsTotal.Raw]|[ --&gt;NoSlotsLeft| --]|[ --?[$SlotLevel] -eq 0|NoSlot --=SlotsLeft|[$SlotsExpended] - 1 --!a:[*S:character_id]|lvl[$SlotLevel]_slots_expended:[$SlotsLeft] --=Targets|[$SlotLevel]-1 --a|cure_wounds --&gt;HealingWord| --]| --X| --:NoSlot| --X| --:NoSlotsLeft| --+|[b][*S:character_name] has no level [$SlotLevel.Total] spell slots available.[/b] --X|NoSlotsLeftStop --X| --:tooFar| --+|The target is too far away. --X| }} I tried the macro you proposed, it's very nice but it seems that the wisdom modifier is not added [From what I read in the macro it seems that is added the wisdom modifier of the target creature and not the caster's one(--=HPRecovered|[$SlotLevel]d4 + @{selected|wisdom_mod})] and despite the line --@token-mod| _set bar1_value|+[$Wounds] _ids @{target|token_id} target token life is not increased
1705870486

Edited 1705870950
So if you want another ScriptCard alternative to look at. This is mine: !scriptcard {{ --/|VARIABLES TO SET --&amp;HPBar|1 --&amp;CheckDistances|true --&amp;UseStoredFormatting|true --&amp;verboseOutput|true --&amp;FeatureName|Healing Word --&amp;MinimumSpellLevel|1 --/|NOTE: This uses the attribute spell_casting_ability which may cause issues for multi-class characters with multiple spell abilities --#title|[&amp;FeatureName] --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#reentrant|[&amp;FeatureName][*S:t-id] --?"[&amp;UseStoredFormatting]" -ne "true"|ScriptStart --Lsettings|[*[&amp;TID]:t-name] --:ScriptStart| --Rfind|[*S:character_id];[&amp;FeatureName];repeating_spell-[&amp;MinimumSpellLevel];spellname --?"[*R:spellname]" -eq "NoRepeatingAttributeLoaded"|&gt;FatalError;Healing Spell Not Found;Cannot find level [&amp;MinimumSpellLevel] healing spell named [&amp;FeatureName] --&gt;Lib5eCasting_GetAvailableSpellSlots|[*S:character_id];[&amp;MinimumSpellLevel];SpellsAvailableArr --?[@SpellsAvailableArr(length)] -lt 1|&gt;FatalError;Out of Spell Slots;No available spells slots of level [&amp;MinimumSpellLevel] or above --?"[&amp;CheckDistances]" -ne "true"|GetCastingLevel --/|NOTE: This currently uses a crude distance check that works when all tokens are 1 square. --/|This could be replaced by an adjacency and distance check that works better for larger size tokens if needed --~DistanceInSquares|distance;[*S:t-id];[*T:t-id] --?"[*R:spellrange]" -eq "Touch"|[ --&amp;MaxSquareRange|1 --]|[ --~tmpRange|string;onlynumbers;[*R:spellrange] --&amp;MaxSquareRange|[= [&amp;tmpRange] \ 5] --]| --?[$DistanceInSquares] -gt [&amp;MaxSquareRange]|&gt;FatalError;Target Too Far Away;[*S:t-name] is [$DistanceInSquares] squares away from [*T:t-name] and [&amp;FeatureName] has a max range of [&amp;MaxSquareRange] --:GetCastingLevel| --&amp;castingLevel|[&amp;MinimumSpellLevel] --?[@SpellsAvailableArr(length)] -eq 1|[ --?"[&amp;verboseOutput]" -eq "true"|+;Only 1 available spell level. Casting at level [@SpellsAvailableArr(0)] --&amp;castingLevel|[@SpellsAvailableArr(0)] --^ProcessSpell| --]| --+|[c][b]Choose Spell Level for [&amp;FeatureName][/b][/c] --&amp;splvlMsg| --%splvl|foreach;SpellsAvailableArr --&amp;splvlMsg|+[rbutton][&amp;splvl]::ChooseSpellLevel;[&amp;splvl][/rbutton] --%| --+|[c][&amp;splvlMsg][/c] --:Done| --X| --:Lib5eCasting_GetAvailableSpellSlots|CharacterID;MinimumSpellLevel;ArrayNameToSet --~|array;define;[%3%] --%SpellLvlLoop|[%2%];9;1 --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_total] -le 0|%! --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_expended] -le 0|% --~|array;add;[%3%];[&amp;SpellLvlLoop] --%| --&lt;| --:ChooseSpellLevel|LevelToCastSpell --&amp;castingLevel|[&amp;reentryval] --^ProcessSpell| --:ProcessSpell| --&amp;castingAbility|[*S:spellcasting_ability_name] --?"[&amp;castingAbility]" -eq "undefined"|&gt;FatalError;No Spell Casting Attribute Found;Could not find an attribute spellcasting_ability_name for [*S:character_name] --?[&amp;castingLevel] -eq [&amp;MinimumSpellLevel]|[ --=Heal|[*R:spellhealing] + [*S:[&amp;castingAbility(tolowercase)]_mod] [MOD] --]|[ --=additionalDice|[&amp;castingLevel] - [&amp;MinimumSpellLevel] * [*R:spellhldie] --=Heal|[*R:spellhealing] + [$additionalDice][*R:spellhldietype] [UPCAST] + [*S:[&amp;castingAbility(tolowercase)]_mod] [MOD] --]| --#emoteText|[*S:character_name] casts [&amp;FeatureName] at level [&amp;castingLevel] on [*T:t-name] --=NewHP|[*T:t-bar[&amp;HPBar]_value] + [$Heal] --?[$NewHP.Total] -gt [*T:t-bar[&amp;HPBar]_max]|[ --=NewHP|[*T:t-bar[&amp;HPBar]_max] --]| --+[&amp;FeatureName]|[*S:t-name] restores [$Heal] hp to [*T:t-name] --!t:[*T:t-id]|bar[&amp;HPBar]_value:[$NewHP.Total] --!a:[*S:character_id]|lvl[&amp;castingLevel]_slots_expended:-=1 --^Done| --:FatalError|EmoteText;ErrorMessage --#emoteText|[%1%] --+ERROR|[%2%] --^Done| }} So the configuration variables are at the top: --&amp;HPBar|1 - sets the Token Bar set to HP --&amp;CheckDistances|true - If true, will check the spell's range and distance between tokens. Currently only works if both tokens are 1 square --&amp;UseStoredFormatting|true - Set to true if you want to use Keith Curtis'&nbsp; Supernotes &nbsp;and&nbsp; --#OverrideTemplate --&amp;verboseOutput|true - Will print a message if only 1 level of spell is available that it defaulted to casting at that level --&amp;FeatureName|Healing Word - The name of the spell. Change to Cure Wounds if you want for that. --&amp;MinimumSpellLevel|1 - This is set because it makes it easier to find the spell in the repeating_spells-&lt;LEVEL&gt; section This doesn't require any other mods as is. So you don't need TokenMod or ChatSetAttr. It isn't currently ready to handle the Mass spells with multiple targets, that's on a TODO list. But this should work for both Healing Word and Cure Wounds if you change the --&amp;FeatureName and the HPBar is set to whatever Token bar you use for HP. Let me know if you have any questions. EDIT: Just to add an example screenshot when it prompts for the spell level with buttons.
I tried the macro you proposed, it's very nice but it seems that the wisdom modifier is not added [From what I read in the macro it seems that is added the wisdom modifier of the target creature and not the caster's one(--=HPRecovered|[$SlotLevel]d4 + @{selected|wisdom_mod})] and despite the line --@token-mod| _set bar1_value|+[$Wounds] _ids @{target|token_id} target token life is not increased The macro adds the wisdom modifier of the caster, not the target. @{selected|wisdom_mod} refers to the selected target at the time of casting, so the caster. As for the token not being updated, it would have to have bar1 set to hp and have the TokenMod script installed as well. Joshua's solution is probably the better one, as he has made it more customizable. He has the adjustable Variables at the top and is using ScriptCards' token object modification rather than having to have TokenMod installed. Joshua's also doesn't have all my template formatting jumbling things up.
1705873442

Edited 1705873561
Joshua, just testing out your macro. It's calling to an attribute my game doesn't seem to have; spellcasting_ability_name. I'm using the D&amp;D 5e OGL by Roll20 character sheet. I have the attribute spellcasting_ability which is set to @{wisdom_mod}. Are you using something else to strip the spellcasting ability out of the other attribute to create spellcasting_ability_name?
Odd. I checked in my oldest game and that ability is indeed missing. In my newer games it's there. Both games show all the characters have a version attribute of 4.21 so not sure why my new games have it and old games don't even when I make a new character. I have some older code around that will fix that. It's just bulkier. Let me grab that and update. It's a shame that attribute isn't universal.
Strange, my game is less than 2 months old.&nbsp;
Yeah. It's possible I did that. I do add attributes at times to make things easier for me but I don't remember doing that and it's not in any of my game setup scripts either. Either way here is a more portable version: !scriptcard {{ --/|VARIABLES TO SET --&amp;HPBar|1 --&amp;CheckDistances|true --&amp;UseStoredFormatting|true --&amp;verboseOutput|true --&amp;FeatureName|Healing Word --&amp;MinimumSpellLevel|1 --/|NOTE: Set to Spell Casting Attribute full name ie. wisdom_mod or charisma_mod to hardcode --/|If this is blank, then the script will take the main class and determine the casting ability ie. Paladin=Charisma and Cleric=Wisdom --/|Does not handle multi-class characters at present so hardcode if the main class is not used for this spell --&amp;CastingAttribute| --#title|[&amp;FeatureName] --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#reentrant|[&amp;FeatureName][*S:t-id] --?"[&amp;UseStoredFormatting]" -ne "true"|ScriptStart --Lsettings|[*[&amp;TID]:t-name] --:ScriptStart| --Rfind|[*S:character_id];[&amp;FeatureName];repeating_spell-[&amp;MinimumSpellLevel];spellname --?"[*R:spellname]" -eq "NoRepeatingAttributeLoaded"|&gt;FatalError;Healing Spell Not Found;Cannot find level [&amp;MinimumSpellLevel] healing spell named [&amp;FeatureName] --&gt;Lib5eCasting_GetAvailableSpellSlots|[*S:character_id];[&amp;MinimumSpellLevel];SpellsAvailableArr --?[@SpellsAvailableArr(length)] -lt 1|&gt;FatalError;Out of Spell Slots;No available spells slots of level [&amp;MinimumSpellLevel] or above --?"[&amp;CheckDistances]" -ne "true"|GetCastingLevel --/|NOTE: This currently uses a crude distance check that works when all tokens are 1 square. --/|This could be replaced by an adjacency and distance check that works better for larger size tokens if needed --~DistanceInSquares|distance;[*S:t-id];[*T:t-id] --?"[*R:spellrange]" -eq "Touch"|[ --&amp;MaxSquareRange|1 --]|[ --~tmpRange|string;onlynumbers;[*R:spellrange] --&amp;MaxSquareRange|[= [&amp;tmpRange] \ 5] --]| --?[$DistanceInSquares] -gt [&amp;MaxSquareRange]|&gt;FatalError;Target Too Far Away;[*S:t-name] is [$DistanceInSquares] squares away from [*T:t-name] and [&amp;FeatureName] has a max range of [&amp;MaxSquareRange] --:GetCastingLevel| --&amp;castingLevel|[&amp;MinimumSpellLevel] --?[@SpellsAvailableArr(length)] -eq 1|[ --?"[&amp;verboseOutput]" -eq "true"|+;Only 1 available spell level. Casting at level [@SpellsAvailableArr(0)] --&amp;castingLevel|[@SpellsAvailableArr(0)] --^ProcessSpell| --]| --+|[c][b]Choose Spell Level for [&amp;FeatureName][/b][/c] --&amp;splvlMsg| --%splvl|foreach;SpellsAvailableArr --&amp;splvlMsg|+[rbutton][&amp;splvl]::ChooseSpellLevel;[&amp;splvl][/rbutton] --%| --+|[c][&amp;splvlMsg][/c] --:Done| --X| --:Lib5eCasting_GetAvailableSpellSlots|CharacterID;MinimumSpellLevel;ArrayNameToSet --~|array;define;[%3%] --%SpellLvlLoop|[%2%];9;1 --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_total] -le 0|%! --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_expended] -le 0|% --~|array;add;[%3%];[&amp;SpellLvlLoop] --%| --&lt;| --:Lib5eCasting_GetCastingAbility|Class;StringVariableToSet --?"[%1%]" -eq "Artificer"|&amp;[%2%];Intelligence --?"[%1%]" -eq "Bard"|&amp;[%2%];Charisma --?"[%1%]" -eq "Cleric"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Druid"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Paladin"|&amp;[%2%];Charisma --?"[%1%]" -eq "Ranger"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Sorcerer"|&amp;[%2%];Charisma --?"[%1%]" -eq "Warlock"|&amp;[%2%];Charisma --?"[%1%]" -eq "Wizard"|&amp;[%2%];Intelligence --&lt;| --:ChooseSpellLevel|LevelToCastSpell --&amp;castingLevel|[&amp;reentryval] --^ProcessSpell| --:ProcessSpell| --?"[&amp;CastingAttribute]X" -eq "X"|[ --&gt;Lib5eCasting_GetCastingAbility|[*S:class];castingAbility --?"[&amp;castingAbility]X" -eq "X"|&gt;FatalError;No Spell Casting Attribute Found;Could not determine casting attribute for [*S:class] named [*S:character_name] --&amp;CastingAttribute|[&amp;castingAbility(tolowercase)]_mod --]| --?[&amp;castingLevel] -eq [&amp;MinimumSpellLevel]|[ --=Heal|[*R:spellhealing] + [*S:[&amp;CastingAttribute]] [MOD] --]|[ --=additionalDice|[&amp;castingLevel] - [&amp;MinimumSpellLevel] * [*R:spellhldie] --=Heal|[*R:spellhealing] + [$additionalDice][*R:spellhldietype] [UPCAST] + [*S:[&amp;CastingAttribute]] [MOD] --]| --#emoteText|[*S:character_name] casts [&amp;FeatureName] at level [&amp;castingLevel] on [*T:t-name] --=NewHP|[*T:t-bar[&amp;HPBar]_value] + [$Heal] --?[$NewHP.Total] -gt [*T:t-bar[&amp;HPBar]_max]|[ --=NewHP|[*T:t-bar[&amp;HPBar]_max] --]| --+[&amp;FeatureName]|[*S:t-name] restores [$Heal] hp to [*T:t-name] --!t:[*T:t-id]|bar[&amp;HPBar]_value:[$NewHP.Total] --!a:[*S:character_id]|lvl[&amp;castingLevel]_slots_expended:-=1 --^Done| --:FatalError|EmoteText;ErrorMessage --#emoteText|[%1%] --+ERROR|[%2%] --^Done| }} If you want to hardcode the attribute name, like wisdom_mod or charisma_mod then you can set it with this: --&amp;CastingAttribute| If that is left blank, it will use the main class, meaning no secondary caster classes, to determine the casting attribute and use that mod. Sorry about that. It would seem I created some attributes I automated around but have no recollection of. Bizarre.
This stuff is bound to happen with heavily modified games, it does to mine all the time. Trying to keep track of everything I've tested out and discarded or am even using currently starts to become rather difficult. The good news is, this Healing Word spell works great!
Joshua N. said: Yeah. It's possible I did that. I do add attributes at times to make things easier for me but I don't remember doing that and it's not in any of my game setup scripts either. Either way here is a more portable version: !scriptcard {{ --/|VARIABLES TO SET --&amp;HPBar|1 --&amp;CheckDistances|true --&amp;UseStoredFormatting|true --&amp;verboseOutput|true --&amp;FeatureName|Healing Word --&amp;MinimumSpellLevel|1 --/|NOTE: Set to Spell Casting Attribute full name ie. wisdom_mod or charisma_mod to hardcode --/|If this is blank, then the script will take the main class and determine the casting ability ie. Paladin=Charisma and Cleric=Wisdom --/|Does not handle multi-class characters at present so hardcode if the main class is not used for this spell --&amp;CastingAttribute| --#title|[&amp;FeatureName] --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#reentrant|[&amp;FeatureName][*S:t-id] --?"[&amp;UseStoredFormatting]" -ne "true"|ScriptStart --Lsettings|[*[&amp;TID]:t-name] --:ScriptStart| --Rfind|[*S:character_id];[&amp;FeatureName];repeating_spell-[&amp;MinimumSpellLevel];spellname --?"[*R:spellname]" -eq "NoRepeatingAttributeLoaded"|&gt;FatalError;Healing Spell Not Found;Cannot find level [&amp;MinimumSpellLevel] healing spell named [&amp;FeatureName] --&gt;Lib5eCasting_GetAvailableSpellSlots|[*S:character_id];[&amp;MinimumSpellLevel];SpellsAvailableArr --?[@SpellsAvailableArr(length)] -lt 1|&gt;FatalError;Out of Spell Slots;No available spells slots of level [&amp;MinimumSpellLevel] or above --?"[&amp;CheckDistances]" -ne "true"|GetCastingLevel --/|NOTE: This currently uses a crude distance check that works when all tokens are 1 square. --/|This could be replaced by an adjacency and distance check that works better for larger size tokens if needed --~DistanceInSquares|distance;[*S:t-id];[*T:t-id] --?"[*R:spellrange]" -eq "Touch"|[ --&amp;MaxSquareRange|1 --]|[ --~tmpRange|string;onlynumbers;[*R:spellrange] --&amp;MaxSquareRange|[= [&amp;tmpRange] \ 5] --]| --?[$DistanceInSquares] -gt [&amp;MaxSquareRange]|&gt;FatalError;Target Too Far Away;[*S:t-name] is [$DistanceInSquares] squares away from [*T:t-name] and [&amp;FeatureName] has a max range of [&amp;MaxSquareRange] --:GetCastingLevel| --&amp;castingLevel|[&amp;MinimumSpellLevel] --?[@SpellsAvailableArr(length)] -eq 1|[ --?"[&amp;verboseOutput]" -eq "true"|+;Only 1 available spell level. Casting at level [@SpellsAvailableArr(0)] --&amp;castingLevel|[@SpellsAvailableArr(0)] --^ProcessSpell| --]| --+|[c][b]Choose Spell Level for [&amp;FeatureName][/b][/c] --&amp;splvlMsg| --%splvl|foreach;SpellsAvailableArr --&amp;splvlMsg|+[rbutton][&amp;splvl]::ChooseSpellLevel;[&amp;splvl][/rbutton] --%| --+|[c][&amp;splvlMsg][/c] --:Done| --X| --:Lib5eCasting_GetAvailableSpellSlots|CharacterID;MinimumSpellLevel;ArrayNameToSet --~|array;define;[%3%] --%SpellLvlLoop|[%2%];9;1 --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_total] -le 0|%! --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_expended] -le 0|% --~|array;add;[%3%];[&amp;SpellLvlLoop] --%| --&lt;| --:Lib5eCasting_GetCastingAbility|Class;StringVariableToSet --?"[%1%]" -eq "Artificer"|&amp;[%2%];Intelligence --?"[%1%]" -eq "Bard"|&amp;[%2%];Charisma --?"[%1%]" -eq "Cleric"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Druid"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Paladin"|&amp;[%2%];Charisma --?"[%1%]" -eq "Ranger"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Sorcerer"|&amp;[%2%];Charisma --?"[%1%]" -eq "Warlock"|&amp;[%2%];Charisma --?"[%1%]" -eq "Wizard"|&amp;[%2%];Intelligence --&lt;| --:ChooseSpellLevel|LevelToCastSpell --&amp;castingLevel|[&amp;reentryval] --^ProcessSpell| --:ProcessSpell| --?"[&amp;CastingAttribute]X" -eq "X"|[ --&gt;Lib5eCasting_GetCastingAbility|[*S:class];castingAbility --?"[&amp;castingAbility]X" -eq "X"|&gt;FatalError;No Spell Casting Attribute Found;Could not determine casting attribute for [*S:class] named [*S:character_name] --&amp;CastingAttribute|[&amp;castingAbility(tolowercase)]_mod --]| --?[&amp;castingLevel] -eq [&amp;MinimumSpellLevel]|[ --=Heal|[*R:spellhealing] + [*S:[&amp;CastingAttribute]] [MOD] --]|[ --=additionalDice|[&amp;castingLevel] - [&amp;MinimumSpellLevel] * [*R:spellhldie] --=Heal|[*R:spellhealing] + [$additionalDice][*R:spellhldietype] [UPCAST] + [*S:[&amp;CastingAttribute]] [MOD] --]| --#emoteText|[*S:character_name] casts [&amp;FeatureName] at level [&amp;castingLevel] on [*T:t-name] --=NewHP|[*T:t-bar[&amp;HPBar]_value] + [$Heal] --?[$NewHP.Total] -gt [*T:t-bar[&amp;HPBar]_max]|[ --=NewHP|[*T:t-bar[&amp;HPBar]_max] --]| --+[&amp;FeatureName]|[*S:t-name] restores [$Heal] hp to [*T:t-name] --!t:[*T:t-id]|bar[&amp;HPBar]_value:[$NewHP.Total] --!a:[*S:character_id]|lvl[&amp;castingLevel]_slots_expended:-=1 --^Done| --:FatalError|EmoteText;ErrorMessage --#emoteText|[%1%] --+ERROR|[%2%] --^Done| }} If you want to hardcode the attribute name, like wisdom_mod or charisma_mod then you can set it with this: --&amp;CastingAttribute| If that is left blank, it will use the main class, meaning no secondary caster classes, to determine the casting attribute and use that mod. Sorry about that. It would seem I created some attributes I automated around but have no recollection of. Bizarre. It's perfect! Cure Wounds also works.. I would like to take full advantage of your help; the cleric has chosen the Life Domain, it would be possible to add the bonus given by Disciple of Life (2+spell's level)?
Here is a pretty quick attempt to support bonus healing. It's not super intuitive unfortunately. I should work on that and make it easier but here is a script that will support the Disciple of Life subclass feature. !scriptcard {{ --/|VARIABLES TO SET --&amp;HPBar|1 --&amp;CheckDistances|true --&amp;UseStoredFormatting|true --&amp;verboseOutput|true --&amp;FeatureName|Healing Word --&amp;MinimumSpellLevel|1 --/|NOTE: Set to Spell Casting Attribute full name ie. wisdom_mod or charisma_mod to hardcode --/|If this is blank, then the script will take the main class and determine the casting ability ie. Paladin=Charisma and Cleric=Wisdom --/|Does not handle multi-class characters at present so hardcode if the main class is not used for this spell --&amp;CastingAttribute| --/|NOTE: Several subclasses have bonus options for healing. This is a hasty attempt to support those --/|Example: for a Life Domain cleric add the following 2 + %5B%26castingLevel%5D where castingLevel is a variable set later in this script --/|TODO: create a library function to determine subclasses and bonus healing for Circle of Stars, Celestial Warlock, etc --&amp;bonusHealingFormula|2 + %5B%26castingLevel%5D --#title|[&amp;FeatureName] --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#reentrant|[&amp;FeatureName][*S:t-id] --?"[&amp;UseStoredFormatting]" -ne "true"|ScriptStart --Lsettings|[*[&amp;TID]:t-name] --:ScriptStart| --Rfind|[*S:character_id];[&amp;FeatureName];repeating_spell-[&amp;MinimumSpellLevel];spellname --?"[*R:spellname]" -eq "NoRepeatingAttributeLoaded"|&gt;FatalError;Healing Spell Not Found;Cannot find level [&amp;MinimumSpellLevel] healing spell named [&amp;FeatureName] --&gt;Lib5eCasting_GetAvailableSpellSlots|[*S:character_id];[&amp;MinimumSpellLevel];SpellsAvailableArr --?[@SpellsAvailableArr(length)] -lt 1|&gt;FatalError;Out of Spell Slots;No available spells slots of level [&amp;MinimumSpellLevel] or above --?"[&amp;CheckDistances]" -ne "true"|GetCastingLevel --/|NOTE: This currently uses a crude distance check that works when all tokens are 1 square. --/|This could be replaced by an adjacency and distance check that works better for larger size tokens if needed --~DistanceInSquares|distance;[*S:t-id];[*T:t-id] --?"[*R:spellrange]" -eq "Touch"|[ --&amp;MaxSquareRange|1 --]|[ --~tmpRange|string;onlynumbers;[*R:spellrange] --&amp;MaxSquareRange|[= [&amp;tmpRange] \ 5] --]| --?[$DistanceInSquares] -gt [&amp;MaxSquareRange]|&gt;FatalError;Target Too Far Away;[*S:t-name] is [$DistanceInSquares] squares away from [*T:t-name] and [&amp;FeatureName] has a max range of [&amp;MaxSquareRange] --:GetCastingLevel| --&amp;castingLevel|[&amp;MinimumSpellLevel] --?[@SpellsAvailableArr(length)] -eq 1|[ --?"[&amp;verboseOutput]" -eq "true"|+;Only 1 available spell level. Casting at level [@SpellsAvailableArr(0)] --&amp;castingLevel|[@SpellsAvailableArr(0)] --^ProcessSpell| --]| --+|[c][b]Choose Spell Level for [&amp;FeatureName][/b][/c] --&amp;splvlMsg| --%splvl|foreach;SpellsAvailableArr --&amp;splvlMsg|+[rbutton][&amp;splvl]::ChooseSpellLevel;[&amp;splvl][/rbutton] --%| --+|[c][&amp;splvlMsg][/c] --:Done| --X| --:Lib5eCasting_GetAvailableSpellSlots|CharacterID;MinimumSpellLevel;ArrayNameToSet --~|array;define;[%3%] --%SpellLvlLoop|[%2%];9;1 --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_total] -le 0|%! --?[*[%1%]:lvl[&amp;SpellLvlLoop]_slots_expended] -le 0|% --~|array;add;[%3%];[&amp;SpellLvlLoop] --%| --&lt;| --:Lib5eCasting_GetCastingAbility|Class;StringVariableToSet --?"[%1%]" -eq "Artificer"|&amp;[%2%];Intelligence --?"[%1%]" -eq "Bard"|&amp;[%2%];Charisma --?"[%1%]" -eq "Cleric"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Druid"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Paladin"|&amp;[%2%];Charisma --?"[%1%]" -eq "Ranger"|&amp;[%2%];Wisdom --?"[%1%]" -eq "Sorcerer"|&amp;[%2%];Charisma --?"[%1%]" -eq "Warlock"|&amp;[%2%];Charisma --?"[%1%]" -eq "Wizard"|&amp;[%2%];Intelligence --&lt;| --:ChooseSpellLevel|LevelToCastSpell --&amp;castingLevel|[&amp;reentryval] --^ProcessSpell| --:ProcessSpell| --?"[&amp;CastingAttribute]X" -eq "X"|[ --&gt;Lib5eCasting_GetCastingAbility|[*S:class];castingAbility --?"[&amp;castingAbility]X" -eq "X"|&gt;FatalError;No Spell Casting Attribute Found;Could not determine casting attribute for [*S:class] named [*S:character_name] --&amp;CastingAttribute|[&amp;castingAbility(tolowercase)]_mod --]| --?"[&amp;bonusHealingFormula]X" -eq "X"|BeginHealingRoll --~bonusHealingFormula|string;replaceencoding;[&amp;bonusHealingFormula] --:BeginHealingRoll| --?[&amp;castingLevel] -eq [&amp;MinimumSpellLevel]|[ --=Heal|[*R:spellhealing] + [*S:[&amp;CastingAttribute]] [MOD] + [&amp;bonusHealingFormula] [BONUS] --]|[ --=additionalDice|[&amp;castingLevel] - [&amp;MinimumSpellLevel] * [*R:spellhldie] --=Heal|[*R:spellhealing] + [$additionalDice][*R:spellhldietype] [UPCAST] + [*S:[&amp;CastingAttribute]] [MOD] + [&amp;bonusHealingFormula] [BONUS] --]| --#emoteText|[*S:character_name] casts [&amp;FeatureName] at level [&amp;castingLevel] on [*T:t-name] --=NewHP|[*T:t-bar[&amp;HPBar]_value] + [$Heal] --?[$NewHP.Total] -gt [*T:t-bar[&amp;HPBar]_max]|[ --=NewHP|[*T:t-bar[&amp;HPBar]_max] --]| --+[&amp;FeatureName]|[*S:t-name] restores [$Heal] hp to [*T:t-name] --!t:[*T:t-id]|bar[&amp;HPBar]_value:[$NewHP.Total] --!a:[*S:character_id]|lvl[&amp;castingLevel]_slots_expended:-=1 --^Done| --:FatalError|EmoteText;ErrorMessage --#emoteText|[%1%] --+ERROR|[%2%] --^Done| }} For changes it's this line here: --&amp;bonusHealingFormula|2 + %5B%26castingLevel%5D This uses encoding replacements for [, &amp;, and ]. After replacement it will look like 2 + [&amp;castingLevel] but his will prevent ScriptCards from replacing the string variable [&amp;castingLevel] too soon before it's been set. Full list of encoding can be found&nbsp; here . So for another example the Druid's Circle of Stars Starry Form - Chalise form would use the nearly unreadable --&amp;bonusHealingFormula|1d8 + %5B%2AS%22%5B%26CastingAttribute%5D%5D which is [*S:[&amp;CastingAttribute]]. It's far from a perfect solution but should work for you. For non-Life Clerics you can simply delete the 2 +&nbsp;%5B%26castingLevel%5D.
Really thanks again!&nbsp; Tomorrow I will add what you sent me to the cleric's sheet;&nbsp; By chance there is also a Circle of the Star druid in the group, I will fix him too.