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

Pathfinder Playtest Macro Generator (Python Script)

1536957990

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:&nbsp; <a href="https://github.com/kylepulver/roll20-macro-generator" rel="nofollow">https://github.com/kylepulver/roll20-macro-generator</a> This script will take some text from a file that looks like this: &gt; Scimitar melee +4 1d8+2 s * Forceful, Sweep And spit out a text file that has this: # SCIMITAR &amp;{template:default} {{name=&amp;#9658; **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}} {{&amp;bull;=*Forceful, Sweep*}} Then if you paste that into Roll 20, you get this: Here's a full example:&nbsp; <a href="https://github.com/kylepulver/roll20-macro-generator/blob/master/example.txt" rel="nofollow">https://github.com/kylepulver/roll20-macro-generator/blob/master/example.txt</a> And what that spits out:&nbsp; <a href="https://github.com/kylepulver/roll20-macro-generator/blob/master/_example-macros.txt" rel="nofollow">https://github.com/kylepulver/roll20-macro-generator/blob/master/_example-macros.txt</a> 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:&nbsp; <a href="https://github.com/kylepulver/roll20-macro-generator/archive/master.zip" rel="nofollow">https://github.com/kylepulver/roll20-macro-generator/archive/master.zip</a> If you don't have python installed on your computer, download and install it from here:&nbsp; <a href="https://www.python.org/downloads/release/python-370/" rel="nofollow">https://www.python.org/downloads/release/python-370/</a> &nbsp;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 "macromaker.py" 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, macromaker.py. Running macromaker.py 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: &gt; 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 &amp;{template:default} {{name=&amp;#9658; **Freeform Macro**}} {{Label=Value}}{{Roll=[[d20+4]]}}{{Damage=[[4d4]]}}{{Test=[[d100]]}}{{&amp;bull;=*A note about this macro*}} {{&amp;bull;&amp;bull;=*Another note here*}} {{&amp;bull;&amp;bull;&amp;bull;=*More notes*}} {{&amp;bull;&amp;bull;&amp;bull;&amp;bull;=*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!
1536975207
GiGs
Pro
Sheet Author
API Scripter
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.