Pathfinder Playtest Macro Generator (Python Script)


Edited 1537055988
Howdy, (I think this is the right forum for this!) I'm running the Pathfinder Playtest and for Part 1 I spent a lot of time making the macros for every attack of every enemy that the PCs would encounter in that part. In the end, it saved a lot of time during sessions, but writing macros by hand isn't exactly ideal. Making them all one big line with enough curly braces and square brackets to make me dizzy is a challenge. There has to be a better way! So ahead of Part 2, I made a python script to help me out. Check it out here: This script will take some text from a file that looks like this: > Scimitar melee +4 1d8+2 s * Forceful, Sweep And spit out a text file that has this: # SCIMITAR &{template:default} {{name=► **Scimitar**}} {{melee=[[d20+4[Hit]+?{MAP|0|-5|-10}[MAP]+?{Hit Bonus|0}[Bonus]]] }} {{damage=[[1d8+2+?{S Bonus|0}]] S}} {{critical=[[1d8+2+?{S Bonus|0}]] S}} {{•=*Forceful, Sweep*}} Then if you paste that into Roll 20, you get this: Here's a full example: And what that spits out: I made this specifically for the Pathfinder Playtest so a lot of the core features of this script reflect that system. When you make a macro for a melee or ranged attack it will add a prompt for the multi-attack penalty, and will also adjust that penalty if the word agile is included. How to use it Download it from here: If you don't have python installed on your computer, download and install it from here:  Go to the bottom of that page and choose one of the installer options for your operating system. Once python is installed, first ensure that the script "" is in it's own directory! When you run it, it will look for all .txt files it can find in the same directory, and attempt to read all of those files to generate roll20 macros. For instance, if you have a directory with the files: example.txt, purpleworm.txt, Running will generate a file for each .txt file it finds. After it runs, you should find two new files: _example-macros.txt, _purpleworm-macros.txt. These files contain the generated roll20 macros that you can paste into roll20 wherever your heart desires. Note that when macromaker looks for .txt files, it ignores any that have "-macros" in the file name, so it will not try to generate macros from the files it has generated. All this script does is generate new text files in the folder it's living in, so it should play nicely on your computer as long as you don't put it in your system32 folder and for some reason have important files that are text files with the word "-macros" in their name and then run it. If the script messes up it won't tell you what happened, and you'll just end up with a malformed roll20 macro, so be sure to stick to the style provided in the example.txt file. Beyond the features designed specifically for the Pathfinder Playtest, you can also use it to generate some free form macros. For example, this text: > Freeform Macro label: value roll: d20+4 damage: 4d4 test: d100 * A note about this macro * Another note here * More notes * See where this is going? Will become # FREEFORM MACRO &{template:default} {{name=► **Freeform Macro**}} {{Label=Value}}{{Roll=[[d20+4]]}}{{Damage=[[4d4]]}}{{Test=[[d100]]}}{{•=*A note about this macro*}} {{••=*Another note here*}} {{•••=*More notes*}} {{••••=*See where this is going?*}} Which looks like I'm not sure if this will be useful for others, but it sure looks like it's going to save me a lot of time moving forward. You might be asking why not just use character sheets? For my playgroup, we use an external source for our character sheets, and only use roll20 for maps and rolling. It's rough when a character sheet in roll20 has glitches or bugs that makes certain parts of them, or all of them, unusable, so my group prefers to make our own solutions. My group also uses a lot of macros lately, but writing them by hand is proving to be too much trouble for most of us, so this is my attempt to make the process smoother. I hope this all makes sense! I can't promise any additional features or major updates to this script moving forward, but hopefully it is useful to someone as it is!
Sheet Author
This looks handy. I'm pretty sure someone (maybe Keith) has made a similar project using a Google Sheets spreadsheet. The more of these kind of projects, the better IMO.