
My group is currently playing Dungeon of the Mad Mage with
significantly more players than typically recommended. The DM is looking
to level the playing field by switching all the monster's HP values
from their Median to their Maximum. (IE: A goblin goes from 7 hp to 12) But
there are a lot of enemies in this module, and we're hoping to use an
API/Macro to do the job for us. Trouble is, I'm a complete noob at
writing for Roll20's API and I'm looking for some help. What
I'm looking to do is create a macro (so I can use VTT to roll a bulk
macro) that reads the selected token's npc_hpformula, make a roll where
"d" is replaced with "*" (ex; 3d6+3 becomes 3*6+3), then write the
result back to Bar 1's Max and Min. (I'd also like the code to not run
in the case that the npc doesn't have an hp formula, so they don't wind
up with Zero HP). I know how to call npc_hpformula. I don't
know how to run the find and replace, and I don't know how to write a
value directly to a token. Any help would be appreciated.