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

Lay on Hands token action macro

Hi,  Beginner scriptor having issues with a simple Lay on Hands macro. I have created a simple macro that will look at the class resource and let you know how much of your pool you have left and then update the target tokens health. I cant get the script to lower the class resource for the Paladin. Here is the script so far. The last line doesn't work. &{template:default}{{name=Lay on Hands}}{{Lay on Hands Heals @{target|character_name}=[[?{Lay on Hands @{selected|class_resource} points available|0}]] HP}} !token-mod --ids @{target|token_id} --set bar1_value|+?{Lay on Hands @{selected|class_resource} points available|0} !token-mod --ids @{selected|class_resource} --set class_resource_value|-{Lay on Hands @{selected|class_resource} points available|0} Any help would bet greatly appreciated Fad
1630989032
Victor B.
Pro
Sheet Author
API Scripter
Why bother?  Paladin casts lay on hands.  Dice are rolled.  Recipient(s) bump up their HP.  No need to automate this.  
1630989702

Edited 1630989798
GiGs
Pro
Sheet Author
API Scripter
It looks like you are missing the ? in the query. It should probably be !token-mod --ids @{selected|class_resource} --set class_resource_value|- ? {Lay on Hands @{selected|class_resource} points available|0} That said, token_mod is for modifying tokens, not characters. For something like this, you probably need chatSetAttr.
1631009413

Edited 1631019213
Hi, Here's what i use : (mostly because I probably bother too much)  !?{Nombre de points de vie a donner|@{selected|other_resource}} !token-mod --ids @{target|Qui guérir|token_id} --set bar1_value|+[[{?{Nombre de points de vie a donner},[[@{target|Qui guérir|hp|max}-@{target|Qui guérir|hp}]]}kl1]] !modattr --silent --name @{selected|token_name} --other_resource|-[[{?{Nombre de points de vie a donner},[[@{target|Qui guérir|hp|max}-@{target|Qui guérir|hp}]]}kl1]] &{template:atkdmg} {{desc=Vous pouvez également dépenser 5 points de vie de votre réserve pour guérir la cible d'une maladie ou neutraliser un poison qui l'affecte. Vous avez utilisé [[{?{Nombre de points de vie a donner},[[@{target|Qui guérir|hp|max}-@{target|Qui guérir|hp}]]}kl1]] points.}} {{charname=@{selected|token_name}}} {{normal=1}} {{mod=sur ***@{target|Qui guérir|token_name}***}} {{rname=IMPOSITION DES MAINS That asks for a target to cure, asks for how many points, checks on points available, credits the cured character, substract the amount of points of the curer and tells how many points left (It's in french but i'm sure you will be able to sort it out or translate if needed...)
This is the Macro I use. You need to install CHATSETATTR and Ammo. First line will add the any amount that you enter to the character that you select on the drop down. then ammo will substract from your lay on hand pool. Hope this help. Is simple but it works. !setattr --name ?{Select Character to Heal|Akire|Baka|Iggy|Heskan|Von} --modb --HP|?{Amount to Heal?} !ammo @{selected|token_id} other_resource -?{Amount to Heal?} Lay on Hands
This is great on paper but not in practice.  LoH is too simple.  However I do use this idea on preserve life.  I use a macro/script on preserve life so that I don't have to do the complex math in my head on the fly.  Here, theres little math and the actual script/macro takes longer then just speaking over voice chat what amount you choose to heal for.  Alot of scripts in general here go out of their way to look cool and flashy and dope to try out, but in a live play session fall flat, are cumbersome, and generally just overcomplicate the player's and Dm's experience for no reason other then aesthetics or programming chops.  If you want to try it for those reasons, more power to you, but I enjoy DM'ing to be a DM, not a playtester, troubleshooter, programmer, or a mix of all of the above.  This is coming from someone who has wasted hundreds of hours trying to make amazing fun scripts and buttons for players only to have said players ignore them and go straight to their sheets every.single.time.  
Thanks for the feedback. I was asked to create it. I hope it will be used. I finally got it to work how I wanted. I have added the ChatSetAttr and Ammo scripts. It now works perfectly. Here is my final script. &{template:default}{{name=Lay on Hands}}{{Lay on Hands Heals @{target|character_name}=[[?{Lay on Hands @{selected|class_resource} points available|0}]] HP}} !token-mod --ids @{target|token_id} --set bar1_value|+?{Lay on Hands @{selected|class_resource} points available|0} !ammo @{selected|character_id} class_resource -?{Lay on Hands @{selected|class_resource} points available|0} Lay on Hands /w @{target|character_name} Your HP have automatically been updated. And this is what the Chat looks like. Fad (GM): -7 Lay on Hands Lay on Hands Heals Gulduhr 7 HP (To Gulduhr):  Your HP have automatically been updated. Ellisare Selathorin  uses 7 Lay on Hands and has 28 remaining.