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

ChatsetAttr for 5e Sorcery Points and Gunslinger Clip Reload Macro Help

Hi team,  I'm new to using ChatSetAttr and I have hit an issue, I humbly ask for any help and any suggestions to improve what I'm trying to do.  The issue I'm having intermittently is that I am bundling a few commands into one token action macro with 2 ChatSetAttr commands in it. It works most of the time but will occasionally only run 1 of the 2, meaning me or one of my players need to go into the sheet to make the update. Not the worst but maybe something someone else has encountered. This happens for a gunslinger reload macro and a convert sorcery points into spell slots macro.  Gunslinger Clip Reload Macro: (I have tried removing the /em and Simple Sound API command and the failure rate seems to be the same). !modattr --fb-public --fb-header Clip --charid @{Charles Lee Norrisson|character_id} --repeating_resource_-MjwZyzc3ZKZqs8WT4pg_resource_left|+4 --fb-content 4 Bullets inserted into Clip !modattr --fb-public --fb-header Bullets --charid @{Charles Lee Norrisson|character_id} --class_resource|-4 --fb-content 4 Bullets Removed from Bullets _CUR0_ remaining /em Reload !splay reload  Convert Sorcery Points !modattr --fb-public --fb-header Sorcery Points --charid @{Void|character_id} --repeating_resource_-MLSxKxfD34cOelBRdes_resource_left|-2 --fb-content -2 Sorcery Points, _CUR0_ remaining !modattr --fb-public --fb-header Lvl 1 Spell Slots --charid @{Void|character_id} --lvl1_slots_expended|+1 --fb-content +1 Lvl1 Spell Slot, _CUR0_ remaining /em Create Lvl1 Slot It seems the simple fix is to split up the macros but ideally would like to keep it as a one button solution for the players.  Any help would be greatly appreciated!
For anyone following this thread I believe I have figured it out by combining it into one ChatSetAtt macro and editing the output message.  Below is the updated Gunslinger Reload macro.  !splay reload !modattr --fb-public --fb-header Clip --charid @{Charles Lee Norrisson|character_id} --repeating_resource_-MjwZyzc3ZKZqs8WT4pg_resource_left|+4 --charid @{Charles Lee Norrisson|character_id} --class_resource|-4 --fb-content 4 Bullets Removed from Bullets, _CUR1_ remaining. 4 Bullets added to Clip, _CUR0_ remaining /em Reload So far it has not failed once, when I get a moment I'll update the sorcery points macro but I'm expecting it to work exactly the same. 
I have made the sorcery point macro for ChatSetAtt and it has not failed once.  Create Level 1 Slot !modattr --fb-public --fb-header Create Lvl1 Slot --charid @{Void|character_id} --repeating_resource_-MLSxKxfD34cOelBRdes_resource_left|-2 --charid @{Void|character_id} --lvl1_slots_expended|+1 --fb-content +1 Lvl1 Spell Slot, _CUR1_ remaining. -2 Sorcery Points, _CUR0_ remaining Create Level 2 Slot !modattr --fb-public --fb-header Create Lvl2 Slot --charid @{Void|character_id} --repeating_resource_-MLSxKxfD34cOelBRdes_resource_left|-3 --charid @{Void|character_id} --lvl2_slots_expended|+1 --fb-content +1 Lvl2 Spell Slot, _CUR1_ remaining. -3 Sorcery Points, _CUR0_ remaining Create Sorcery Point from Spell Slot !modattr --fb-public --fb-header Gain 1 Sorcery Point --charid @{Void|character_id} --repeating_resource_-MLSxKxfD34cOelBRdes_resource_left|+1 --charid @{Void|character_id} --lvl1_slots_expended|-1 --fb-content +1 Sorcery Points, _CUR0_ remaining. -1 Lvl1 Spell Slot, _CUR1_ remaining From above you can keep making macros for more higher spell slots just updating the values. Hope this helps someone else! 
Thanks for sharing this, Jared. 
1654184578
timmaugh
Pro
API Scripter
Hey, Jared... just an FYI, I think you're running into this bug , where Roll20 randomly drops lines from multi-line macros. You're able to get around it because you're working in a single script, and ChatSetAttr is built to take many settings in one go. If you had to combine multiple commands that were calling different scripts, you can use the Plugger metascript to "embed" one command in another. Here is a message/thread where I describe that process.